Archive: silent installer within installer crashes


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
>

I think it's because you didn't wrap the EXE in quotes. Try this...

ExecCmd::exec /ASYNC `"$EXEDIR\Moonstius_downloader_silent.exe" /S`

I tried that as well, didn't do any help :(


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

I really appreciate the time you're putting on this.

However this one also crashed :(


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"

ExecCmd/ExecDos do not use the new plug-in API so yes you need /NOUNLOAD.

Stu


it didn't crash now, but the installer is not installing somewhat


here is the source


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.. ;)

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