Archive: Installer does not close


Installer does not close
Hi,
i think i need a little help with problem :)
Im trying to make an .nsi to repack firefox for a silent install.
The install-process works fine but after that the setup process does not
end. Its still in the Task-List.

Im using NSIS for the first time, maybe someone has an idea what is wrong.

Thanks
SL



; Silent Installer


; Set compression level to LZMA - smaller file
SetCompressor /SOLID LZMA

; Initiallization
!define PRODUCT_NAME "Firefox Silent Deploy"
!define PRODUCT_VERSION "2.0.0.5"
!define LVM_GETITEMCOUNT 0x1004
!define LVM_GETITEMTEXT 0x102D
!define LogFileName "Firefox.log"

; Some variables
Var INSTALL_DIR

; Include Libraries
!include "MUI.nsh"
!include "WinMessages.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "Firefox_Setup\Icon\Firefox.ico"
!define MUI_COMPONENTSPAGE_NODESC "true"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Firefox-2.0.0.5-silent-install.exe"
InstallDir "$TEMP\Firefox"



ShowInstDetails nevershow ; can change this to 'hide' or 'show'


SectionGroup "Main Program" SEC01

Section # "Installer"
DetailPrint "Deploying Main Firefox Installer"
SetOutPath "$INSTDIR"
SetOverwrite on

; Unpack the Installer

IfSilent 0 +4
StrCpy $R2 "Unpacking Firefox Installer"
Push $R2
Call WriteBannerBottom
ExecWait "$EXEDIR\Firefox_Setup.exe"

; Execute the Main Firefox Installer

IfSilent 0 +4
StrCpy $R2 "Installing Firefox"
Push $R2
Call WriteBannerBottom
ExecWait "$TEMP\Firefox\setup.exe -ms"

; Get the short name for the INSTALL_DIR variable

GetFullPathName /SHORT $INSTALL_DIR "$PROGRAMFILES\Mozilla Firefox"
SectionEnd


SectionGroupEnd



Section # "PostInstall"


; Dump the Installer Log to a log-file

IfSilent +5 0
CreateDirectory $WINDIR\Logs
SetOutPath $WINDIR\Logs
Push ${LogFileName}
Call DumpLog
; Remove temporary files
SetOutPath $TEMP
RMDir /r $TEMP\Firefox
RMDir /r $TEMP\ns_temp
SectionEnd

; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Main Program"
!insertmacro MUI_FUNCTION_DESCRIPTION_END

; Functions

Function .onInit
; Set installer mode to silent (remove the next line if you want to invoke the installer with the /S switch from the command prompt)
SetSilent silent
IfSilent 0 +2
Banner::show /NOUNLOAD /set 76 "Firefox Deployment" "Initializing ..."
; Extract the Installer Files
SetOutPath "$INSTDIR"
IfSilent 0 +4
StrCpy $R2 "Expanding Installer Files"
Push $R2
Call WriteBannerBottom
File /r "Firefox_Setup\*.*"
; Read settings from INI file
FunctionEnd

Function DumpLog
Exch $5
Push $0
Push $1
Push $2
Push $3
Push $4
Push $6

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1016
StrCmp $0 0 error
FileOpen $5 $5 "w"
StrCmp $5 0 error
SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
System::Alloc ${NSIS_MAX_STRLEN}
Pop $3
StrCpy $2 0
System::Call "*(i, i, i, i, i, i, i, i, i) i \
(0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
loop: StrCmp $2 $6 done
System::Call "User32::SendMessageA(i, i, i, i) i \
($0, ${LVM_GETITEMTEXT}, $2, r1)"
System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
FileWrite $5 "$4$\r$\n"
IntOp $2 $2 + 1
Goto loop
done:
FileClose $5
System::Free $1
System::Free $3
Goto exit
error:
MessageBox MB_OK error
exit:
Pop $6
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
Exch $5
FunctionEnd


Function WriteBannerBottom
Banner::getWindow /NOUNLOAD
Pop $1
GetDlgItem $2 $1 1030
SendMessage $2 ${WM_SETTEXT} 1 "STR:$R2"
FunctionEnd



Can you identify which one of the two does not close?

Stu