I have an application installer created with Inno Setup that deploys multiple binaries and support files for my application.
When I perform an upgrade installation (e.g. run setup-1.5.exe while version 1.0 is already installed), some of the files from the previous version are frequently in-use, and cannot be replaced until the next reboot. That is fine, Inno handles that case correctly.
However, the logic I really want is: if any files cannot be replaced until the next reboot, then I want all files to be replaced on the next reboot. Otherwise, binaries that are in use are not replaced but some support files might be, leaving the application in an unstable state prior to reboot anyway.
Is there a clean way to accomplish this? I have not been able to find one, short of locking all the support files myself explicitly, which is quite ugly.
Thanks!
Inno can’t do this natively. This is why it provide
AppMutexand friends to ensure that it’s all clear, and if anything is left, it tells the user that they must reboot.You can then expand on this in your app and refuse to start if a restart replace action is pending.