* 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
This commit is contained in:
joostverburg 2008-01-27 17:24:40 +00:00
parent 57bf74697f
commit 34112ed24b
9 changed files with 19 additions and 225 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -5,7 +5,7 @@
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
!include "MUI2.nsh"
;--------------------------------
;General

View file

@ -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"

View file

@ -1,10 +0,0 @@
[Settings]
NumFields=1
[Field 1]
Type=label
Text=Install Options Page B
Left=0
Right=-1
Top=0
Bottom=10

View file

@ -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