Now that Office also comes in a 64bit install, where in the registry do you find out if the version of Office installed is 32bit or 64bit?
This InnoSetup code is working for me under Win 10x64 and Office 2016 x86 (using 'HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' and key 'Platform')
[Code]
const
RegOffice='SOFTWARE\Microsoft\Office\ClickToRun\Configuration';
RegOfficeKey='Platform';
///
/// Get current HKLM version
///
function GetHKLM: Integer;
begin
if IsWin64 then
Result := HKLM64
else
Result := HKLM32;
end;
///
/// Check is Microsoft Office is installed or not
///
function IsOfficeInstalled (): Boolean;
var
platform: string;
begin
RegQueryStringValue(GetHKLM(), RegOffice, RegOfficeKey, platform);
if platform = 'x86' then begin
SuppressibleMsgBox('Microsoft Office found (x86 version)' , mbConfirmation, MB_YESNO or MB_DEFBUTTON1, IDYES);
Result := True;
end else if platform = 'x64' then begin
SuppressibleMsgBox('Microsoft Office found (x64 version)', mbConfirmation, MB_YESNO or MB_DEFBUTTON1, IDYES);
Result := True;
end else begin
SuppressibleMsgBox('Microsoft Office NOT found' + platform + '.', mbConfirmation, MB_YESNO or MB_DEFBUTTON1, IDYES);
Result := False;
end;
end;