macro system updates
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1467 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
278b2c6bb6
commit
9585e78fcf
5 changed files with 127 additions and 40 deletions
|
@ -126,12 +126,15 @@ table
|
||||||
file and recompile NSIS.</p>
|
file and recompile NSIS.</p>
|
||||||
<p class="header">Version history</p>
|
<p class="header">Version history</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="text">1.3 - October 18, 2002
|
<li class="text">1.3 - October 26, 2002
|
||||||
<ul>
|
<ul>
|
||||||
<li>Easier macro system for basic scripts
|
<li>Easier macro system for basic scripts
|
||||||
<li>New MultiLanguage system using Modern UI Language Files
|
<li>New MultiLanguage system using Modern UI Language Files
|
||||||
<li>New directory structure (header/language files in Contrib\Modern UI)
|
<li>New directory structure (header/language files in Contrib\Modern UI)
|
||||||
<li>Small bugfixes & typo corrections
|
<li>Small bugfixes & typo corrections
|
||||||
|
<li>SetPage function should be set using defines
|
||||||
|
<li>Different NextPage/PrevPage/FinishHeader macro's for install/uninstall
|
||||||
|
<li>Icon/UI paths can be set using defines (no MUI_INTERFACE_ABSOLUTEPATH anymore)
|
||||||
</ul>
|
</ul>
|
||||||
<li class="text">1.21 - September 30, 2002
|
<li class="text">1.21 - September 30, 2002
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -22,29 +22,20 @@
|
||||||
|
|
||||||
;User interface
|
;User interface
|
||||||
|
|
||||||
Icon "${NSISDIR}\Contrib\Icons\${ICON}"
|
!ifndef MUI_ICONPATH
|
||||||
UninstallIcon "${NSISDIR}\Contrib\Icons\${UNICON}"
|
!define MUI_ICONPATH "${NSISDIR}\Contrib\Icons\"
|
||||||
XPStyle On
|
!endif
|
||||||
ChangeUI all "${NSISDIR}\Contrib\UIs\${UI}"
|
|
||||||
SetFont "${FONT}" 8
|
|
||||||
CheckBitmap "${NSISDIR}\Contrib\Icons\${CHECKS}"
|
|
||||||
InstallColors /windows
|
|
||||||
InstProgressFlags "${PROGRESSBAR}"
|
|
||||||
BrandingText /TRIMRIGHT
|
|
||||||
!define CURRENTPAGE ${CURRENTPAGEVAR}
|
|
||||||
|
|
||||||
!macroend
|
|
||||||
|
|
||||||
!macro MUI_INTERFACE_ABSOLUTEPATH UI ICON UNICON CHECKS PROGRESSBAR FONT CURRENTPAGEVAR
|
|
||||||
|
|
||||||
;User interface
|
|
||||||
|
|
||||||
Icon "${ICON}"
|
!ifndef MUI_UIPATH
|
||||||
UninstallIcon "${UNICON}"
|
!define MUI_UIPATH "${NSISDIR}\Contrib\UIs\"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Icon "${MUI_ICONPATH}${ICON}"
|
||||||
|
UninstallIcon "${MUI_ICONPATH}${UNICON}"
|
||||||
XPStyle On
|
XPStyle On
|
||||||
ChangeUI all "${UI}"
|
ChangeUI all "${MUI_UIPATH}${UI}"
|
||||||
SetFont "${FONT}" 8
|
SetFont "${FONT}" 8
|
||||||
CheckBitmap "${CHECKS}"
|
CheckBitmap "${MUI_ICONPATH}${CHECKS}"
|
||||||
InstallColors /windows
|
InstallColors /windows
|
||||||
InstProgressFlags "${PROGRESSBAR}"
|
InstProgressFlags "${PROGRESSBAR}"
|
||||||
BrandingText /TRIMRIGHT
|
BrandingText /TRIMRIGHT
|
||||||
|
@ -52,12 +43,31 @@
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
!macro MUI_FINISHHEADER CALL
|
!macro MUI_FINISHHEADER
|
||||||
|
|
||||||
;Finish text on the header (white rectangle)
|
;Finish text on the header (white rectangle)
|
||||||
|
|
||||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||||
Call ${CALL}
|
|
||||||
|
!ifndef MUI_SETPAGE_FUNCTIONNAME
|
||||||
|
!error "Modern UI Error: SetPage function name (MUI_SETPAGE_FUNCTIONNAME) not defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Call "${MUI_SETPAGE_FUNCTIONNAME}"
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_UNFINISHHEADER
|
||||||
|
|
||||||
|
;Finish text on the header (white rectangle)
|
||||||
|
|
||||||
|
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||||
|
|
||||||
|
!ifndef MUI_UNSETPAGE_FUNCTIONNAME
|
||||||
|
!error "Modern UI Error: Uninstall SetPage function name (MUI_UNSETPAGE_FUNCTIONNAME) not defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Call "${MUI_UNSETPAGE_FUNCTIONNAME}"
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
@ -97,7 +107,7 @@
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
!macro MUI_NEXTPAGE CALL
|
!macro MUI_NEXTPAGE
|
||||||
|
|
||||||
;Set backgrounds & fonts for the outer dialog (only once)
|
;Set backgrounds & fonts for the outer dialog (only once)
|
||||||
StrCmp ${CURRENTPAGE} "" "" no_first_run
|
StrCmp ${CURRENTPAGE} "" "" no_first_run
|
||||||
|
@ -126,15 +136,72 @@
|
||||||
|
|
||||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||||
|
|
||||||
Call "${CALL}"
|
!ifndef MUI_SETPAGE_FUNCTIONNAME
|
||||||
|
!error "Modern UI Error: SetPage function name (MUI_SETPAGE_FUNCTIONNAME) not defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Call "${MUI_SETPAGE_FUNCTIONNAME}"
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
!macro MUI_PREVPAGE CALL
|
!macro MUI_UNNEXTPAGE
|
||||||
|
|
||||||
|
;Set backgrounds & fonts for the outer dialog (only once)
|
||||||
|
StrCmp ${CURRENTPAGE} "" "" no_first_run
|
||||||
|
|
||||||
|
Push ${MUI_TEMP1}
|
||||||
|
Push ${MUI_TEMP2}
|
||||||
|
|
||||||
|
GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1037
|
||||||
|
CreateFont ${MUI_TEMP2} "Tahoma" 10 700
|
||||||
|
SendMessage ${MUI_TEMP1} ${WM_SETFONT} ${MUI_TEMP2} 0
|
||||||
|
SetStaticBkColor ${MUI_TEMP1} 0x00FFFFFF
|
||||||
|
|
||||||
|
GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1038
|
||||||
|
SetStaticBkColor ${MUI_TEMP1} 0x00FFFFFF
|
||||||
|
|
||||||
|
GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1034
|
||||||
|
SetStaticBkColor ${MUI_TEMP1} 0x00FFFFFF
|
||||||
|
|
||||||
|
GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1039
|
||||||
|
SetStaticBkColor ${MUI_TEMP1} 0x00FFFFFF
|
||||||
|
|
||||||
|
Pop ${MUI_TEMP2}
|
||||||
|
Pop ${MUI_TEMP1}
|
||||||
|
|
||||||
|
no_first_run:
|
||||||
|
|
||||||
|
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||||
|
|
||||||
|
!ifndef MUI_UNSETPAGE_FUNCTIONNAME
|
||||||
|
!error "Modern UI Error: Uninstall SetPage function name (MUI_UNSETPAGE_FUNCTIONNAME) not defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Call "${MUI_UNSETPAGE_FUNCTIONNAME}"
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_PREVPAGE
|
||||||
|
|
||||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} - 1
|
IntOp ${CURRENTPAGE} ${CURRENTPAGE} - 1
|
||||||
|
|
||||||
Call "${CALL}"
|
!ifndef MUI_SETPAGE_FUNCTIONNAME
|
||||||
|
!error "Modern UI Error: SetPage function name (MUI_SETPAGE_FUNCTIONNAME) not defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Call "${MUI_SETPAGE_FUNCTIONNAME}"
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_UNPREVPAGE
|
||||||
|
|
||||||
|
IntOp ${CURRENTPAGE} ${CURRENTPAGE} - 1
|
||||||
|
|
||||||
|
!ifndef MUI_UNSETPAGE_FUNCTIONNAME
|
||||||
|
!error "Modern UI Error: Uninstall SetPage function name (MUI_UNSETPAGE_FUNCTIONNAME) not defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Call "${MUI_UNSETPAGE_FUNCTIONNAME}"
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
@ -211,6 +278,7 @@
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
;INSTALL OPTIONS
|
;INSTALL OPTIONS
|
||||||
|
|
||||||
!macro MUI_INSTALLOPTIONS DIRECTIONVAR NOSETDIRECTIONVAR
|
!macro MUI_INSTALLOPTIONS DIRECTIONVAR NOSETDIRECTIONVAR
|
||||||
|
@ -378,17 +446,24 @@
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
;BASIC FUNCTIONS
|
;BASIC FUNCTIONS
|
||||||
|
|
||||||
|
!macro MUI_BASICFUNCTIONS_INIT
|
||||||
|
|
||||||
|
!define MUI_SETPAGE_FUNCTIONNAME "SetPage"
|
||||||
|
!define MUI_UNSETPAGE_FUNCTIONNAME "un.SetPage"
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
!macro MUI_BASICFUNCTIONS
|
!macro MUI_BASICFUNCTIONS
|
||||||
|
|
||||||
Function .onNextPage
|
Function .onNextPage
|
||||||
!insertmacro MUI_NEXTPAGE SetPage
|
!insertmacro MUI_NEXTPAGE
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function .onPrevPage
|
Function .onPrevPage
|
||||||
!insertmacro MUI_PREVPAGE SetPage
|
!insertmacro MUI_PREVPAGE
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function .onInitDialog
|
Function .onInitDialog
|
||||||
|
@ -494,7 +569,7 @@ FunctionEnd
|
||||||
|
|
||||||
Function un.onNextPage
|
Function un.onNextPage
|
||||||
|
|
||||||
!insertmacro MUI_NEXTPAGE un.SetPage
|
!insertmacro MUI_UNNEXTPAGE
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Configuration
|
;Configuration
|
||||||
|
|
||||||
|
!insertmacro MUI_BASICFUNCTIONS_INIT
|
||||||
|
|
||||||
!define MUI_LICENSEPAGE
|
!define MUI_LICENSEPAGE
|
||||||
!define MUI_COMPONENTPAGE
|
!define MUI_COMPONENTPAGE
|
||||||
!define MUI_DIRSELECTPAGE
|
!define MUI_DIRSELECTPAGE
|
||||||
|
@ -57,7 +59,7 @@ SectionEnd
|
||||||
Section ""
|
Section ""
|
||||||
|
|
||||||
;Invisible section to display the Finish header
|
;Invisible section to display the Finish header
|
||||||
!insertmacro MUI_FINISHHEADER SetPage
|
!insertmacro MUI_FINISHHEADER
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
@ -85,7 +87,7 @@ Section "Uninstall"
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
;Display the Finish header
|
;Display the Finish header
|
||||||
!insertmacro MUI_FINISHHEADER un.SetPage
|
!insertmacro MUI_UNFINISHHEADER
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
!define MUI_INSTALLBUTTONTEXT_NEXT
|
!define MUI_INSTALLBUTTONTEXT_NEXT
|
||||||
!define MUI_ABORTWARNING
|
!define MUI_ABORTWARNING
|
||||||
!define MUI_UNINSTALLER
|
!define MUI_UNINSTALLER
|
||||||
|
|
||||||
|
!define MUI_SETPAGE_FUNCTIONNAME "SetPage"
|
||||||
|
!define MUI_UNSETPAGE_FUNCTIONNAME "un.SetPage"
|
||||||
|
|
||||||
;Language
|
;Language
|
||||||
;English
|
;English
|
||||||
|
@ -88,7 +91,7 @@ SectionEnd
|
||||||
Section ""
|
Section ""
|
||||||
|
|
||||||
;Invisible section to display the Finish header
|
;Invisible section to display the Finish header
|
||||||
!insertmacro MUI_FINISHHEADER SetPage
|
!insertmacro MUI_FINISHHEADER
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
@ -119,14 +122,14 @@ FunctionEnd
|
||||||
Function .onNextPage
|
Function .onNextPage
|
||||||
|
|
||||||
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
|
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
|
||||||
!insertmacro MUI_NEXTPAGE SetPage
|
!insertmacro MUI_NEXTPAGE
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function .onPrevPage
|
Function .onPrevPage
|
||||||
|
|
||||||
!insertmacro MUI_INSTALLOPTIONS_PREVPAGE
|
!insertmacro MUI_INSTALLOPTIONS_PREVPAGE
|
||||||
!insertmacro MUI_PREVPAGE SetPage
|
!insertmacro MUI_PREVPAGE
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
@ -220,7 +223,7 @@ Section "Uninstall"
|
||||||
|
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
!insertmacro MUI_FINISHHEADER un.SetPage
|
!insertmacro MUI_UNFINISHHEADER
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
@ -228,8 +231,10 @@ SectionEnd
|
||||||
;Uninstaller Functions
|
;Uninstaller Functions
|
||||||
|
|
||||||
Function un.onNextPage
|
Function un.onNextPage
|
||||||
|
|
||||||
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
|
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
|
||||||
!insertmacro MUI_NEXTPAGE un.SetPage
|
!insertmacro MUI_UNNEXTPAGE
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function un.SetPage
|
Function un.SetPage
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Configuration
|
;Configuration
|
||||||
|
|
||||||
|
!insertmacro MUI_BASICFUNCTIONS_INIT
|
||||||
|
|
||||||
!define MUI_LICENSEPAGE
|
!define MUI_LICENSEPAGE
|
||||||
!define MUI_COMPONENTPAGE
|
!define MUI_COMPONENTPAGE
|
||||||
!define MUI_DIRSELECTPAGE
|
!define MUI_DIRSELECTPAGE
|
||||||
|
@ -142,7 +144,7 @@ Section ""
|
||||||
;Invisible section to display the Finish header & write the language to the registry
|
;Invisible section to display the Finish header & write the language to the registry
|
||||||
|
|
||||||
WriteRegStr HKCU "Software\${NAME}" "Installer Language" $LANGUAGE
|
WriteRegStr HKCU "Software\${NAME}" "Installer Language" $LANGUAGE
|
||||||
!insertmacro MUI_FINISHHEADER SetPage
|
!insertmacro MUI_FINISHHEADER
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
@ -212,7 +214,7 @@ Section "Uninstall"
|
||||||
DeleteRegValue HKCU "Software\${NAME}" "Installer Language"
|
DeleteRegValue HKCU "Software\${NAME}" "Installer Language"
|
||||||
|
|
||||||
;Display the Finish header
|
;Display the Finish header
|
||||||
!insertmacro MUI_FINISHHEADER un.SetPage
|
!insertmacro MUI_UNFINISHHEADER
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue