cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MichaelHu
Level 5

Detect if setup.exe is already running

Dear all!

I'm trying to prevent the user from running setup.exe twice.

I do a lot of hardware checks at the beginning of the installation. These checks are all logged into one single log-file. Now if the user starts setup.exe again the log-file gets messed up by the two running instances...

Is there an easy way to prevent setup.exe from running twice?

Thank you in advance for your help!
Michael
Labels (1)
0 Kudos
(3) Replies
MichaelHu
Level 5

Any help?


Thanks in advance!!
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

How do you access this log file - if it's through a single section of InstallScript or C++, etc., code (as opposed to several custom actions), could you just open the log file (or a helper lock file) exclusively, and fail when the second process cannot open it due to a sharing violation?
0 Kudos
packagechief
Level 5

MichaelHu wrote:
Dear all!

I'm trying to prevent the user from running setup.exe twice.

I do a lot of hardware checks at the beginning of the installation. These checks are all logged into one single log-file. Now if the user starts setup.exe again the log-file gets messed up by the two running instances...

Is there an easy way to prevent setup.exe from running twice?

Thank you in advance for your help!
Michael


only for my understanding: you call an MSI Package within an setup.exe right?

Well if you call a setup.exe (which is normally the wrapper to a original MSI File) you can check for the Windows Installer Error Code 1500, which means that the Installer can't run two setups at the same time.. the error will be produced if the Windows Installer on the target machine tries to
(or the user manually of course) run setup.exe 2 times in the same sequence..

and then (maybe with an "if.... statement") you can lock the log file and print out an error message and the log shoudn't be messed by the second setup.exe Wrapper Instance
0 Kudos