Archive: execwait doesn't with .msi/.exe combo


execwait doesn't with .msi/.exe combo


; Install App
ExecWait "$INSTDIR\setup.exe"
; Install Sql Server Express Edition 2005
ExecWait "$INSTDIR\install_sql_server.cmd"
; Setup and restore database
ExecWait "$INSTDIR\import_db.cmd"
; setup database user
ExecWait "$INSTDIR\adduser.cmd"
; Create ODBC DSN


Hi, setup.exe is part of a .msi/.exe combination created by a Visual Studio setup project.

If you run the .msi, it works fine UNLESS the prerequisites are missing. Hence it's better to go with the .exe. The .exe checks for the prerequisites, in this case version 3.5SP1 of the .NET Framework and Crystal Reports Basic, and downloads and installs them if needed.

One would expect that running setup.exe with ExecWait would do the checks, get and install anything that's missing, and then install the application (.msi). However, what happens is that the .msi part of the package and the following ExecWait which installs SQL Sever 2005 Express launch at the same time.

Does anybody know a way to prevent that from happening?

This sounds a lot like some problems I've seen mentioned in here before. Have you tried searching the forums?


Yes, but unforutnately I didn't find anything, which is not to say that I have given up searching.


This might be a thread on it...
http://forums.winamp.com/showthread.php?t=254184

The explanation is at least likely.. the installer probably launches another process itself, then exits - so your ExecWait waits just fine.. but the thing it's waiting for exits rapidly :)

If the potential solution in that thread doesn't help (and I'm guessing it wouldn't.. start /wait probably suffers from the same issue), you'll have to check how you can stop the initial installer from exiting immediately.

Alternatively - but only if you're desperate, look for the actual installing process and halt execution of your code until that process is gone.


Yes, that it exactly what it does. Setup.exe eventually launches msiexec and exits. As you said, start /wait doesn't help. :(

For the last hour and a half I've been trying to dig up a way to prevent setup from exiting immediately but so far without luck. InstallShield would be doable, but this isn't InstallShield. Oh well...

I'm getting to the point where no other option remaisn other than doing some low-level Win API stuff, possible wrapping the whole thing in an extra application to make it easier.

Thanks, all.


http://unattended.sourceforge.net/installers.php if you can identify the installer, or if all else fails: http://nsis.sourceforge.net/ExecWait...th_Job_Objects


[Solved] execwait doesn't with .msi/.exe combo
@Anders

Oddly, the Visual Studio setup.exe + .msi combination is not listed on the web page you gave me. The InstallShield variant is, tho, but the solution is not applicable.

So all else did fail, but lucky for me the macro works like a charm. :)

Thanks again.