Apologies in advance if this is not the correct place to post.
I use the following Inno code to install my software.
I would like to check if Office is installed and if it is installed to check the Bitness. Based on the Bitness I would like to install either the 32-bit Runtime or the 64-bit Runtime.
Do you know how to check for the presence of Office, which Office and its Bitness?
I use the following Inno code to install my software.
I would like to check if Office is installed and if it is installed to check the Bitness. Based on the Bitness I would like to install either the 32-bit Runtime or the 64-bit Runtime.
Do you know how to check for the presence of Office, which Office and its Bitness?
Code:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Visual Dentist"
#define MyAppVersion "20.0"
#define MyAppPublisher "Kosmos Business Systems Ltd"
#define MyAppURL "https://www.VisualDentist.com"
#define MyAppExeName "vd5Init.accde"
#define MyAppIcoName "logo.ico"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{A2E41031-5E7B-4069-833F-581EED5AD9CD}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName= "C:\VisualDentist"
UsePreviousAppDir=yes
DisableDirPage=no
DefaultGroupName=VisualDentist {#MyAppVersion}
DisableProgramGroupPage=yes
OutputBaseFilename=VisualDentistSetup
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
;LicenseFile=C:\Inno\setup\VisualDentistLicense.txt
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Inno\Setup64\vd5Init.accde"; DestDir: "{app}"; Flags: ignoreversion replacesameversion
;Source: "C:\Inno\Setup64\VD32.accde"; DestDir: "{app}"; Flags: ignoreversion replacesameversion
Source: "C:\Inno\Setup64\VD64.accde"; DestDir: "{app}"; Flags: ignoreversion replacesameversion
Source: "C:\Inno\Setup64\vd5_be.accdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Inno\Setup64\A365Runtime64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Inno\Setup64\logo.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Inno\Setup64\VD-Serial.txt"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{autodesktop}\VisualDentist"; Filename: "{app}\vd5Init.accde"; Parameters: "/runtime"; IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
CurVer: string;
key: string;
ResultCode: Integer;
begin
if RegQueryStringValue(HKEY_CLASSES_ROOT, '\Access.Application\CurVer','', CurVer) and ( CurVer = 'Access.Application.15' ) then begin
// Successfully read the value
// MsgBox('Access Version: ' + CurVer ,mbInformation, MB_OK);
end else begin
ExtractTemporaryFile('A365Runtime64.exe');
if Exec(ExpandConstant('{tmp}\A365Runtime64.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then begin
//msgbox('AccessRuntime already installed or completed installing successfully.', mbInformation, MB_OK);
end else begin
msgbox('AccessRuntime installer failed please contact support.' + SysErrorMessage(ResultCode), mbInformation, MB_OK );
end;
end;
end;
[Run]
Filename: "{app}\vd5Init.accde"; Description: "Open Visual Dentist"; Flags: postinstall shellexec skipifsilent ; Parameters: "/runtime"