Archive: How to make installer wait between two operations/exe executions


How to make installer wait between two operations/exe executions
Currently I'm into an issue http://forums.winamp.com/showthread....readid=263995.

But I'm posting this post as a new to attract wider members from our NSIS forum. Can anyone tell me how to run the following two nsExec::Exec commands one by one. The 2nd command should be executed only after the 1st command has been completed completely.

!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "ExecuteFinishPage"

Function ExecuteFinishPage
; MSDE 2000 setup gets executed
nsExec::Exec "$INSTDIR\setup.exe"
; after the msde installation
; I want to start the SqL Service Manager by:
nsExec::Exec "NET START MSSQLSERVER"
OR
nsExec::Exec "scm.exe -Action 1 -Service MSSQLSERVER -silent 2"
FunctionEnd

Please note that there is no error in both the nsExec commands, both runs perfectly. The problem is that the installer after executing the 1st command does not waits to get the MSDE setup gets its installation completed, it goes on to execute the next available command. I've supplied even a simple MessageBox command, and it gets executed soon after invoking the MSDE setup. And due to this, my 2nd command is unable to start the SQL Service Manager as at that time MSDE installation is yet to be completed.

I cannot use the 'SLEEP' command in between, as I don't know how long the MSDE setup will take to finish. And yes, I don't want to issue a 'REBOOT', and wants instantly to start the MSSQLSERVER Service after the MSDE setup. I'm running the msde setup(setup.exe) on default mode, this is good as the user can see the interface of msde installation.


Sorry guys for taxing your patience with my long discussion.

With regards,


I've an idea:

nsExec::Exec "$INSTDIR\setup.exe /wait"

let me try this, and will get back to this thread.


Perhaps the 1st setup is a wrapper which starts another setup, in this case you need to know if this wrapper supports switches, and the syntax for these switches.
It might be better if you use ExecWait and capture the returned ErrorLevel.
As for NsExec better use it with ExecToStack, see the documentation,
http://nsis.sourceforge.net/Docs/nsExec/nsExec.txt


Unattended has a page with a detailed list of all common installer switches. Use it to find out how to tell the MSDE installer to return only once it's done. For example, in some InstallShield installer, you must pass /SMS for that and For NSIS unisntallers, you must use _?=$INSTDIR. Also search the forum as this has been asked a few times before. Someone might have also posted the relevant switch from that page.

http://unattended.sourceforge.net/installers.php


Originally posted by Swapan Das
I've an idea:

nsExec::Exec "$INSTDIR\setup.exe /wait"

let me try this, and will get back to this thread.
The MSDE setup does not need to be told to wait, it needs a parameter for the sa administrator password: "setup.exe sapwd=<YourNewSaAdministratorPassword> /qn". The /qn switch will make it run silently.

Check the information on MSDN: http://download.microsoft.com/downlo...arameters_wluf

Thanks to all of you for the valuable suggestions.
I'm leaving town on an official tour for around 10 days.
So will be able to resolve my this issue after my return.
Will get back to this thread after 2 weeks.


Hi
Iam also facing the same problem.I would love to know how did you solved the problem
"How to make installer wait between two operations/exe executions"