cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Jithin
Level 3

Multiple Instance of Setup.exe

Hi,

After building the release, I tried to install my product by running Setup.exe. During the execution of the setup.exe, I once again tried to run the same. Now I found that the Setup.exe gets executed for the second time even if another instance of the same setup is working.

Actually my idea was that if one instance of setup.exe is running, it wont allow another instance of setup.exe to run before the completion of the first one.

Do I need to do something to include this feature? I don't require a multiple instance of the same setup...What should I do?
I am using Install Script MSI project.

Thanks in advance...
Labels (1)
0 Kudos
(5) Replies
William_Wallace
Level 3

Hi.... I have the same problem. I dont want to allow more than one setup running simultaneously.

Did you find any solution for this?

Anybody knows a solution?
0 Kudos
William_Wallace
Level 3

hi..... nobody knows? any work around?
0 Kudos
KathyMorey
Level 10

As far as I know, there is nothing in-built to prevent a setup.exe from starting while another is running. However, with an InstallScript MSI project, Windows Installer will stop two MSI execute sequences from running at the same time.
0 Kudos
William_Wallace
Level 3

Hi Kathy... thanks for your response.... yep. I think that is true.

Our requirement is that we do not want to allow to run the setup again at the start of the installation. As long as one setup is still running, all attempts to run the same setup.exe will be aborted.

Anyway, I managed to make it work using the function FindWindow. I know, this is not the best solution, but good enough for our requirement.
0 Kudos
ChandanOmkar
Level 8

Use the following code, this is working for me :
strMutex = "MY_SETUPMUTEX" ;
hMutex = Kernel32.CreateMutex(NULL, TRUE, strMutex);
nError = Err.LastDllError();
if (hMutex != 0 && nError == 183) then
MessageBox("Another Instance of this setup is already running", WARNING);
ReleaseMutex(hMutex);
abort;
endif;


use Kernel32.dll
0 Kudos