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:
joostverburg 2002-10-26 12:25:02 +00:00
parent 278b2c6bb6
commit 9585e78fcf
5 changed files with 127 additions and 40 deletions

View file

@ -126,12 +126,15 @@ table
file and recompile NSIS.</p>
<p class="header">Version history</p>
<ul>
<li class="text">1.3 - October 18, 2002
<li class="text">1.3 - October 26, 2002
<ul>
<li>Easier macro system for basic scripts
<li>New MultiLanguage system using Modern UI Language Files
<li>New directory structure (header/language files in Contrib\Modern UI)
<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>
<li class="text">1.21 - September 30, 2002
<ul>

View file

@ -22,29 +22,20 @@
;User interface
Icon "${NSISDIR}\Contrib\Icons\${ICON}"
UninstallIcon "${NSISDIR}\Contrib\Icons\${UNICON}"
XPStyle On
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
!ifndef MUI_ICONPATH
!define MUI_ICONPATH "${NSISDIR}\Contrib\Icons\"
!endif
Icon "${ICON}"
UninstallIcon "${UNICON}"
!ifndef MUI_UIPATH
!define MUI_UIPATH "${NSISDIR}\Contrib\UIs\"
!endif
Icon "${MUI_ICONPATH}${ICON}"
UninstallIcon "${MUI_ICONPATH}${UNICON}"
XPStyle On
ChangeUI all "${UI}"
ChangeUI all "${MUI_UIPATH}${UI}"
SetFont "${FONT}" 8
CheckBitmap "${CHECKS}"
CheckBitmap "${MUI_ICONPATH}${CHECKS}"
InstallColors /windows
InstProgressFlags "${PROGRESSBAR}"
BrandingText /TRIMRIGHT
@ -52,12 +43,31 @@
!macroend
!macro MUI_FINISHHEADER CALL
!macro MUI_FINISHHEADER
;Finish text on the header (white rectangle)
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
@ -97,7 +107,7 @@
!macroend
!macro MUI_NEXTPAGE CALL
!macro MUI_NEXTPAGE
;Set backgrounds & fonts for the outer dialog (only once)
StrCmp ${CURRENTPAGE} "" "" no_first_run
@ -126,15 +136,72 @@
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_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
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
@ -211,6 +278,7 @@
!macroend
;--------------------------------
;INSTALL OPTIONS
!macro MUI_INSTALLOPTIONS DIRECTIONVAR NOSETDIRECTIONVAR
@ -378,17 +446,24 @@
!macroend
;--------------------------------
;BASIC FUNCTIONS
!macro MUI_BASICFUNCTIONS_INIT
!define MUI_SETPAGE_FUNCTIONNAME "SetPage"
!define MUI_UNSETPAGE_FUNCTIONNAME "un.SetPage"
!macroend
!macro MUI_BASICFUNCTIONS
Function .onNextPage
!insertmacro MUI_NEXTPAGE SetPage
!insertmacro MUI_NEXTPAGE
FunctionEnd
Function .onPrevPage
!insertmacro MUI_PREVPAGE SetPage
!insertmacro MUI_PREVPAGE
FunctionEnd
Function .onInitDialog
@ -494,7 +569,7 @@ FunctionEnd
Function un.onNextPage
!insertmacro MUI_NEXTPAGE un.SetPage
!insertmacro MUI_UNNEXTPAGE
FunctionEnd

View file

@ -12,6 +12,8 @@
;--------------------------------
;Configuration
!insertmacro MUI_BASICFUNCTIONS_INIT
!define MUI_LICENSEPAGE
!define MUI_COMPONENTPAGE
!define MUI_DIRSELECTPAGE
@ -57,7 +59,7 @@ SectionEnd
Section ""
;Invisible section to display the Finish header
!insertmacro MUI_FINISHHEADER SetPage
!insertmacro MUI_FINISHHEADER
SectionEnd
@ -85,7 +87,7 @@ Section "Uninstall"
RMDir "$INSTDIR"
;Display the Finish header
!insertmacro MUI_FINISHHEADER un.SetPage
!insertmacro MUI_UNFINISHHEADER
SectionEnd

View file

@ -20,6 +20,9 @@
!define MUI_INSTALLBUTTONTEXT_NEXT
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_SETPAGE_FUNCTIONNAME "SetPage"
!define MUI_UNSETPAGE_FUNCTIONNAME "un.SetPage"
;Language
;English
@ -88,7 +91,7 @@ SectionEnd
Section ""
;Invisible section to display the Finish header
!insertmacro MUI_FINISHHEADER SetPage
!insertmacro MUI_FINISHHEADER
SectionEnd
@ -119,14 +122,14 @@ FunctionEnd
Function .onNextPage
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
!insertmacro MUI_NEXTPAGE SetPage
!insertmacro MUI_NEXTPAGE
FunctionEnd
Function .onPrevPage
!insertmacro MUI_INSTALLOPTIONS_PREVPAGE
!insertmacro MUI_PREVPAGE SetPage
!insertmacro MUI_PREVPAGE
FunctionEnd
@ -220,7 +223,7 @@ Section "Uninstall"
RMDir "$INSTDIR"
!insertmacro MUI_FINISHHEADER un.SetPage
!insertmacro MUI_UNFINISHHEADER
SectionEnd
@ -228,8 +231,10 @@ SectionEnd
;Uninstaller Functions
Function un.onNextPage
!insertmacro MUI_INSTALLOPTIONS_NEXTPAGE
!insertmacro MUI_NEXTPAGE un.SetPage
!insertmacro MUI_UNNEXTPAGE
FunctionEnd
Function un.SetPage

View file

@ -12,6 +12,8 @@
;--------------------------------
;Configuration
!insertmacro MUI_BASICFUNCTIONS_INIT
!define MUI_LICENSEPAGE
!define MUI_COMPONENTPAGE
!define MUI_DIRSELECTPAGE
@ -142,7 +144,7 @@ Section ""
;Invisible section to display the Finish header & write the language to the registry
WriteRegStr HKCU "Software\${NAME}" "Installer Language" $LANGUAGE
!insertmacro MUI_FINISHHEADER SetPage
!insertmacro MUI_FINISHHEADER
SectionEnd
@ -212,7 +214,7 @@ Section "Uninstall"
DeleteRegValue HKCU "Software\${NAME}" "Installer Language"
;Display the Finish header
!insertmacro MUI_FINISHHEADER un.SetPage
!insertmacro MUI_UNFINISHHEADER
SectionEnd