macro system updates

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1569 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2002-11-03 00:01:40 +00:00
parent fd2f12a759
commit ce7c1170c6
2 changed files with 164 additions and 78 deletions

View file

@ -191,6 +191,8 @@
!macro MUI_GUIINIT !macro MUI_GUIINIT
!verbose 3
Push ${MUI_TEMP1} Push ${MUI_TEMP1}
Push ${MUI_TEMP2} Push ${MUI_TEMP2}
@ -211,6 +213,98 @@
Pop ${MUI_TEMP2} Pop ${MUI_TEMP2}
Pop ${MUI_TEMP1} Pop ${MUI_TEMP1}
!verbose 4
!macroend
!macro MUI_PAGECOMMANDS
!verbose 3
!insertmacro MUI_PAGECOMMAND_LICENSE
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGECOMMAND_INSTFILES
!verbose 4
!macroend
!macro MUI_PAGECOMMAND_LICENSE
!verbose 3
!ifdef MUI_LICENSEPAGE
Page license SetLicense SetLicenseDialog
!endif
!verbose 4
!macroend
!macro MUI_PAGECOMMAND_COMPONENTS
!verbose 3
!ifdef MUI_COMPONENTSPAGE
Page components SetComponents SetComponentsDialog
!endif
!verbose 4
!macroend
!macro MUI_PAGECOMMAND_DIRECTORY
!verbose 3
!ifdef MUI_DIRECTORYPAGE
Page directory SetDirectory SetDirectoryDialog
!endif
!verbose 4
!macroend
!macro MUI_PAGECOMMAND_INSTFILES
!verbose 3
Page instfiles SetInstFiles
!verbose 4
!macroend
!macro MUI_UNPAGECOMMANDS
!verbose 3
!insertmacro MUI_UNPAGECOMMAND_CONFIRM
!insertmacro MUI_UNPAGECOMMAND_INSTFILES
!verbose 4
!macroend
!macro MUI_UNPAGECOMMAND_CONFIRM
!verbose 3
UninstPage uninstConfirm un.SetUninstConfirm
!verbose 4
!macroend
!macro MUI_UNPAGECOMMAND_INSTFILES
!verbose 3
UninstPage instfiles un.SetInstFiles
!verbose 4
!macroend !macroend
;-------------------------------- ;--------------------------------
@ -307,6 +401,28 @@
!macroend !macroend
!macro MUI_FUNCTIONS_PAGES
!verbose 3
!ifdef MUI_LICENSEPAGE
!insertmacro MUI_FUNCTIONS_LICENSEPAGE SetLicense SetLicenseDialog
!endif
!ifdef MUI_COMPONENTSPAGE
!insertmacro MUI_FUNCTIONS_COMPONENTSPAGE SetComponents SetComponentsDialog
!endif
!ifdef MUI_DIRECTORYPAGE
!insertmacro MUI_FUNCTIONS_DIRECTORYPAGE SetDirectory SetDirectoryDialog
!endif
!insertmacro MUI_FUNCTIONS_INSTFILESPAGE SetInstFiles
!verbose 4
!macroend
!macro MUI_FUNCTIONS_LICENSEPAGE SETLICENSE SETLICENSEDIALOG !macro MUI_FUNCTIONS_LICENSEPAGE SETLICENSE SETLICENSEDIALOG
!verbose 3 !verbose 3
@ -394,9 +510,11 @@
!verbose 3 !verbose 3
Function .onUserAbort !ifdef MUI_ABORTWARNING
!insertmacro MUI_ABORTWARNING Function .onUserAbort
FunctionEnd !insertmacro MUI_ABORTWARNING
FunctionEnd
!endif
!verbose 4 !verbose 4
@ -414,6 +532,13 @@
!macroend !macroend
!macro MUI_UNFUNCTIONS_PAGES
!insertmacro MUI_UNFUNCTIONS_CONFIRMPAGE un.SetUninstConfirm
!insertmacro MUI_UNFUNCTIONS_INSTFILESPAGE un.SetInstFiles
!macroend
!macro MUI_UNFUNCTIONS_CONFIRMPAGE UNSETUNINSTCONFIRM !macro MUI_UNFUNCTIONS_CONFIRMPAGE UNSETUNINSTCONFIRM
!verbose 3 !verbose 3
@ -445,30 +570,22 @@
!verbose 3 !verbose 3
!ifdef MUI_LICENSEPAGE !insertmacro MUI_PAGECOMMANDS
Page license SetLicense SetLicenseDialog !insertmacro MUI_FUNCTIONS_PAGES
!insertmacro MUI_FUNCTIONS_LICENSEPAGE SetLicense SetLicenseDialog
!endif
!ifdef MUI_COMPONENTSPAGE
Page components SetComponents SetComponentsDialog
!insertmacro MUI_FUNCTIONS_COMPONENTSPAGE SetComponents SetComponentsDialog
!endif
!ifdef MUI_DIRECTORYPAGE
Page directory SetDirectory SetDirectoryDialog
!insertmacro MUI_FUNCTIONS_DIRECTORYPAGE SetDirectory SetDirectoryDialog
!endif
Page instfiles SetInstFiles
!insertmacro MUI_FUNCTIONS_INSTFILESPAGE SetInstFiles
!insertmacro MUI_FUNCTIONS_GUIINIT !insertmacro MUI_FUNCTIONS_GUIINIT
!insertmacro MUI_FUNCTIONS_ABORTWARNING
!ifdef MUI_ABORTWARNING !verbose 4
!insertmacro MUI_FUNCTIONS_ABORTWARNING
!endif !macroend
!macro MUI_FUNCTIONS_CUSTOMPAGE_BASIC
!verbose 3
!insertmacro MUI_FUNCTIONS_PAGES
!insertmacro MUI_FUNCTIONS_GUIINIT
!insertmacro MUI_FUNCTIONS_ABORTWARNING
!verbose 4 !verbose 4
@ -478,12 +595,19 @@
!verbose 3 !verbose 3
UninstPage uninstConfirm un.SetUninstConfirm !insertmacro MUI_UNPAGECOMMANDS
UninstPage instfiles un.SetInstFiles !insertmacro MUI_UNFUNCTIONS_PAGES
!insertmacro MUI_UNFUNCTIONS_GUIINIT
!insertmacro MUI_UNFUNCTIONS_CONFIRMPAGE un.SetUninstConfirm !verbose 4
!insertmacro MUI_UNFUNCTIONS_INSTFILESPAGE un.SetInstFiles
!macroend
!macro MUI_UNFUNCTIONS_CUSTOMPAGE_BASIC
!verbose 3
!insertmacro MUI_UNFUNCTIONS_PAGES
!insertmacro MUI_UNFUNCTIONS_GUIINIT !insertmacro MUI_UNFUNCTIONS_GUIINIT
!verbose 4 !verbose 4

View file

@ -1,5 +1,5 @@
;NSIS Modern User Interface version 1.4 ;NSIS Modern User Interface version 1.4
;Advanced Macro System & Install Options Example Script ;Install Options Example Script
;Written by Joost Verburg ;Written by Joost Verburg
!define NAME "Test Software" ;Define your own software name here !define NAME "Test Software" ;Define your own software name here
@ -30,19 +30,13 @@
Name "${NAME} ${VERSION}" Name "${NAME} ${VERSION}"
;Page order ;Page order
!ifdef MUI_LICENSEPAGE !insertmacro MUI_PAGECOMMAND_LICENSE
Page license SetLicense SetLicenseDialog
!endif
Page custom SetCustomA Page custom SetCustomA
Page custom SetCustomB Page custom SetCustomB
!ifdef MUI_COMPONENTSPAGE !insertmacro MUI_PAGECOMMAND_COMPONENTS
Page components SetComponents SetComponentsDialog !insertmacro MUI_PAGECOMMAND_DIRECTORY
!endif
!ifdef MUI_DIRECTORYPAGE
Page directory SetDirectory SetDirectoryDialog
!endif
Page custom SetCustomC Page custom SetCustomC
Page instfiles SetInstFiles !insertmacro MUI_PAGECOMMAND_INSTFILES
!insertmacro MUI_INTERFACE !insertmacro MUI_INTERFACE
@ -62,8 +56,8 @@
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Create your own dialog!" LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Create your own dialog!"
;Uninstaller ;Uninstaller
UninstPage uninstConfirm un.SetUninstConfirm !insertmacro MUI_UNPAGECOMMAND_CONFIRM
UninstPage instfiles un.SetInstFiles !insertmacro MUI_UNPAGECOMMAND_INSTFILES
;Things that need to be extracted on startup (keep these lines before any File command!) ;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! ;Use ReserveFile for your own Install Options ini files too!
@ -108,12 +102,7 @@ Section "modern.exe" SecCopyUI
;Checked ;Checked
MessageBox MB_OK "A MessageBox..." MessageBox MB_OK "A MessageBox..."
SectionEnd ;Create uninstaller
Section "Create uninstaller" SecCreateUninst
;Add your stuff here
WriteUninstaller "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd SectionEnd
@ -128,10 +117,6 @@ SectionEnd
;-------------------------------- ;--------------------------------
;Installer Functions ;Installer Functions
!ifdef MUI_LICENSEPAGE
!insertmacro MUI_FUNCTIONS_LICENSEPAGE SetLicense SetLicenseDialog
!endif
Function SetCustomA Function SetCustomA
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE) !insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioA.ini" !insertmacro MUI_INSTALLOPTIONS_SHOW "ioA.ini"
@ -142,29 +127,12 @@ Function SetCustomB
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioB.ini" !insertmacro MUI_INSTALLOPTIONS_SHOW "ioB.ini"
FunctionEnd FunctionEnd
!ifdef MUI_COMPONENTSPAGE
!insertmacro MUI_FUNCTIONS_COMPONENTSPAGE SetComponents SetComponentsDialog
!endif
!ifdef MUI_DIRECTORYPAGE
!insertmacro MUI_FUNCTIONS_DIRECTORYPAGE SetDirectory SetDirectoryDialog
!endif
Function SetCustomC Function SetCustomC
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE) !insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioC.ini" !insertmacro MUI_INSTALLOPTIONS_SHOW "ioC.ini"
FunctionEnd FunctionEnd
!insertmacro MUI_FUNCTIONS_INSTFILESPAGE SetInstFiles !insertmacro MUI_FUNCTIONS_CUSTOMPAGE_BASIC
!insertmacro MUI_FUNCTIONS_GUIINIT
!insertmacro MUI_FUNCTIONS_DESCRIPTION_START
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_DESCRIPTION_TEXT ${SecCreateUninst} $(DESC_SecCreateUninst)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
!insertmacro MUI_FUNCTIONS_ABORTWARNING
;-------------------------------- ;--------------------------------
;Uninstaller ;Uninstaller
@ -185,12 +153,6 @@ SectionEnd
;-------------------------------- ;--------------------------------
;Uninstaller Functions ;Uninstaller Functions
UninstPage uninstConfirm un.SetUninstConfirm !insertmacro MUI_UNFUNCTIONS_CUSTOMPAGE_BASIC
UninstPage instfiles un.SetInstFiles
!insertmacro MUI_UNFUNCTIONS_CONFIRMPAGE un.SetUninstConfirm
!insertmacro MUI_UNFUNCTIONS_INSTFILESPAGE un.SetInstFiles
!insertmacro MUI_UNFUNCTIONS_GUIINIT
;eof ;eof