From 065fef6710617824724b6110edd9abfde5f1b7da Mon Sep 17 00:00:00 2001 From: joostverburg Date: Wed, 25 Sep 2002 18:46:36 +0000 Subject: [PATCH] temp vars defined by header file, currentpage & io vars should be set using macro parameters git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1186 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/Modern UI/Example.nsi | 12 +++--------- Examples/Modern UI/InstallOptions.nsi | 15 ++++----------- Examples/Modern UI/ModernUI.nsh | 17 +++++++++++++++-- Examples/Modern UI/MultiLanguage.nsi | 16 +++++----------- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/Examples/Modern UI/Example.nsi b/Examples/Modern UI/Example.nsi index e4ea53b5..ac4d3953 100644 --- a/Examples/Modern UI/Example.nsi +++ b/Examples/Modern UI/Example.nsi @@ -1,4 +1,4 @@ -;NSIS Modern Style UI version 1.20 +;NSIS Modern Style UI version 1.20b ;Example Script ;Written by Joost Verburg @@ -6,15 +6,9 @@ !define VERSION "1.0" ;Define your own software version here !verbose 3 -!include "${NSISDIR}\Examples\WinMessages.nsh" -!include "ModernUI.nsh" + !include "ModernUI.nsh" !verbose 4 -!define CURRENTPAGE $9 - -!define TEMP1 $R0 -!define TEMP2 $R1 - ;-------------------------------- ;Configuration @@ -24,7 +18,7 @@ SetOverwrite on ;User interface - !insertmacro MUI_INTERFACE "modern.exe" "adni18-installer-C-no48xp.ico" "adni18-uninstall-C-no48xp.ico" "modern.bmp" "smooth" + !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! ;License dialog LicenseText "Press Page Down to see the rest of the agreement." diff --git a/Examples/Modern UI/InstallOptions.nsi b/Examples/Modern UI/InstallOptions.nsi index 5a24aa04..c318d200 100644 --- a/Examples/Modern UI/InstallOptions.nsi +++ b/Examples/Modern UI/InstallOptions.nsi @@ -1,4 +1,4 @@ -;NSIS Modern Style UI version 1.20 +;NSIS Modern Style UI version 1.20b ;InstallOptions Example Script ;Written by Joost Verburg @@ -6,17 +6,9 @@ !define VERSION "1.0" ;Define your own software version here !verbose 3 -!include "${NSISDIR}\Examples\WinMessages.nsh" -!include "ModernUI.nsh" + !include "ModernUI.nsh" !verbose 4 -!define IO_NOSETDIRECTION $7 -!define IO_DIRECTION $8 -!define CURRENTPAGE $9 - -!define TEMP1 $R0 -!define TEMP2 $R1 - ;-------------------------------- ;Configuration @@ -26,7 +18,8 @@ SetOverwrite on ;User interface - !insertmacro MUI_INTERFACE "modern.exe" "adni18-installer-C-no48xp.ico" "adni18-uninstall-C-no48xp.ico" "modern.bmp" "smooth" + !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 ;License dialog LicenseText "Press Page Down to see the rest of the agreement." diff --git a/Examples/Modern UI/ModernUI.nsh b/Examples/Modern UI/ModernUI.nsh index 8e8fd7c1..51c5c162 100644 --- a/Examples/Modern UI/ModernUI.nsh +++ b/Examples/Modern UI/ModernUI.nsh @@ -1,4 +1,4 @@ -;Modern UI Header File version 1.20 +;Modern UI Header File version 1.20b ;Written by Joost Verburg ;See Example.nsi & Multilanguage.nsi for an example of usage @@ -7,13 +7,18 @@ !define MUI_MACROS_USED +!include "${NSISDIR}\Examples\WinMessages.nsh" + !define IO_DIRECTION_NEXT 1 !define IO_DIRECTION_PREV 2 !define IO_INITPLUGINS "Call Initialize_____Plugins" !define IO_UNINITPLUGINS "Call un.Initialize_____Plugins" -!macro MUI_INTERFACE UI ICON UNICON CHECKS PROGRESSBAR +!define TEMP1 $R0 +!define TEMP2 $R1 + +!macro MUI_INTERFACE UI ICON UNICON CHECKS PROGRESSBAR CURRENTPAGEVAR ;User interface @@ -26,6 +31,7 @@ InstallColors /windows InstProgressFlags "${PROGRESSBAR}" BrandingText /TRIMRIGHT + !define CURRENTPAGE ${CURRENTPAGEVAR} !macroend @@ -199,6 +205,13 @@ ;INSTALL OPTIONS +!macro MUI_INSTALLOPTIONS DIRECTIONVAR NOSETDIRECTIONVAR + + !define IO_NOSETDIRECTION ${DIRECTIONVAR} + !define IO_DIRECTION ${NOSETDIRECTIONVAR} + +!macroend + !macro MUI_INSTALLOPTIONS_EXTRACT FILE ;Init plugin system diff --git a/Examples/Modern UI/MultiLanguage.nsi b/Examples/Modern UI/MultiLanguage.nsi index c3bd8212..2c117554 100644 --- a/Examples/Modern UI/MultiLanguage.nsi +++ b/Examples/Modern UI/MultiLanguage.nsi @@ -6,15 +6,9 @@ !define VERSION "1.0" ;Define your own software version here !verbose 3 -!include "${NSISDIR}\Examples\WinMessages.nsh" -!include "ModernUI.nsh" + !include "ModernUI.nsh" !verbose 4 -!define CURRENTPAGE $9 - -!define TEMP1 $R0 -!define TEMP2 $R1 - ;-------------------------------- ;Configuration @@ -29,7 +23,7 @@ SetOverwrite on ;User interface - !insertmacro MUI_INTERFACE "modern.exe" "adni18-installer-C-no48xp.ico" "adni18-uninstall-C-no48xp.ico" "modern.bmp" "smooth" + !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! ;License dialog LicenseText /LANG=1033 "Press Page Down to see the rest of the agreement." @@ -67,6 +61,9 @@ SectionEnd Section "Create uninstaller" SecCreateUninst + ;Write the language to the registry (for the uninstaller) + WriteRegStr HKCU "Software\${NAME}" "Installer Language" "$LANGUAGE" + ;Add your stuff here WriteUninstaller "$INSTDIR\Uninstall.exe" @@ -91,9 +88,6 @@ Function .onInit StrCmp $LANGUAGE "cancel" 0 +2 Abort - ;Write the language to the registry (for the uninstaller) - WriteRegStr HKCU "Software\${NAME}" "Installer Language" "$LANGUAGE" - StrCmp $LANGUAGE 1043 "" +2 SectionSetText ${SecCreateUninst} "Deïnstallatie programma"