I’ve never had this work. Instead, pass my own parameter.
First, you don’t need a declare. Use a Shell object to launch the update. Execute something like Path/To/Installer.exe /PARAMETER
to begin. You can have as many parameters as you like, including the supported built-in ones. So if RestartApplications worked, you’d include /RESTARTAPPLICATIONS
.
What I’ve done is use my own /NOLAUNCH
parameter. In my Inno script, my “launch app” checkbox is defined as
Filename: "{app}\{#MyAppExeName}"; Parameters: "/NOSETUPCHECK"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Check: not CmdLineParamExists('/NOLAUNCH'); Flags: nowait postinstall
It’s the Check: not CmdLineParamExists('/NOLAUNCH');
that is important. When launched from Windows Explorer, the parameter will not be there, so the checkbox will appear. When launched from the command line without the parameter, since I use the /SILENT
and /VERYSILENT
parameters, the app is launched automatically. When launched from the command line with the /NOLAUNCH
parameter, the install just ends.
I’ve used /NOSETUPCHECK
here as well, so that when my app launches my installer, it does NOT perform mutex checking. Without this, the installer would immediately terminate because my app were still running for another moment. This is another custom parameter and not needed if you’re not using mutex checking.
My full Inno script can be seen at Beacon/Setup.iss at master · thommcgrath/Beacon · GitHub
Also, if you don’t need the ability to control wether or not it starts your app when finished, then this is much simpler. The Run command in the script will launch your app automatically if run silently. I wanted the ability to not do this, as my normal updates happen silently as the user quits my app.