From 34112ed24b8b7dee45025166d0479a2bf58bd99b Mon Sep 17 00:00:00 2001 From: joostverburg Date: Sun, 27 Jan 2008 17:24:40 +0000 Subject: [PATCH] * use Modern UI 2 * Windows Vista UAC setting git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5494 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/Modern UI/Basic.nsi | 4 +- Examples/Modern UI/HeaderBitmap.nsi | 4 +- Examples/Modern UI/InstallOptions.nsi | 150 -------------------------- Examples/Modern UI/MultiLanguage.nsi | 4 +- Examples/Modern UI/StartMenu.nsi | 32 ++---- Examples/Modern UI/WelcomeFinish.nsi | 2 +- Examples/Modern UI/ioA.ini | 19 ---- Examples/Modern UI/ioB.ini | 10 -- Examples/Modern UI/ioC.ini | 19 ---- 9 files changed, 19 insertions(+), 225 deletions(-) delete mode 100644 Examples/Modern UI/InstallOptions.nsi delete mode 100644 Examples/Modern UI/ioA.ini delete mode 100644 Examples/Modern UI/ioB.ini delete mode 100644 Examples/Modern UI/ioC.ini diff --git a/Examples/Modern UI/Basic.nsi b/Examples/Modern UI/Basic.nsi index 6d970964..99507914 100644 --- a/Examples/Modern UI/Basic.nsi +++ b/Examples/Modern UI/Basic.nsi @@ -5,7 +5,7 @@ ;-------------------------------- ;Include Modern UI - !include "MUI.nsh" + !include "MUI2.nsh" ;-------------------------------- ;General @@ -20,6 +20,8 @@ ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Modern UI Test" "" + RequestExecutionLevel user + ;-------------------------------- ;Interface Settings diff --git a/Examples/Modern UI/HeaderBitmap.nsi b/Examples/Modern UI/HeaderBitmap.nsi index 80702014..d3b42fbb 100644 --- a/Examples/Modern UI/HeaderBitmap.nsi +++ b/Examples/Modern UI/HeaderBitmap.nsi @@ -5,7 +5,7 @@ ;-------------------------------- ;Include Modern UI - !include "MUI.nsh" + !include "MUI2.nsh" ;-------------------------------- ;General @@ -20,6 +20,8 @@ ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Modern UI Test" "" + RequestExecutionLevel user + ;-------------------------------- ;Interface Configuration diff --git a/Examples/Modern UI/InstallOptions.nsi b/Examples/Modern UI/InstallOptions.nsi deleted file mode 100644 index dddf7c69..00000000 --- a/Examples/Modern UI/InstallOptions.nsi +++ /dev/null @@ -1,150 +0,0 @@ -;NSIS Modern User Interface -;InstallOptions Example Script -;Written by Joost Verburg - -;--------------------- -;Header files - - !include "MUI.nsh" - !include "InstallOptions.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "Modern UI Test" - OutFile "InstallOptions.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES\Modern UI Test" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\Modern UI Test" "" - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" - Page custom CustomPageA - !insertmacro MUI_PAGE_COMPONENTS - Page custom CustomPageB - !insertmacro MUI_PAGE_DIRECTORY - Page custom CustomPageC - !insertmacro MUI_PAGE_INSTFILES - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Reserve Files - - ;If you are using solid compression, files that are required before - ;the actual installation should be stored first in the data block, - ;because this will make your installer start faster. - - ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll" - - ReserveFile "ioA.ini" - ReserveFile "ioB.ini" - ReserveFile "ioC.ini" - -;-------------------------------- -;Variables - - Var IniValue - -;-------------------------------- -;Installer Sections - -Section "Dummy Section" SecDummy - - SetOutPath "$INSTDIR" - - ;ADD YOUR OWN FILES HERE... - - ;Store installation folder - WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - ;Read a value from an InstallOptions INI file - !insertmacro INSTALLOPTIONS_READ $IniValue "ioC.ini" "Field 2" "State" - - ;Display a messagebox if check box was checked - StrCmp $IniValue "1" "" +2 - MessageBox MB_OK "You checked the check box, here is the MessageBox..." - -SectionEnd - -;-------------------------------- -;Installer Functions - -Function .onInit - - ;Extract InstallOptions INI files - !insertmacro INSTALLOPTIONS_EXTRACT "ioA.ini" - !insertmacro INSTALLOPTIONS_EXTRACT "ioB.ini" - !insertmacro INSTALLOPTIONS_EXTRACT "ioC.ini" - -FunctionEnd - -LangString TEXT_IO_TITLE ${LANG_ENGLISH} "InstallOptions page" -LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "This is a page created using the InstallOptions plug-in." - -Function CustomPageA - - !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" - !insertmacro INSTALLOPTIONS_DISPLAY "ioA.ini" - -FunctionEnd - -Function CustomPageB - - !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" - !insertmacro INSTALLOPTIONS_DISPLAY "ioB.ini" - -FunctionEnd - -Function CustomPageC - - !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" - !insertmacro INSTALLOPTIONS_DISPLAY "ioC.ini" - -FunctionEnd - -;-------------------------------- -;Descriptions - - ;Language strings - LangString DESC_SecDummy ${LANG_ENGLISH} "A test section." - - ;Assign language strings to sections - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... - - Delete "$INSTDIR\Uninstall.exe" - - RMDir "$INSTDIR" - - DeleteRegKey /ifempty HKCU "Software\Modern UI Test" - -SectionEnd \ No newline at end of file diff --git a/Examples/Modern UI/MultiLanguage.nsi b/Examples/Modern UI/MultiLanguage.nsi index 3e1ee7f4..926167d7 100644 --- a/Examples/Modern UI/MultiLanguage.nsi +++ b/Examples/Modern UI/MultiLanguage.nsi @@ -5,7 +5,7 @@ ;-------------------------------- ;Include Modern UI - !include "MUI.nsh" + !include "MUI2.nsh" ;-------------------------------- ;General @@ -20,6 +20,8 @@ ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Modern UI Test" "" + RequestExecutionLevel user + ;-------------------------------- ;Interface Settings diff --git a/Examples/Modern UI/StartMenu.nsi b/Examples/Modern UI/StartMenu.nsi index 373d97c5..589f4830 100644 --- a/Examples/Modern UI/StartMenu.nsi +++ b/Examples/Modern UI/StartMenu.nsi @@ -5,7 +5,7 @@ ;-------------------------------- ;Include Modern UI - !include "MUI.nsh" + !include "MUI2.nsh" ;-------------------------------- ;General @@ -20,14 +20,12 @@ ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Modern UI Test" "" - ;Vista redirects $SMPROGRAMS to all users without this - RequestExecutionLevel admin + RequestExecutionLevel user ;-------------------------------- ;Variables - Var MUI_TEMP - Var STARTMENU_FOLDER + Var StartMenuFolder ;-------------------------------- ;Interface Settings @@ -46,7 +44,7 @@ !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Modern UI Test" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER + !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder !insertmacro MUI_PAGE_INSTFILES @@ -76,8 +74,8 @@ Section "Dummy Section" SecDummy !insertmacro MUI_STARTMENU_WRITE_BEGIN Application ;Create shortcuts - CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + CreateDirectory "$SMPROGRAMS\$StartMenuFolder" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" !insertmacro MUI_STARTMENU_WRITE_END @@ -105,23 +103,11 @@ Section "Uninstall" RMDir "$INSTDIR" - !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder - Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" + RMDir "$SMPROGRAMS\$StartMenuFolder" - ;Delete empty start menu parent diretories - StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" - - startMenuDeleteLoop: - ClearErrors - RMDir $MUI_TEMP - GetFullPathName $MUI_TEMP "$MUI_TEMP\.." - - IfErrors startMenuDeleteLoopDone - - StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop - startMenuDeleteLoopDone: - DeleteRegKey /ifempty HKCU "Software\Modern UI Test" SectionEnd \ No newline at end of file diff --git a/Examples/Modern UI/WelcomeFinish.nsi b/Examples/Modern UI/WelcomeFinish.nsi index 61e8a3b7..a717f396 100644 --- a/Examples/Modern UI/WelcomeFinish.nsi +++ b/Examples/Modern UI/WelcomeFinish.nsi @@ -5,7 +5,7 @@ ;-------------------------------- ;Include Modern UI - !include "MUI.nsh" + !include "MUI2.nsh" ;-------------------------------- ;General diff --git a/Examples/Modern UI/ioA.ini b/Examples/Modern UI/ioA.ini deleted file mode 100644 index 5a85a770..00000000 --- a/Examples/Modern UI/ioA.ini +++ /dev/null @@ -1,19 +0,0 @@ -[Settings] -NumFields=2 - -[Field 1] -Type=label -Text=Install Options Page A -Left=0 -Right=-1 -Top=0 -Bottom=10 - -[Field 2] -Type=text -Left=0 -Right=-1 -Top=20 -Bottom=100 -flags=MULTILINE|VSCROLL|READONLY -State="Description:\r\n\r\n1 - Show custom page A (where you are now)\r\n2 - Show the components page\r\n3 - Show custom page B\r\n4 - Show directory page\r\n5 - Show custom page C\r\n6 - Show installation progress" \ No newline at end of file diff --git a/Examples/Modern UI/ioB.ini b/Examples/Modern UI/ioB.ini deleted file mode 100644 index dd089244..00000000 --- a/Examples/Modern UI/ioB.ini +++ /dev/null @@ -1,10 +0,0 @@ -[Settings] -NumFields=1 - -[Field 1] -Type=label -Text=Install Options Page B -Left=0 -Right=-1 -Top=0 -Bottom=10 \ No newline at end of file diff --git a/Examples/Modern UI/ioC.ini b/Examples/Modern UI/ioC.ini deleted file mode 100644 index 4d4cdfe0..00000000 --- a/Examples/Modern UI/ioC.ini +++ /dev/null @@ -1,19 +0,0 @@ -[Settings] -NumFields=2 - -[Field 1] -Type=label -Text=Instal Options Page C -Left=0 -Right=-1 -Top=0 -Bottom=10 - -[Field 2] -Type=checkbox -Text=Display a MessageBox -Left=0 -Right=-1 -Top=30 -Bottom=40 -State=1 \ No newline at end of file