I created a setup installation package by Inno Setup. Recently, I developed a COM component for the program. But due to its DLL being locked, it must be updated the next time it starts up Windows. I used Flags: restartreplace. It works well.
However, two of my clients have given me feedback that they would like to no longer remind me to "restart my computer". They said they accidentally restarted the computer, causing data loss in their other software. I think so too. In fact, when installing a new version, the old version can still be used normally. Because restartreplace will only be replaced the next time the computer is started, it does not affect usage at all, so there is no need to restart the computer.
So, is there a way when using Flags: restartraplace, the installation package is working properly, and users cannot see any restart option. They can also directly display "Start Program" as usual after the installation is completed?
I do not think there's an easy solution for this. I have a similar setup. What I do:
If the same version of the problematic file is installed already, I do not try to install it again, preventing the conflict in the first place.
If it has to be replaced, but the replace is not critical, I programmatically reset the "Finished" page back to the standard layout (without restart).
The code is like this (this does not involve the
RunList, as for other reasons, I replace the standardRun/postinstallfeature with my custom one).Full code is here:
https://github.com/winscp/winscp/blob/master/deployment/winscpsetup.iss
Notable parts are in
ShouldInstallShellExtandCurPageChanged(CurPageID = wpFinished).Another option is to code the replacement yourself. To replicate what Inno Setup does (but without forcing restart):
ExtractTemporaryFilefunction to extract the file from the installer. Or just "install" the file to a temporary location (Inno Setup uses.tmpextension appended to the destination path).RestartReplacefunction.Roughly like this:
(not tested – might not even compile – and need a lot of error checking and logging)