I have one .msi file and two prerequisites files. As per my code, the setup will execute main exe file from .msi file after successful installation. But if the previous version of .msi file is already installed, it coming with the option of Repair and Remove. My Run
section is running after I uninstalled .msi file and I want to quit the application after it removed msi file or it will not execute the Run
section. Can anyone please suggest me some solutions?
Here is my Run
section:
[Run]
Filename: "{app}\{#MyAppExeName}"; Parameters: "/verysilent /group=""{groupname}\Macrowire 2.5 Pro"" /mergetasks=""desktopicon,file_association"""; Flags: nowait postinstall; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; StatusMsg: "Installing Macrowire 2.5 Pro..."
Here is my Pascal code:
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode: integer;
begin
...
if IsComponentSelected('Macrowire') or IsComponentSelected('Full') then
begin
ShellExec('', ExpandConstant('{app}\MacroWire 2.5 Pro.msi'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
end;
...
end;
You probably want to abort the installation when the dependency fails to install:
If you want the installation to continue, but you just need to skip the
[Run]
entry, use theCheck
parameter:Btw, the
StatusMsg
parameter is not used withpostinstall
entries. And I'm still not sure if the installer-likeParameters
are relevant for this program.