Archive: Why ExecWait wont wait while installation is in progress


Why ExecWait wont wait while installation is in progress
Hi,

I am trying to setup an NSIS script to install 2 third party and 1 application.

- JDK
- Mysql
- My java app


NSIS script:

SetOutPath $INSTDIR\installer
File /r deploy\installer\*
nsExec::ExecToStack '"$INSTDIR\installer\java\jdk-1_5_0_06-windows-i586-p.exe" /s'
; ExecWait - does this wait for mysql.exe to finish the installation? Coz it doesnt wait, it will proceed to install myjarfile.jar.
ExecWait $INSTDIR\installer\mysql.exe

SetOutPath $INSTDIR
SetOverwrite on
File deploy\myjarfile.jar


Please advise. Im still new and I've look into the forum and cant find what I want...all is pointing to ExecWait example, am i missing something?


Thanks,


Hi mutantbc,

I guess the problem is with your execwait statment
it should look like
ExecWait '"$INSTDIR\installer\mysql.exe"'

Please try this with all the other installers.
wish you a luck.


The executed installer probably extracts another installer and executes it without waiting for it. You can use Unattended resources to find out how to make it wait for the other installer. For example, InstallShield waits if you pass /SMS on the command line.


Hi kichik,

Thank you for providing the Unattended resources, but I dont know which system used to create the installer. Is there any other way?


That site has information about identifying the system used to create the installer. It's usually enough to look under the Version tab in the properties dialog of the executable.


I have the same question so I must post here.
I use ziptoexe to pack these file zip and install it in my folder which I choose. I use command "execwait".Execwait still work but it is just extract my test_game.exe and not execute file it to set up.
My code here:
Section "TEST_GAME"
SetOutPath $PLUGINSDIR
File "c:\test_game.exe"
Execwait '"test_game.exe"'
Delete '"test_game.exe"'
MessageBox MB_OK "Test_Game is installed"
SectionEnd


Hi Kichik,

Thank you for the information, but unfortunately I've check the jdk installer which is an installshield package and I try to used /s and /sms. It said that it will pause until the installation completes but it didnt.

Am i lacking something?

DetailPrint "Launching Java setup" ;I tried to print this message to ensure that java installer is called but it didnt install on my system, why?
nsExec::ExecToStack '"$INSTDIR\installer\java\jdk-1_5_0_06-windows-i586-p.exe" /s /sms /v\"/qn ADDLOCAL=ALL IEXPLORER=1'
DetailPrint "Java Setup finished"

Please advise.

Danke


jdk-1_5_0_06-windows-i586-p.exe is an MSI wrapper which means that when executed it will extract an MSI file in your %TEMP% folder which you can retrieve and use instead of the above EXE.

Assuming that you include this MSI file in your installation, extract it and launch it directly using

SetOutPath $PLUGINSDIR
File "jdk.msi"
ExecWait '$SYSDIR\msiexec.exe /qb-! /i "$PLUGINSDIR\jdk.msi" ADDLOCAL=ALL IEXPLORER=1'
If you don't want to have any windows popping up use
ExecWait '$SYSDIR\msiexec.exe /qn /i "$PLUGINSDIR\jdk.msi" ADDLOCAL=ALL IEXPLORER=1'


You may have to add REBOOT=ReallySupress in case it tries to reboot your system
Hope this helps

CF

I've check the jdk and it says InstallShield Software Corp on the version tab.

when I tried to install the jdk, it wont extract the msi to the temp.


when I tried to install the jdk, it wont extract the msi to the temp
Sure it does. It will first extract the MSI and then execute it.

I posted my reply after downloading jdk-1_5_0_06-windows-i586-p.exe and running it. It extracts an MSI file in my %TEMP% folder, which I copied over to a new location, renamed as jdk.msi and run it by hand.
CF

Hi CancerFace,

I was able to extract the MSI, but i tries to look for COPYRIGHT file located at c:\progra~1\java\...

On my previous post, I was able to make it work but not in silent installation. Even though I specified the /s for silent mode but /sms work for waiting the installation to complete.

ExecWait '"$INSTDIR\installer\java\jdk-1_5_0_06-windows-i586-p.exe" /s /sms'


Hi CancerFace,

Thank you for the input, but the msi(jdk) didnt launch. Here's the script i used:

ExecWait '$SYSDIR\msiexec.exe /qn /i "$INSTDIR\jdk-1_5_0_06-windows-i586-p.msi" ADDLOCAL=ALL IEXPLORER=1'


I've used below syntax to extract the jdk msi:

jdk-1_5_0_06-windows-i586-p.exe -a -r -f1c:\jdk-1_5_0_06-windows-i586-p.iss

but the *.iss is no where to be found on drive c:\ but different java msi filename is extracted at c:\


I think you have confused the use of InstallShield. The command that you issued

jdk-1_5_0_06-windows-i586-p.exe -a -r -f1c:\jdk-1_5_0_06-windows-i586-p.iss
starts an administrative installation and records your answers to an ISS file, however this is used only in InstallScript driven products. JDK comes as an MSI, wrapped in an EXE that starts it up and no InstallScript engine is required. Upon execution of the EXE an MSI file is extracted in your temporery folder and then msiexec.exe is called and executes the extracted MSI.

What you should do is run the jdk-1_5_0_06-windows-i586-p.exe file, and after it extracts the MSI, without stopping the installation, copy the extracted file to a new location. Rename the extracted MSI file as you like and call it from your installer using
ExecWait '$SYSDIR\msiexec.exe /qn /i "<your_folder_with_the_jdk>\jdk.msi" ADDLOCAL=ALL IEXPLORER=1'


You may want to check out the command line parameters of InstallShield products. You may also look at the JRE silent install instructions to get an idea of what you're after in case you do not want to extract the MSI.

CF

PS In your code you are calling an MSI file called jdk-1_5_0_06-windows-i586-p.msi from $INSTDIR and you claim that it does not work. Thinks to check:
1. Did you extract a file called jdk-1_5_0_06-windows-i586-p.msi to $INSTDIR?
2. If yes, did the file actually make it into that folder?
3. Is it called jdk-1_5_0_06-windows-i586-p.msi?

If it's Java, a simple Google search will give you the best explanation there is. An explanation from Java:

http://java.sun.com/j2se/1.5.0/docs/...de/silent.html

sunlight112, ExecWait waits in your case, so your question is not related. But the answer is that you've not specified a full path to test_game.exe, so it can't find it. Use ExecWait $PLUGINSDIR\test_game.exe.


Hi CancerFace,

Thank you for the information provided, i will try it again.

Originally posted by CancerFace
I think you have confused the use of InstallShield. The command that you issued
jdk-1_5_0_06-windows-i586-p.exe -a -r -f1c:\jdk-1_5_0_06-windows-i586-p.iss
starts an administrative installation and records your answers to an ISS file, however this is used only in InstallScript driven products. JDK comes as an MSI, wrapped in an EXE that starts it up and no InstallScript engine is required. Upon execution of the EXE an MSI file is extracted in your temporery folder and then msiexec.exe is called and executes the extracted MSI.

What you should do is run the jdk-1_5_0_06-windows-i586-p.exe file, and after it extracts the MSI, without stopping the installation, copy the extracted file to a new location. Rename the extracted MSI file as you like and call it from your installer using
ExecWait '$SYSDIR\msiexec.exe /qn /i "<your_folder_with_the_jdk>\jdk.msi" ADDLOCAL=ALL IEXPLORER=1'


You may want to check out the command line parameters of InstallShield products. You may also look at the JRE silent install instructions to get an idea of what you're after in case you do not want to extract the MSI.

CF

PS In your code you are calling an MSI file called jdk-1_5_0_06-windows-i586-p.msi from $INSTDIR and you claim that it does not work. Thinks to check:
1. Did you extract a file called jdk-1_5_0_06-windows-i586-p.msi to $INSTDIR?
2. If yes, did the file actually make it into that folder?
3. Is it called jdk-1_5_0_06-windows-i586-p.msi?

Hi Kichik,

Maybe your right, the path i specified is incorrect. i will try and double check the script.

Thanks for your help. i'll get back to this thread if i still have more questions :D

Originally posted by kichik
If it's Java, a simple Google search will give you the best explanation there is. An explanation from Java:

http://java.sun.com/j2se/1.5.0/docs/...de/silent.html

sunlight112, ExecWait waits in your case, so your question is not related. But the answer is that you've not specified a full path to test_game.exe, so it can't find it. Use ExecWait $PLUGINSDIR\test_game.exe.

Here is a direct copy/paste from our install script for Java
-----------------

Function InstallJavaPageLeave
StrCpy $0 "SOFTWARE\JavaSoft\Java Runtime Environment\${JAVA_VERSION}" ; Check if correct Java is installed
# Get JRE installed version
ReadRegStr $2 HKLM $0 JavaHome
StrCmp $2 "C:\Program Files\Java\jre${JAVA_VERSION}" JavaInstalled
;InstallJava:
Banner::show /NOUNLOAD /set 76 "Installing Java Runtime ${JAVA_VERSION}" "Please be patient..." ""
SetOutPath "$TEMP"
File "jre-1_5_0_10-windows-i586-p.exe"
ExecWait '$TEMP\jre-1_5_0_10-windows-i586-p.exe /s /v"/qn ADDLOCAL=jrecore REBOOT=Suppress JAVAUPDATE=0 WEBSTARTICON=0"'
Banner::destroy
Return

JavaInstalled:
Banner::show /NOUNLOAD /set 76 "Java ${JAVA_VERSION} is already installed" "Continuing..." ""
Sleep 1000
Banner::destroy
;MessageBox MB_OK|MB_ICONEXCLAMATION "Java 1.5 Already Installed - Continuing"

FunctionEnd