- NSIS Discussion
- ExecWait doesn't work
Archive: ExecWait doesn't work
stefano7625
13th July 2005 18:11 UTC
ExecWait doesn't work
Hi People!
I have a problem with more instance of ExecWait.
I have tried to execute this code:
-------------------------------------
!define APP_NAME "Pippo"
Name "${APP_NAME} Test"
OutFile "${APP_NAME}.exe"
InstallDir $PROGRAMFILES\${APP_NAME}
!include "MUI.nsh"
!insertmacro MUI_LANGUAGE "English"
Section "Dummy Section " SecDummy
SetOutPath "$EXEDIR\Pluto"
File Prova.bat
ExecWait '"mysql\setup.exe"'
SetOutPath "$EXEDIR"
ExecWait '"Prova.bat"'
MessageBox MB_OK "Error"
SectionEnd
-------------------------------------
The problem is this:
The second execution of ExecWait starts before that first execution of ExecWait ends.
I'd be very pleased if somebody could help me!
Best regards,
-- Stefano
DennisFeiock
13th July 2005 21:41 UTC
I have seen this before myself. Most of the NSIS installers I make are just wrappers for other installs...
What that setup.exe probably does is extract itself out somewhere to an msi, some ini files, instmsia.exe, and instmsiw.exe.
So as soon as the setup.exe has completed extracting those out, it runs the msi for the install your trying to run and closes the setup.exe.
So NSIS sees that setup.exe has ended, and goes on to the next step.
What you need to do is hunt around for any files that the setup.exe extracts, and call your ExecWait on those. You might have to figure out what switches are needed. (/qn, /qr, any transforms and such for msi's)
Hope this helps you
- DF
Afrow UK
13th July 2005 23:19 UTC
Sounds like you're trying to execute an InstallShield installer?
http://forums.winamp.com/showthread....+installshield
-Stu
stefano7625
14th July 2005 08:00 UTC
Thanks for your responses.
I have tried to do this instruction
C:\Test\setup.exe /r /f"C:\Test\Setup.iss"
that install program and produce Setup.iss file:
[InstallShield Silent]
Version=v4.90.000
File=Response File
[DlgOrder]
Dlg0=SdWelcome-0
Count=5
Dlg1=SdShowInfoList-0
Dlg2=SdAskDestPath-0
Dlg3=SetupType-0
Dlg4=SdFinish-0
[SdWelcome-0]
Result=1
[SdShowInfoList-0]
Result=1
[SdAskDestPath-0]
szDir=C:\mysql
Result=1
[SetupType-0]
Result=301
szDir=
[Application]
Name=MySQL Servers and Clients 5.0.0a-alpha
Version=MySQL Servers and Clients 5.0.0a-alpha
Company=MySQL AB
[SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
When I try to execute silent installation in this way
C:\Test\setup.exe /s
it doesn't work. It produce a file Setup.log that contains:
[InstallShield Silent]
Version=v4.90.000
File=Log File
[ResponseResult]
ResultCode=-3
ResultCode=-3 means
"Required data not found in the Setup.iss file"
Anyone knows where I mistake?
-- Stefano
DennisFeiock
14th July 2005 13:10 UTC
When you run the install like so:
setup.exe -r
It will create an answer file called setup.iss in your Windows directory.
You will need to copy the iss file out of there, and package it with your NSIS installer.
Then, you will need to do something like this:
ExecWait '"$INSTDIR\setup.exe" -s -f1 "$INSTDIR\setup.iss"'
- DF
Afrow UK
14th July 2005 17:31 UTC
Did you read my post?
Try executing the setup with the /sms switch.
-Stu
stefano7625
15th July 2005 07:49 UTC
I have tried both solutions but they didn't work.
1. ExecWait '"$INSTDIR\setup.exe" -s -f1 "$INSTDIR\setup.iss"'
Are you sure that is $INSTDIR and not $EXEDIR?
2. setup /sms (from command line)
It launch install program but doesn't wait.
-- Stefano
Afrow UK
15th July 2005 08:06 UTC
1. It depends where the installer is. If it's in the same folder as the current installer or in a subfolder, then you should use $EXEDIR.
So this
ExecWait '"mysql\setup.exe"'
should really be
ExecWait '"$EXEDIR\mysql\setup.exe"'
just to be safe.
You could also check this out:
http://forums.winamp.com/showthread....hreadid=221310
He used "start /WAIT" (in command-prompt) which you could try using with nsExec::Exec.
-Stu
stefano7625
15th July 2005 08:40 UTC
Here's the command that I tried:
C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe /S "_?=C:\mysql"
It produce setup.log with this contents:
[InstallShield Silent]
Version=v4.90.000
File=Log File
[ResponseResult]
ResultCode=-3
-- Stefano
Afrow UK
15th July 2005 09:03 UTC
You don't want to use "_?=C:\mysql" as that is for NSIS uninstallers only. /S will make the InstallShield installer run silently, so obviously if you do not want it to run in silent, don't use /S.
-Stu
stefano7625
15th July 2005 09:38 UTC
I tried with:
1. C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe
2. C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe "_?=C:\mysql"
3. C:\Test\mysql>start /WAIT setup.exe
It doesn't work.
If I want to run silently installation, is this
C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe /S
the correct command? Why it doesn't work?
-- Stefano
Afrow UK
15th July 2005 10:16 UTC
I just found this page:
http://documentation.installshield.c...EXECmdLine.htm
Try "/s /w" (with ExecWait too if you like).
If you use start, multiple parameters must be surrounded by quotes.
-Stu
DennisFeiock
15th July 2005 13:11 UTC
The error log that it is creating is because you arent specifing the answer file for the silent install. Or that would be my best guess at least...
What does this do for you?
C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe -s -f1 "C:\Test\setup.iss"
Also, according to the documentation that Afrow UK linked to:
"For an InstallScript MSI project, the command Setup.exe /s runs the installation in silent mode, by default based on the responses contained in a response file called Setup.iss in the same directory (response files are created by running Setup.exe with the /r option)."
The -f1 argument just lets you specify a different location for the ISS file.
- DF
stefano7625
15th July 2005 13:40 UTC
I have tried to execute command with "/s /w" but it doesn't work.
Furthermore, this command:
C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe -s -f1 "C:\Test\setup.iss"
produce setup.log that has the same content already specified.
-- Stefano
Afrow UK
15th July 2005 17:40 UTC
START /? will tell you that [parameters] are one parameter for START seperated by quotes.
And so,
C:\Test\mysql>start /WAIT /D"C:\Test" setup.exe "-s -f1 C:\Test\setup.iss"
-Stu