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
which does this and calling it before Inno Setup starts. I created an exe
using AutoIt which kills all processes of my program. The problem is I don't know how to get Inno Setup to call it before it installs anything.
How do I call an executable before installing files?
Alternatively, if I can just detect if a program is running and tell the user to close it, that would work too.
Best Answer
If the application has a Mutex, you can add an
AppMutex
value in your Inno Setup installer and it will display a message telling the user to stop the program. You might be able to find the Mutex (if it's got one) by using SysInternals Process Explorer and selecting the program / process and looking at the Handles (CTRL-H) in the Lower Pane.Here's a link to the a KB article that mentions several methods:
http://www.vincenzo.net/isxkb/index.php?title=Detect_if_an_application_is_running
Alternatively, you might try this (UNTESTED) code in the
InitializeSetup
: