[registry] Detect whether Office is 32bit or 64bit via the registry

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';

/// <summary>
/// Get current HKLM version
/// </summary>
function GetHKLM: Integer;
begin
  if IsWin64 then
    Result := HKLM64
  else
    Result := HKLM32;
end;

/// <summary>
/// Check is Microsoft Office is installed or not
/// </summary>
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;

Examples related to registry

IE Enable/Disable Proxy Settings via Registry How to read value of a registry key c# How to add Python to Windows registry How can I enable Assembly binding logging? Assign command output to variable in batch file Registry key for global proxy settings for Internet Explorer 10 on Windows 8 Run reg command in cmd (bat file)? Command line to remove an environment variable from the OS level configuration How to export/import PuTTy sessions list? Check if registry key exists using VBScript

Examples related to ms-office

How to read data from excel file using c# Excel 2007: How to display mm:ss format not as a DateTime (e.g. 73:07)? What do <o:p> elements do anyway? Access Database opens as read only Microsoft.Office.Core Reference Missing What is a correct MIME type for .docx, .pptx, etc.? VBA: How to display an error message just like the standard error message which has a "Debug" button? How to detect installed version of MS-Office? How can I programmatically freeze the top row of an Excel worksheet in Excel 2007 VBA? Where does VBA Debug.Print log to?

Examples related to 32bit-64bit

MS Access DB Engine (32-bit) with Office 64-bit Running vbscript from batch file Can't start Eclipse - Java was started but returned exit code=13 how much memory can be accessed by a 32 bit machine? CentOS 64 bit bad ELF interpreter Range of values in C Int and Long 32 - 64 bits Is it possible to install both 32bit and 64bit Java on Windows 7? How to find out if an installed Eclipse is 32 or 64 bit version? Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu Should I use Python 32bit or Python 64bit

Examples related to office-2010

Detect whether Office is 32bit or 64bit via the registry