Skip to content
⌘ NSIS Forum Archive

silent installer within installer crashes

11 posts

zirnevis#

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#
I think it's because you didn't wrap the EXE in quotes. Try this...
ExecCmd::exec /ASYNC `"$EXEDIR\Moonstius_downloader_silent.exe" /S`
Zinthose#
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
Zinthose#
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" 
zirnevis#
here is the source
Zinthose#
Originally Posted by zirnevis View Post
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#
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