2002-08-26 16:52:24 +00:00
;NSIS Modern Style UI
2002-08-29 10:31:13 +00:00
;Example Script version 1.1
2002-08-26 16:52:24 +00:00
;Written by Joost Verburg
!define NAME " Test Software " ;Define your own software name here
!define VERSION " 1.0 " ;Define your own software version here
!verbose 3
!include " ${NSISDIR} \Examples\WinMessages.nsh "
2002-08-29 10:31:13 +00:00
!include " ModernUI.nsh "
2002-08-26 16:52:24 +00:00
!verbose 4
!define CURRENTPAGE $9
!define TEMP1 $R0
!define TEMP2 $R1
;--------------------------------
;General
Name " ${NAME} ${VERSION} "
OutFile " Example.exe "
SetOverwrite on
;User interface
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INTERFACE " adni18-installer-C-no48xp.ico " " adni18-uninstall-C-no48xp.ico " " modern.bmp " " smooth "
2002-08-26 16:52:24 +00:00
;License dialog
LicenseText " Scroll down to see the rest of the agreement. "
LicenseData " License.txt "
;Component-select dialog
ComponentText " Check the components you want to install and uncheck the components you don't want to install. Click Next to continue. "
;Folder-select dialog
InstallDir " $PROGRAMFILES \${NAME} "
DirText " Setup will install ${NAME} in the following folder.$\r$\n$\r$\nTo install in this folder, click Install. To install in a different folder, click Browse and select another folder. " " "
;Uninstaller
UninstallText " This will uninstall ${NAME} from your system. "
;--------------------------------
;Installer Sections
2002-08-29 10:31:13 +00:00
Section " Modern.exe " SecCopyUI
2002-08-26 16:52:24 +00:00
;Add your stuff here
SetOutPath " $INSTDIR "
File " ${NSISDIR} \Contrib\UIs\modern.exe "
SectionEnd
Section " Create uninstaller " SecCreateUninst
;Add your stuff here
WriteUninstaller " $INSTDIR \Uninstall.exe "
SectionEnd
Section " "
;Invisible section to display the Finish header
2002-08-29 10:31:13 +00:00
!insertmacro MUI_FINISHHEADER
2002-08-26 16:52:24 +00:00
SectionEnd
;--------------------------------
;Installer Functions
Function .onInitDialog
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_INIT
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_START 1
!insertmacro MUI_INNERDIALOG_TEXT 1033 1040 " If you accept all the terms of the agreement, choose I Agree to continue. If you choose Cancel, Setup will close. You must accept the agreement to install ${NAME}. "
!insertmacro MUI_INNERDIALOG_STOP 1
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_START 2
!insertmacro MUI_INNERDIALOG_TEXT 1033 1042 " Description "
!insertmacro MUI_INNERDIALOG_TEXT 1033 1043 " Hover your mouse over a component to see it's description. "
!insertmacro MUI_INNERDIALOG_STOP 2
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_START 3
!insertmacro MUI_INNERDIALOG_TEXT 1033 1041 " Destination Folder "
!insertmacro MUI_INNERDIALOG_STOP 3
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_END
2002-08-26 16:52:24 +00:00
FunctionEnd
Function .onNextPage
2002-08-29 10:31:13 +00:00
!insertmacro MUI_NEXTPAGE_OUTER
!insertmacro MUI_NEXTPAGE SetHeader
2002-08-26 16:52:24 +00:00
FunctionEnd
Function .onPrevPage
2002-08-29 10:31:13 +00:00
!insertmacro MUI_PREVPAGE
2002-08-26 16:52:24 +00:00
FunctionEnd
Function SetHeader
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_INIT
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 1
!insertmacro MUI_HEADER_TEXT 1033 " License Agreement " " Please review the license terms before installing ${NAME}. "
!insertmacro MUI_HEADER_STOP 1
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 2
!insertmacro MUI_HEADER_TEXT 1033 " Choose Components " " Choose the components you want to install. "
!insertmacro MUI_HEADER_STOP 2
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 3
!insertmacro MUI_HEADER_TEXT 1033 " Choose Install Location " " Choose the folder in which to install ${NAME} in. "
!insertmacro MUI_HEADER_STOP 3
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 4
!insertmacro MUI_HEADER_TEXT 1033 " Installing " " Please wait while ${NAME} is being installed. "
!insertmacro MUI_HEADER_STOP 4
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 5
!insertmacro MUI_HEADER_TEXT 1033 " Finished " " Setup was completed successfully. "
!insertmacro MUI_HEADER_STOP 5
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_END
2002-08-26 16:52:24 +00:00
FunctionEnd
Function .onMouseOverSection
2002-08-29 10:31:13 +00:00
!insertmacro MUI_DESCRIPTION_INIT
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_DESCRIPTION_TEXT 1033 ${SecCopyUI} " Copy the modern.exe file to the application folder. "
!insertmacro MUI_DESCRIPTION_TEXT 1033 ${SecCreateUninst} " Create a uninstaller which can automatically delete ${NAME}. "
!insertmacro MUI_DESCRIPTION_END
2002-08-26 16:52:24 +00:00
FunctionEnd
Function .onUserAbort
2002-08-29 10:31:13 +00:00
!insertmacro MUI_ABORTWARNING 1033 " Are you sure you want to quit ${NAME} Setup? "
!insertmacro MUI_ABORTWARNING_END
2002-08-26 16:52:24 +00:00
FunctionEnd
;--------------------------------
;Uninstaller Section
Section " Uninstall "
;Add your stuff here
Delete " $INSTDIR \modern.exe "
Delete " $INSTDIR \Uninstall.exe "
RMDir " $INSTDIR "
;Display the Finish header
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
Call un.SetHeader
SectionEnd
;--------------------------------
;Uninstaller Functions
Function un.onNextPage
2002-08-29 10:31:13 +00:00
!insertmacro MUI_NEXTPAGE_OUTER
!insertmacro MUI_NEXTPAGE un.SetHeader
2002-08-26 16:52:24 +00:00
FunctionEnd
Function un.SetHeader
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_INIT
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 1
!insertmacro MUI_HEADER_TEXT 1033 " Uninstall ${NAME} " " Remove ${NAME} from your system. "
!insertmacro MUI_HEADER_STOP 1
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 2
!insertmacro MUI_HEADER_TEXT 1033 " Uninstalling " " Please wait while ${NAME} is being uninstalled. "
!insertmacro MUI_HEADER_STOP 2
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_START 3
!insertmacro MUI_HEADER_TEXT 1033 " Finished " " ${NAME} has been removed from your system. "
!insertmacro MUI_HEADER_STOP 3
2002-08-26 16:52:24 +00:00
2002-08-29 10:31:13 +00:00
!insertmacro MUI_HEADER_END
2002-08-26 16:52:24 +00:00
FunctionEnd
;eof