Archive: ExecWait doesn't work


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


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


Sounds like you're trying to execute an InstallShield installer?

http://forums.winamp.com/showthread....+installshield

-Stu


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


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


Did you read my post?
Try executing the setup with the /sms switch.

-Stu


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


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


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


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


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


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


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


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


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