Checking application prerequisites
From ISXKB
Checking for external prerequisites
Where your application requires some other component (not included in the setup) to already be installed before installation can proceed, you can do the checking in the InitializeSetup event function:
function IsMyPrerequisiteInstalled(): Boolean;
begin
Result := {whatever code you need to check whether it's installed or not};
end;
function InitializeSetup(): Boolean;
begin
Result := True;
if not IsMyPrerequisiteInstalled() then begin
MsgBox('MyPrerequisite is not installed. Installation cannot continue.', mbError, MB_OK);
Result := False;
Exit;
end;
end;
Checking for your own application
For partial upgrades or addons (where the main body of your application is not included in the setup), you can use the same pattern as above to check for existence of your own application. Usually the simplest way to do that is to look for its Uninstall entry (as shown in Upgrades; for extra paranoia you could also read out the installation folder and check whether the actual .exe file is there (and what version it is).
Note: when building addon installers, you need to carefully consider what you want the uninstall behaviour to be, which will influence how you choose the AppId for the addon.
