At the very beginning of the script I have these lines of code:
#define ISSI_Splash "C:\InnoSetupProject\Images\client.bmp"
#define ISSI_Splash_T 3
#define ISSI_Splash_X 500
#define ISSI_Splash_Y 220
In my [Setup]
section I add the directive:
AppMutex=ABClientLaunchMutex
Then in the [Code]
section I create the mutex:
[Code]
function ISSI_InitializeSetup : Boolean;
begin
Result := True;
CreateMutex('ABClientLaunchMutex');
end;
#define ISSI_InitializeSetup
and those 2 lines of code are at the end of the script:
#define ISSI_IncludePath "C:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
But this does not work as one would expect. Whenever I launch the installer it immediately shows me the mutex's message that my apllication is already running, but this is not true. I haven't created my mutex in the Global namespace, so I don't need to use the Global\
prefix.
If I comment those 4 #define
directives at the beginning then the mutex won't work at all.
Could you please tell me what is wrong with my code so it works like that?
I think your mistake is that you are creating the mutex within the setup script itself when your application should be doing this.
I have
AppMutex
only once in my script:As the documentation states:
The documentation provides example. Here is how I do it with a Visual C++ MFC project: