Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th November 2008, 19:25   #1
pbenson
Junior Member
 
Join Date: Nov 2008
Posts: 2
Question 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!
pbenson is offline   Reply With Quote
Old 30th November 2008, 21:22   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Use SetAutoClose true in your section.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 30th November 2008, 21:29   #3
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
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.
demiller9 is offline   Reply With Quote
Old 30th November 2008, 23:53   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If you are just launching another installer, you might as well just do away with MUI and make a silent installer:
code:
SetCompressor /solid lzma
OutFile silent.exe
SilentInstall silent

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



Stu
Afrow UK is offline   Reply With Quote
Old 1st December 2008, 03:14   #5
pbenson
Junior Member
 
Join Date: Nov 2008
Posts: 2
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.
pbenson is offline   Reply With Quote
Old 2nd December 2008, 14:53   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Note that the above code I posted is a complete script.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump