2002-09-30 17:27:33 +00:00
;NSIS Modern Style UI version 1.21
2002-09-20 23:02:38 +00:00
;InstallOptions Example Script
;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
2002-09-25 18:46:36 +00:00
!include " ModernUI.nsh "
2002-09-20 23:02:38 +00:00
!verbose 4
;--------------------------------
2002-09-22 13:33:53 +00:00
;Configuration
2002-09-20 23:02:38 +00:00
;General
Name " ${NAME} ${VERSION} "
OutFile " InstallOptions.exe "
SetOverwrite on
;User interface
2002-09-25 18:46:36 +00:00
!insertmacro MUI_INTERFACE " modern.exe " " adni18-installer-C-no48xp.ico " " adni18-uninstall-C-no48xp.ico " " modern.bmp " " smooth " " $9 " ;$9 is the variable used to store the current page, do not use this var!
!insertmacro MUI_INSTALLOPTIONS " $7 " " $8 " ;Variables for the Install Options system. Do not use them in .onNext/PrevPage and SetPage
2002-09-20 23:02:38 +00:00
;License dialog
LicenseText " Press Page 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. " " "
InstallButtonText " Next > " ;Install Options dialog has 'Install' button
;Uninstaller
UninstallText " This will uninstall ${NAME} from your system. "
2002-09-22 13:33:53 +00:00
;Things that need to be extracted on startup (keep these lines before any File command!)
;Use ReserveFile for your own Install Options ini files too!
ReserveFile " ${NSISDIR} \Plugins\InstallOptions.dll "
ReserveFile " iniA.ini "
ReserveFile " iniB.ini "
ReserveFile " iniC.ini "
2002-09-20 23:02:38 +00:00
;--------------------------------
;Installer Sections
Section " Modern.exe " SecCopyUI
;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
!insertmacro MUI_FINISHHEADER SetPage
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
;Init InstallOptions
!insertmacro MUI_INSTALLOPTIONS_EXTRACT " iniA.ini "
!insertmacro MUI_INSTALLOPTIONS_EXTRACT " iniB.ini "
2002-09-22 11:35:10 +00:00
!insertmacro MUI_INSTALLOPTIONS_EXTRACT " iniC.ini "
2002-09-20 23:02:38 +00:00
FunctionEnd
Function .onInitDialog
!insertmacro MUI_INNERDIALOG_INIT
!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-09-22 11:35:10 +00:00
!insertmacro MUI_INNERDIALOG_START 4
2002-09-20 23:02:38 +00:00
!insertmacro MUI_INNERDIALOG_TEXT 1033 1042 " Description "
!insertmacro MUI_INNERDIALOG_TEXT 1033 1043 " Hover your mouse over a component to see it's description. "
2002-09-22 11:35:10 +00:00
!insertmacro MUI_INNERDIALOG_STOP 4
2002-09-20 23:02:38 +00:00
2002-09-22 11:35:10 +00:00
!insertmacro MUI_INNERDIALOG_START 5
2002-09-20 23:02:38 +00:00
!insertmacro MUI_INNERDIALOG_TEXT 1033 1041 " Destination Folder "
2002-09-22 11:35:10 +00:00
!insertmacro MUI_INNERDIALOG_STOP 5
2002-09-20 23:02:38 +00:00
!insertmacro MUI_INNERDIALOG_END
FunctionEnd
Function .onNextPage
2002-09-22 11:58:04 +00:00
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
2002-09-20 23:02:38 +00:00
!insertmacro MUI_NEXTPAGE SetPage
FunctionEnd
Function .onPrevPage
2002-09-22 11:58:04 +00:00
!insertmacro MUI_INSTALLOPTIONS_PREVPAGE
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PREVPAGE SetPage
FunctionEnd
Function SetPage
!insertmacro MUI_PAGE_INIT
!insertmacro MUI_PAGE_START 1
!insertmacro MUI_HEADER_TEXT 1033 " License Agreement " " Please review the license terms before installing ${NAME}. "
!insertmacro MUI_PAGE_STOP 1
!insertmacro MUI_PAGE_START 2
!insertmacro MUI_HEADER_TEXT 1033 " Install Options A " " Create your own dialog! "
2002-09-21 11:27:27 +00:00
WriteIniStr " $PLUGINSDIR \iniA.ini " " Settings " " Title " " ${NAME} ${VERSION} Setup: Install Options A "
WriteIniStr " $PLUGINSDIR \iniA.ini " " Settings " " CancelConfirm " " Are you sure you want to quit ${NAME} Setup? "
WriteIniStr " $PLUGINSDIR \iniA.ini " " Settings " " CancelConfirmCaption " " ${NAME} ${VERSION} Setup "
2002-09-30 22:28:46 +00:00
WriteIniStr " $PLUGINSDIR \iniA.ini " " Settings " " CancelConfirmFlags " " MB_ICONEXCLAMATION "
2002-09-22 11:35:10 +00:00
!insertmacro MUI_INSTALLOPTIONS_SHOW 2 " iniA.ini " " " " IO " ;Next page is an IO page
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_STOP 2
!insertmacro MUI_PAGE_START 3
2002-09-22 11:35:10 +00:00
!insertmacro MUI_HEADER_TEXT 1033 " Install Options B " " Create your own dialog! "
WriteIniStr " $PLUGINSDIR \iniB.ini " " Settings " " Title " " ${NAME} ${VERSION} Setup: Install Options B "
WriteIniStr " $PLUGINSDIR \iniB.ini " " Settings " " CancelConfirm " " Are you sure you want to quit ${NAME} Setup? "
WriteIniStr " $PLUGINSDIR \iniB.ini " " Settings " " CancelConfirmCaption " " ${NAME} ${VERSION} Setup "
2002-09-30 22:28:46 +00:00
WriteIniStr " $PLUGINSDIR \iniB.ini " " Settings " " CancelConfirmFlags " " MB_ICONEXCLAMATION "
2002-09-22 11:35:10 +00:00
!insertmacro MUI_INSTALLOPTIONS_SHOW 3 " iniB.ini " " IO " " " ;Previous page is an IO page
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_STOP 3
!insertmacro MUI_PAGE_START 4
2002-09-22 11:35:10 +00:00
!insertmacro MUI_HEADER_TEXT 1033 " Choose Components " " Choose the components you want to install. "
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_STOP 4
!insertmacro MUI_PAGE_START 5
2002-09-22 11:35:10 +00:00
!insertmacro MUI_HEADER_TEXT 1033 " Choose Install Location " " Choose the folder in which to install ${NAME}. "
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_STOP 5
!insertmacro MUI_PAGE_START 6
2002-09-22 11:35:10 +00:00
!insertmacro MUI_HEADER_TEXT 1033 " Install Options C " " Create your own dialog! "
2002-09-30 22:28:46 +00:00
WriteIniStr " $PLUGINSDIR \iniC.ini " " Settings " " Title " " ${NAME} ${VERSION} Setup: Install Options C "
WriteIniStr " $PLUGINSDIR \iniC.ini " " Settings " " CancelConfirm " " Are you sure you want to quit ${NAME} Setup? "
WriteIniStr " $PLUGINSDIR \iniC.ini " " Settings " " CancelConfirmCaption " " ${NAME} ${VERSION} Setup "
WriteIniStr " $PLUGINSDIR \iniC.ini " " Settings " " CancelConfirmFlags " " MB_ICONEXCLAMATION "
2002-09-22 12:53:09 +00:00
!insertmacro MUI_INSTALLOPTIONS_SHOW 6 " iniC.ini " " " " " ;Next/previous page is no IO page
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_STOP 6
!insertmacro MUI_PAGE_START 7
2002-09-22 11:35:10 +00:00
!insertmacro MUI_HEADER_TEXT 1033 " Installing " " Please wait while ${NAME} is being installed. "
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_STOP 7
2002-09-22 11:35:10 +00:00
!insertmacro MUI_PAGE_START 8
!insertmacro MUI_HEADER_TEXT 1033 " Finished " " Setup was completed successfully. "
!insertmacro MUI_PAGE_STOP 8
2002-09-20 23:02:38 +00:00
!insertmacro MUI_PAGE_END
FunctionEnd
Function .onMouseOverSection
!insertmacro MUI_DESCRIPTION_INIT
!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
FunctionEnd
Function .onUserAbort
!insertmacro MUI_ABORTWARNING 1033 " Are you sure you want to quit ${NAME} Setup? "
!insertmacro MUI_ABORTWARNING_END
FunctionEnd
;--------------------------------
;Uninstaller Section
Section " Uninstall "
;Add your stuff here
Delete " $INSTDIR \modern.exe "
Delete " $INSTDIR \Uninstall.exe "
RMDir " $INSTDIR "
!insertmacro MUI_FINISHHEADER un.SetPage
SectionEnd
;--------------------------------
;Uninstaller Functions
Function un.onNextPage
!insertmacro MUI_NEXTPAGE un.SetPage
FunctionEnd
Function un.SetPage
!insertmacro MUI_PAGE_INIT
!insertmacro MUI_PAGE_START 1
!insertmacro MUI_HEADER_TEXT 1033 " Uninstall ${NAME} " " Remove ${NAME} from your system. "
!insertmacro MUI_PAGE_STOP 1
!insertmacro MUI_PAGE_START 2
!insertmacro MUI_HEADER_TEXT 1033 " Uninstalling " " Please wait while ${NAME} is being uninstalled. "
!insertmacro MUI_PAGE_STOP 2
!insertmacro MUI_PAGE_START 3
!insertmacro MUI_HEADER_TEXT 1033 " Finished " " ${NAME} has been removed from your system. "
!insertmacro MUI_PAGE_STOP 3
!insertmacro MUI_PAGE_END
FunctionEnd
;eof