From 3520ee2e4fd89aba6e762421a2c26fd38769fd70 Mon Sep 17 00:00:00 2001 From: joostverburg Date: Fri, 5 Sep 2003 15:16:15 +0000 Subject: [PATCH] page commands git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2842 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/UserVars.nsi | 10 +++++- Examples/bigtest.nsi | 22 ++++++++---- Examples/example1.nsi | 8 +++-- Examples/example2.nsi | 33 ++++++++++-------- Examples/gfx.nsi | 8 +++-- Examples/makensis.nsi | 75 ++++++++++++++++++---------------------- Examples/one-section.nsi | 2 +- Examples/primes.nsi | 10 +++++- Examples/rtest.nsi | 1 - Examples/waplugin.nsi | 7 ++++ 10 files changed, 105 insertions(+), 71 deletions(-) diff --git a/Examples/UserVars.nsi b/Examples/UserVars.nsi index 401b65ad..5aa0a9ab 100644 --- a/Examples/UserVars.nsi +++ b/Examples/UserVars.nsi @@ -8,7 +8,15 @@ OutFile "UserVars.exe" InstallDir "$PROGRAMFILES\User Variables Test" - DirText "Choose a folder to install in which to install the test:" " " + +;-------------------------------- + + ;Pages + Page directory + Page instfiles + + UninstPage uninstConfirm + UninstPage instfiles ;-------------------------------- ; Declaration of user variables (Var command), allowed charaters for variables names : [a-z][A-Z][0-9] and '_' diff --git a/Examples/bigtest.nsi b/Examples/bigtest.nsi index 189d0c6c..fc0e32f4 100644 --- a/Examples/bigtest.nsi +++ b/Examples/bigtest.nsi @@ -27,15 +27,25 @@ BGGradient 000000 800000 FFFFFF InstallColors FF8080 000030 XPStyle on -LicenseText "A license text, make sure it's all there" +InstallDir "$PROGRAMFILES\NSISCrap\BigNSISTest" +InstallDirRegKey HKLM "Software\NSISCrap\BigNSISTest" "" + +CheckBitmap ..\contrib\Icons\checksX.bmp + +LicenseText "A test text, make sure it's all there" LicenseData "..\source\exehead\main.c" -InstallDir "$PROGRAMFILES\NSISCrap\BigNSISTest" -InstallDirRegKey HKLM SOFTWARE\NSISCrap\BigNSISTest "Install_Dir" -DirText "Choose a directory to install in to:" +;-------------------------------- -ComponentText "This will install the test on your computer. Select which optional things you want installed." -CheckBitmap ..\contrib\Icons\checksX.bmp +Page license +Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +;-------------------------------- !ifndef NOINSTTYPES ; only if not defined InstType "Most" diff --git a/Examples/example1.nsi b/Examples/example1.nsi index fb5378db..fadc1224 100644 --- a/Examples/example1.nsi +++ b/Examples/example1.nsi @@ -16,8 +16,12 @@ OutFile "example1.exe" ; The default installation directory InstallDir $PROGRAMFILES\Example1 -; The text to prompt the user to enter a directory -DirText "This will install the very simple example1 on your computer. Choose a directory" +;-------------------------------- + +; Pages + +Page directory +Page instfiles ;-------------------------------- diff --git a/Examples/example2.nsi b/Examples/example2.nsi index cc4d4214..12512171 100644 --- a/Examples/example2.nsi +++ b/Examples/example2.nsi @@ -18,13 +18,18 @@ InstallDir $PROGRAMFILES\Example2 ; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) -InstallDirRegKey HKLM SOFTWARE\NSIS_Example2 "Install_Dir" +InstallDirRegKey HKLM "Software\NSIS_Example2" "" -; The text to prompt the user to enter a directory -ComponentText "This will install the less simple example2 on your computer. Select which optional things you want installed." +;-------------------------------- -; The text to prompt the user to enter a directory -DirText "Choose a directory to install in to:" +; Pages + +Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles ;-------------------------------- @@ -43,13 +48,15 @@ Section "Example2 (required)" WriteRegStr HKLM SOFTWARE\NSIS_Example2 "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "DisplayName" "NSIS Example2 (remove only)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "DisplayName" "NSIS Example2" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "NoRepair" 1 WriteUninstaller "uninstall.exe" SectionEnd -; optional section (can be disabled by the user) +; Optional section (can be disabled by the user) Section "Start Menu Shortcuts" CreateDirectory "$SMPROGRAMS\Example2" @@ -62,24 +69,20 @@ SectionEnd ; Uninstaller -UninstallText "This will uninstall example2. Hit next to continue." - -; Uninstall section - Section "Uninstall" - ; remove registry keys + ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" DeleteRegKey HKLM SOFTWARE\NSIS_Example2 - ; remove files and uninstaller + ; Remove files and uninstaller Delete $INSTDIR\makensisw.exe Delete $INSTDIR\uninstall.exe - ; remove shortcuts, if any + ; Remove shortcuts, if any Delete "$SMPROGRAMS\Example2\*.*" - ; remove directories used + ; Remove directories used RMDir "$SMPROGRAMS\Example2" RMDir "$INSTDIR" diff --git a/Examples/gfx.nsi b/Examples/gfx.nsi index c5274284..fbb11b77 100644 --- a/Examples/gfx.nsi +++ b/Examples/gfx.nsi @@ -41,15 +41,17 @@ LicenseText "License page" LicenseData "gfx.nsi" DirText "Lets make a third page!" +; Install dir +InstallDir "${NSISDIR}\Examples" + +;-------------------------------- + ; Pages Page license licenseImage Page custom customPage Page directory dirImage Page instfiles instImage -; Install dir -InstallDir "${NSISDIR}\Examples" - ;-------------------------------- Section "" diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi index b5977094..f6ecf4dc 100644 --- a/Examples/makensis.nsi +++ b/Examples/makensis.nsi @@ -27,51 +27,48 @@ InstallDir $PROGRAMFILES\NSIS InstallDirRegKey HKLM SOFTWARE\NSIS "" ;-------------------------------- -!ifndef CLASSIC_UI - ;Include Modern UI - !include "MUI.nsh" +;Include Modern UI +!include "MUI.nsh" - ;-------------------------------- - ;Modern UI Configuration +;-------------------------------- +;Modern UI Configuration - ;Names - !define MUI_PRODUCT "NSIS" - !define MUI_VERSION "${VER_MAJOR}.${VER_MINOR} (CVS)" +;Names +!define MUI_PRODUCT "NSIS" +!define MUI_VERSION "${VER_MAJOR}.${VER_MINOR} (CVS)" - !define MUI_NAME "Nullsoft Install System ${MUI_VERSION}" +!define MUI_NAME "Nullsoft Install System ${MUI_VERSION}" - ;Pages - !insertmacro MUI_PAGE_WELCOME - !insertmacro MUI_PAGE_LICENSE "..\license.txt" - !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - !insertmacro MUI_PAGE_INSTFILES - - !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Docs\index.html" - !define MUI_FINISHPAGE_NOREBOOTSUPPORT - - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - - ;Settings - !define MUI_ABORTWARNING - - !define MUI_HEADERBITMAP "${NSISDIR}\Contrib\Icons\modern-header.bmp" - !define MUI_SPECIALBITMAP "${NSISDIR}\Contrib\Icons\modern-wizard nsis llama.bmp" +;Pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "..\license.txt" +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES - !define MUI_COMPONENTSPAGE_SMALLDESC - - ;-------------------------------- - ;Languages +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Docs\index.html" +!define MUI_FINISHPAGE_NOREBOOTSUPPORT - !define MUI_TEXT_WELCOME_INFO_TEXT "This wizard will guide you through the installation of NSIS, a scriptable win32 installer/uninstaller system that doesn't suck and isn't huge.\r\n\r\n\r\n" +!insertmacro MUI_PAGE_FINISH - !insertmacro MUI_LANGUAGE "English" - -!endif +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +;Settings +!define MUI_ABORTWARNING + +!define MUI_HEADERBITMAP "${NSISDIR}\Contrib\Icons\modern-header.bmp" +!define MUI_SPECIALBITMAP "${NSISDIR}\Contrib\Icons\modern-wizard nsis llama.bmp" + +!define MUI_COMPONENTSPAGE_SMALLDESC + +;-------------------------------- +;Languages + +!define MUI_TEXT_WELCOME_INFO_TEXT "This wizard will guide you through the installation of NSIS, a scriptable win32 installer/uninstaller system that doesn't suck and isn't huge.\r\n\r\n\r\n" + +!insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections @@ -1045,8 +1042,6 @@ SectionEnd ;-------------------------------- ;Descriptions -!ifndef CLASSIC_UI - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use NSIS (compiler etc.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} "Example installation scripts that show you how to use NSIS" @@ -1098,8 +1093,6 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecSrcEx} "Example DLL plugin source in C and plugin function header" !insertmacro MUI_DESCRIPTION_TEXT ${SecSrcMNW} "Source code to MakeNSIS Wrapper" !insertmacro MUI_FUNCTION_DESCRIPTION_END - -!endif ;-------------------------------- ;Installer Functions diff --git a/Examples/one-section.nsi b/Examples/one-section.nsi index b59ee397..39da8738 100644 --- a/Examples/one-section.nsi +++ b/Examples/one-section.nsi @@ -9,7 +9,7 @@ Name example OutFile one-section.exe -ComponentText "please choose just one but the default" +Page components # defines SF_*, SECTION_OFF and some macros !include Sections.nsh diff --git a/Examples/primes.nsi b/Examples/primes.nsi index 6d48ff5d..8fad8d4f 100644 --- a/Examples/primes.nsi +++ b/Examples/primes.nsi @@ -12,7 +12,15 @@ Caption "Prime number generator" ShowInstDetails show AllowRootDirInstall true InstallDir "$EXEDIR" -DirText "Select directory to write primes.txt" + +DirText "Select a directory to write primes.txt. $_CLICK" + +;-------------------------------- + +;Pages + +Page directory +Page instfiles ;-------------------------------- diff --git a/Examples/rtest.nsi b/Examples/rtest.nsi index 77a0eae1..74bfe197 100644 --- a/Examples/rtest.nsi +++ b/Examples/rtest.nsi @@ -7,7 +7,6 @@ Name "rtest" OutFile "rtest.exe" -DirShow hide ComponentText "Select tests!" ShowInstDetails show diff --git a/Examples/waplugin.nsi b/Examples/waplugin.nsi index 4cf3a3ec..4d6a40a7 100644 --- a/Examples/waplugin.nsi +++ b/Examples/waplugin.nsi @@ -37,6 +37,13 @@ ShowInstDetails nevershow ;-------------------------------- +;Pages + +Page directory +Page instfiles + +;-------------------------------- + ; The stuff to install Section ""