This should be simple, I need to stop any previous version of my program from running when the installer starts.
Most people suggested making an exe wh
In version 5.5.0 (Released on May 2012) Inno Setup added support for the Restart Manager API on Windows Vista and newer.
Quote from MSDN linked documentation (emphasis mine):
The primary reason software installation and updates require a system restart is that some of the files that are being updated are currently being used by a running application or service. Restart Manager enables all but the critical applications and services to be shut down and restarted. This frees the files that are in use and allows installation operations to complete. It can also eliminate or reduce the number of system restarts that are required to complete an installation or update.
The good thing is: you don't need to write custom code in the installer or your application to ask the user to close it, or close it automatically.
If you want your application to restart after the update is complete, you have to call the RegisterApplicationRestart function from your application first.
The default values for the new directives closes all the .exe, .dll and .chm files contained within the [Files] section of the installer.
The changes related to it are (from release notes):
- Added new
[Setup]section directive:CloseApplications, which defaults toyes. If set to yes and Setup is not running silently, Setup will now pause on the Preparing to Install wizard page if it detects applications using files that need to be updated by the[Files]or[InstallDelete]section, showing the applications and asking the user if Setup should automatically close the applications and restart them after the installation has completed. If set to yes and Setup is running silently, Setup will always close and restart such applications, unless told not to via the command line (see below).- Added new
[Setup]section directive:CloseApplicationsFilter, which defaults to*.exe,*.dll,*.chm. Controls which files Setup will check for being in use. Setting this to*.*can provide better checking at the expense of speed.- Added new
[Setup]section directive:RestartApplications, which defaults toyes. Note: for Setup to be able to restart an application after the installation has completed, the application needs to be using the WindowsRegisterApplicationRestartAPI function.- Added new command line parameters supported by Setup:
/NOCLOSEAPPLICATIONSand/NORESTARTAPPLICATIONS. These can be used to override the newCloseApplicationsandRestartApplicationsdirectives.- Added new
[Code]support function:RmSessionStarted.TWizardForm: Added newPreparingMemoproperty.