Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

InstallScript MSI Project - Prevent setup.exe From Running Multiple Instances

Recently produced a new setup.exe under DISK1 folder. Had that folder zipped and deployed for our QA to test. One of our test case requires the tester to click on the EXE two times. We found that the EXE can actually launch two instances. What we actually want is to allow only one instance to run at a time.

Is there a away to achieve this in InstallShield? What is the recommended approach to this? By the way, my project type is InstallScript MSI.

Any Help?


Labels (1)
0 Kudos
(2) Replies

Hi @enghocktan ,

 In InstallScriptMSI project, you can create Kernel32.CreateMutex object and check the state of it in the Installscript OnBegin function to prevent the multiple instance. Based on the state of the Mutex object, you can abort the new instance by calling the abort function.

0 Kudos

But I have a situation here. I have two prerequisites: (1) does system check, (2) install Oracle VirtualBox. If I use the Kernel32.CreateMutex in the onBegin function, that will be too late since installscript run after the prerequisites. I like to be able to stop before the prerequisites. I thought of putting the Mutex thingy in and as part of our System Check prerequisite. But, there is this cache behavior which will make second installer run instance to bypass the prerequisite. What I meant by that is -- let say the first instance run complete 1st prerequisite and start the 2nd one. let say at this time, another installer start running. This new run instance will bypass the System Check prerequisite since it thinks it has done that process.  So putting mutex there will not be effective either.

0 Kudos