How to avoid restarting silent Inno Setup installer without /norestart

74 Views Asked by At
  1. I have a downloader installer whose function is to download my Inno Setup packaged exe and execute xxxx.exe /verysilent for silent installation
  2. It has been released for two years and everything is working normally
  3. 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
  4. 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?

1

There are 1 best solutions below

1
Martin Prikryl On BEST ANSWER

I do not think there's an easy solution.

Imo, you have these options (in the order I'd recommend):

  1. Implement the replace-on-restart programmatically, using RestartReplace function, as shown in my answer to your previous question:
    How to use flag:restartreplace but without restarting

  2. Wrap the installer to yet another application (can be again Inno Setup installer), that adds the /norestart command-line parameter.

  3. 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.