Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to determine if another MSI installer runs


1 reply to this topic

dorelsturm

dorelsturm
  • Full Members
  • 23 posts

Posted 26 May 2006 - 12:25

Hi,

As I know you cannot launch an MSI installer while another MSI installer is running, you will get all the time error 1500.

I have a batch file that installs my MSI installer which is distributed using some deployment tools. It contains something like this as the last line:

msiexec.exe /I "myMSI.msi"

The problem is that while I distribute my MSI installer+the batch file and launch it (to install my application), on the target computer another MSI installer may run (the user may just be in a middle of installing something).
To fix this problem I can add at the beginnig of the batch file some tests to see if MSI is running:

msiexec.exe /I "testDummyMSI.msi"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
REM no MSI is running let's uninstall our dummy and proceed with our installer
msiexec.exe /x {GUID of my dummy}
msiexec.exe /I "myMSI.msi"

To test here if another MSI installer is running I just try to install a dummy MSI, if fails I assume that another MSI installer is running.

My question is: what can I use to see if another MSI installer is running? Using msiexec.exe /? does not help because error 1500 happens only when second MSI installer starts really to do the job (e.g. is not in the UI part).
Are there some Windows API calls for this?

In my batch file I cannot simply start to install the "myMSI.msi" installer and check for errors because the batch file is started on that target computer by a service which is upgraded by "myMSI.msi", so I need to know if I can "upgrade myself" before I start "myMSI.msi"

Thanks for your help.



Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 26 May 2006 - 16:18

I read (a long time ago) that the InstallExecuteSequence sets a semaphore. You could try to write a program that tries to obtain the semaphore, if it fails then an install is being executed.
I forgot the name of the semaphore, try hitting the search engines.