Archive: One-click installer: Remove "Installation Complete" close prompt?


One-click installer: Remove "Installation Complete" close prompt?
Hi! I am not a developer, but I am a Systems Engineer who often has to come up with improvised solutions for others in the field.

Some of my users have a need for a one-click installation. WinZip's self-extractor has some issues with the package. I discovered NSIS and HM NSIS and was very impressed. So far I've been able to do a lot with NSIS in a very short period of time (a couple of days) despite being a first time user. Yet there is one hurdle I haven't been able to get past and that I have not found an answer to elsewhere (wiki, forum posts, manuals, etc.).

I can't eliminate the "Installation Complete" screen with a single "Close" button that appears after the package has unloaded all of the files and launched an installation script.

Here is the script that I am compiling (edited so as not to contain sensitive info):

; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Program"
!define PRODUCT_VERSION "11.30.2008"
!define PRODUCT_PUBLISHER "Company"
!define PRODUCT_WEB_SITE "http://www.website.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\setup.exe"

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

; Welcome page
; !insertmacro MUI_PAGE_WELCOME
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
; !define MUI_FINISHPAGE_RUN "$INSTDIR\Install.exe"
; !insertmacro MUI_PAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "output.exe"
InstallDir "$TEMP\program"
ShowInstDetails nevershow

Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite try
File "C:\Install.exe"
Exec "$INSTDIR\Install.exe"
SectionEnd

As you can see the script is pretty simple. Install.exe is a compiled Auto IT script that does the work. I'm using NSIS to package the files with, and to unpackage the files into the temp directory and then to launch the Install.exe program with.

I think that my problem is with the MUI_PAGE_INSTFILES macro in the system.nsh file for the Modern UI.

!macro MUI_PAGE_INSTFILES

!verbose push
!verbose ${MUI_VERBOSE}

!insertmacro MUI_PAGE_INIT

!insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTFILESPAGE

PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}instfiles

PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}

Caption " "

PageExEnd

!insertmacro MUI_FUNCTION_INSTFILESPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}

!insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_TEXT
!insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
!insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_TEXT
!insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_SUBTEXT

!verbose pop

!macroend

I could be completely wrong here though and would really appreciate some help. Is there a way to remove this prompt for the installation complete?

Thanks in advance!


Use SetAutoClose true in your section.


4.8.1.3 AutoCloseWindow
true|false
Sets whether or not the install window automatically closes when completed. This is overrideable from a section using SetAutoClose.


Try adding "AutoCloseWindow true" to your script, perhaps after the "!define PRODUCT..." lines.


If you are just launching another installer, you might as well just do away with MUI and make a silent installer:

SetCompressor /solid lzma
OutFile silent.exe
SilentInstall silent

Section
InitPluginsDir
SetOutPath $PLUGINSDIR
SetOverwrite try
File C:\Install.exe
Exec `"$PLUGINSDIR\Install.exe"`
SectionEnd


Stu

Thanks! The "SetAutoClose true" instruction did the trick. I'll be looking into the silent install as an improvement for the next version of this little project.

Again, thanks a lot! I'm sure that I'll be using NSIS a lot more often in the future.


Note that the above code I posted is a complete script.

Stu