Jam*_*ing 50 registry ms-office 32bit-64bit office-2010
既然Office也是64位安装,在注册表中你会发现安装的Office版本是32位还是64位?
Tod*_*ain 50
从TechNet上的64位版本的Office 2010文章:
如果已安装包含Microsoft Outlook 2010的Office 2010,则Outlook 会在安装它的计算机上设置名为Bitness的注册表项 ,类型为REG_SZ.所述 位数的注册表项指示的Outlook 2010安装是否是32位或64位.这对于有兴趣审核计算机以确定其组织中已安装的Office 2010版本的管理员可能很有用.
- 注册表路径: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Outlook
- 如果您已安装Office 2013,则使用此注册表路径: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\15.0\Outlook
- 注册表项:比特
- 值:x86或x64
和同一篇文章中的其他地方:
从Office 2010开始,Outlook可用作32位应用程序和64位应用程序.您选择的Outlook版本(位数)取决于Windows操作系统(32位或64位)的版本以及计算机上安装的Office 2010(32位或64位)版本,如果Office已安装在该计算机上.
决定安装32位或64位版本Outlook的可行性的因素包括:
- 您可以在受支持的32位或64位版本的Windows操作系统上安装32位Office 2010和32位Microsoft Outlook 2010.您只能在受支持的64位操作系统上安装64位版本的Office 2010和64位Outlook 2010.
- 在64位版本的Windows操作系统上,Office 2010的默认安装是32位Office 2010.
- 如果Office安装在同一台计算机上,则安装的Outlook版本的位数始终与Office 2010的位数相同.也就是说,32位版本的Outlook 2010无法安装在已安装64位版本的其他Office 2010应用程序的同一台计算机上,例如64位Microsoft Word 2010或64位Microsoft Excel 2010. ,64位版本的Outlook 2010无法安装在已安装32位版本的其他Office应用程序的同一台计算机上.
Tod*_*odK 23
我已经测试了Otaku的答案,即使没有安装Outlook,似乎也设置了Outlook位度值,即使引用的文章没有明确表明会出现这种情况.
要添加到vtrz的答案,这是我为Inno Setup写的函数:
const
{ Constants for GetBinaryType return values. }
SCS_32BIT_BINARY = 0;
SCS_64BIT_BINARY = 6;
{ There are other values that GetBinaryType can return, but we're }
{ not interested in them. }
{ Declare Win32 function }
function GetBinaryType(lpApplicationName: AnsiString; var lpBinaryType: Integer): Boolean;
external 'GetBinaryTypeA@kernel32.dll stdcall';
function Is64BitExcelFromRegisteredExe(): Boolean;
var
excelPath: String;
binaryType: Integer;
begin
Result := False; { Default value - assume 32-bit unless proven otherwise. }
{ RegQueryStringValue second param is '' to get the (default) value for the key }
{ with no sub-key name, as described at }
{ http://stackoverflow.com/questions/913938/ }
if IsWin64() and RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe',
'', excelPath) then begin
{ We've got the path to Excel. }
try
if GetBinaryType(excelPath, binaryType) then begin
Result := (binaryType = SCS_64BIT_BINARY);
end;
except
{ Ignore - better just to assume it's 32-bit than to let the installation }
{ fail. This could fail because the GetBinaryType function is not }
{ available. I understand it's only available in Windows 2000 }
{ Professional onwards. }
end;
end;
end;
Run Code Online (Sandbox Code Playgroud)
遗憾的是,但Otacku和@ clatonh的方法都不适用于我 - 在注册表中没有Outlook Bitness或{90140000-0011-0000- 1000 -0000000FF1CE}(对于没有安装Outlook的64位Office).
但是,我发现的唯一方法是使用Windows API函数GetBinaryType(自Windows 2000 Professional以来)检查其中一个Office可执行文件的位数.
例如,您可以检查Winword.exe的位数,该路径存储在
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe下.
这是MFC代码片段:
CRegKey rk;
if (ERROR_SUCCESS == rk.Open(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Winword.exe",
KEY_READ)) {
CString strWinwordPath;
DWORD dwSize = MAX_PATH;
if (ERROR_SUCCESS == rk.QueryStringValue(strWinwordPath,
strWinwordPath.GetBuffer(MAX_PATH), &dwSize)) {
strWinwordPath.ReleaseBuffer();
DWORD dwBinaryType;
if (::GetBinaryType(strWinwordPath, &dwBinaryType)) {
if (SCS_64BIT_BINARY == dwBinaryType) {
// Detected 64-bit Office
} else {
// Detected 32-bit Office
}
} else {
// Failed
}
} else {
// Failed
}
} else {
// Failed
}
Run Code Online (Sandbox Code Playgroud)
注意:如果在.NET环境中调用,查询Outlook应用程序的位数并不可靠.
在这里,我们在DLL中使用GetBinaryType(),可以被任何应用程序调用:
使用完全相同的DLL代码和完全相同的Outlook二进制路径("c:/ Program Files(x86)/ ...")在同一台计算机上.
这意味着您可能需要使用"IMAGE_NT_HEADERS.FileHeader.Machine"条目自行测试二进制文件.
上帝,我讨厌某些Windows API的错误返回值(另请参阅GetVersion()谎言).
小智 5
我找到了检查办公室咬伤的方法。
我们可以使用此注册表项检查office 365和2016的位数:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration
Run Code Online (Sandbox Code Playgroud)
平台x86(32位)。
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration
Run Code Online (Sandbox Code Playgroud)
64位平台x64。
请检查...
| 归档时间: |
|
| 查看次数: |
164512 次 |
| 最近记录: |