zirnevis
9th July 2010 17:52 UTC
silent installer within installer crashes
Hi Guys,
I made a small installer that initiate download the main package upon starting installer while processing user registration.
I use this command to run it silently:
ExecCmd::exec /ASYNC "$EXEDIR\Moonstius_downloader_silent.exe /S"
however it crashes ! I have no idea why, here is the code for this:
!define PRODUCT_NAME "Moontius Downloader"
>!define PRODUCT_VERSION "1.0"
>!define PRODUCT_PUBLISHER "Moontius"
>!define PRODUCT_WEB_SITE "http://www.moontius.com"
>SetCompressor lzma
>!include "MUI.nsh"
>; MUI Settings
>!define MUI_ABORTWARNING
>!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
>; Language files
>!insertmacro MUI_LANGUAGE "English"
>; Reserve files
>!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
>; MUI end ------
>Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
>OutFile "Moonstius_downloader_silent.exe"
>ShowInstDetails show
>Function .oninit
FunctionEnd
Section"MainSection" SEC01
InetLoad::load "http://www.ultratone.com.my/downloads/Moontius-2.2-setup-release-4.exe" "$EXEDIR\Moontius-package.exe"
>SectionEnd
Section-Post
SectionEnd
>
Zinthose
9th July 2010 17:58 UTC
I think it's because you didn't wrap the EXE in quotes. Try this...
ExecCmd::exec /ASYNC `"$EXEDIR\Moonstius_downloader_silent.exe" /S`
zirnevis
9th July 2010 18:31 UTC
I tried that as well, didn't do any help :(
Zinthose
9th July 2010 19:00 UTC
after looking at the documentation for ExecCmd::exec I found that you are missing the "stdin_string" parameter.
Try this...
ExecCmd::exec /ASYNC `"$EXEDIR\Moonstius_downloader_silent.exe" /S` ""
Check the example at
http://nsis.sourceforge.net/ExecCmd_plug-in
zirnevis
9th July 2010 19:08 UTC
I really appreciate the time you're putting on this.
However this one also crashed :(
Zinthose
9th July 2010 19:26 UTC
Ah got it... if you don't add the /NOUNLOAD option it causes an error...
ExecCmd::exec /NOUNLOAD /ASYNC '"$EXEDIR\Moonstius_downloader_silent.exe" /S' ""
Pop $0 # thread handle for wait
# you can add some installation code here to execute while application is running.
ExecCmd::wait $0
Pop $0 # return value
DetailPrint "Exit code: $0"
Afrow UK
9th July 2010 19:32 UTC
ExecCmd/ExecDos do not use the new plug-in API so yes you need /NOUNLOAD.
Stu
zirnevis
9th July 2010 19:33 UTC
it didn't crash now, but the installer is not installing somewhat
zirnevis
9th July 2010 19:35 UTC
here is the source
Zinthose
9th July 2010 21:58 UTC
Originally posted by zirnevis
it didn't crash now, but the installer is not installing somewhat
Can you Clarify?
Also your script is not waiting for the file to complete downloading. and doesn't check to see if it completed downloading upon install completion.
Perhaps your should simplify your install script and slowly add in the "other stuff". Call me lazy but I won't want to decipher all the code you listed.. ;)
zirnevis
10th July 2010 05:38 UTC
Hi Dude,
Thanks a lot for the time you spend with me to solve this issue.
after I change ExecCmd to ExecDos the problem was solved.
Regards