Old 20th April 2010, 14:24   #1
dandan78
Junior Member
 
Join Date: Apr 2010
Posts: 4
execwait doesn't with .msi/.exe combo

code:

; 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?
dandan78 is offline   Reply With Quote
Old 20th April 2010, 14:52   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
This sounds a lot like some problems I've seen mentioned in here before. Have you tried searching the forums?
MSG is offline   Reply With Quote
Old 20th April 2010, 15:15   #3
dandan78
Junior Member
 
Join Date: Apr 2010
Posts: 4
Yes, but unforutnately I didn't find anything, which is not to say that I have given up searching.
dandan78 is offline   Reply With Quote
Old 20th April 2010, 15:50   #4
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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.
Animaether is offline   Reply With Quote
Old 20th April 2010, 16:09   #5
dandan78
Junior Member
 
Join Date: Apr 2010
Posts: 4
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.
dandan78 is offline   Reply With Quote
Old 20th April 2010, 17:51   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 21st April 2010, 09:43   #7
dandan78
Junior Member
 
Join Date: Apr 2010
Posts: 4
[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.
dandan78 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
execwait, msi installer

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump