- I have a downloader installer whose function is to download my Inno Setup packaged exe and execute
xxxx.exe /verysilentfor silent installation - It has been released for two years and everything is working normally
- Recently, I upgraded the software package and introduced COM components in my program, which may cause system usage issues. So I added
Flags: restartreplace, and the software will be replaced and upgraded after the next computer restart - But! I encountered a big problem. The download installer I previously sent to the user is now unable to modify the code. It may appear during the installation and upgrade process, causing the computer to suddenly restart without any prompts!
I found a startup parameter in Inno Setup documentation
/norestart, which can install silently without performing a forced restart.
But! My downloader installer has been released to many users and cannot be updated, so it cannot add new /norestart parameters to launched Inno Setup package.
Is there a solution where I can add some code to the iss script so that if it is silently started, it will automatically add /norestart?
I do not think there's an easy solution.
Imo, you have these options (in the order I'd recommend):
Implement the replace-on-restart programmatically, using
RestartReplacefunction, as shown in my answer to your previous question:How to use flag:restartreplace but without restarting
Wrap the installer to yet another application (can be again Inno Setup installer), that adds the
/norestartcommand-line parameter.Restart the installer with
/norestart, when it is started with/silent. For an example how to restart installer with different command-line parameters, see for example:Discard the /TYPE and /COMPONENTS parameter on upgrade
This is basically another way to implement the 2. More code, but without need for yet another binary.