home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Programming / nsis-2.46-setup.exe / Examples / Modern UI / Basic.nsi next >
Encoding:
NSIS script  |  2008-02-03  |  1.9 KB  |  88 lines

  1. ;NSIS Modern User Interface
  2. ;Basic Example Script
  3. ;Written by Joost Verburg
  4.  
  5. ;--------------------------------
  6. ;Include Modern UI
  7.  
  8.   !include "MUI2.nsh"
  9.  
  10. ;--------------------------------
  11. ;General
  12.  
  13.   ;Name and file
  14.   Name "Modern UI Test"
  15.   OutFile "Basic.exe"
  16.  
  17.   ;Default installation folder
  18.   InstallDir "$LOCALAPPDATA\Modern UI Test"
  19.   
  20.   ;Get installation folder from registry if available
  21.   InstallDirRegKey HKCU "Software\Modern UI Test" ""
  22.  
  23.   ;Request application privileges for Windows Vista
  24.   RequestExecutionLevel user
  25.  
  26. ;--------------------------------
  27. ;Interface Settings
  28.  
  29.   !define MUI_ABORTWARNING
  30.  
  31. ;--------------------------------
  32. ;Pages
  33.  
  34.   !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
  35.   !insertmacro MUI_PAGE_COMPONENTS
  36.   !insertmacro MUI_PAGE_DIRECTORY
  37.   !insertmacro MUI_PAGE_INSTFILES
  38.   
  39.   !insertmacro MUI_UNPAGE_CONFIRM
  40.   !insertmacro MUI_UNPAGE_INSTFILES
  41.   
  42. ;--------------------------------
  43. ;Languages
  44.  
  45.   !insertmacro MUI_LANGUAGE "English"
  46.  
  47. ;--------------------------------
  48. ;Installer Sections
  49.  
  50. Section "Dummy Section" SecDummy
  51.  
  52.   SetOutPath "$INSTDIR"
  53.   
  54.   ;ADD YOUR OWN FILES HERE...
  55.   
  56.   ;Store installation folder
  57.   WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
  58.   
  59.   ;Create uninstaller
  60.   WriteUninstaller "$INSTDIR\Uninstall.exe"
  61.  
  62. SectionEnd
  63.  
  64. ;--------------------------------
  65. ;Descriptions
  66.  
  67.   ;Language strings
  68.   LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
  69.  
  70.   ;Assign language strings to sections
  71.   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  72.     !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
  73.   !insertmacro MUI_FUNCTION_DESCRIPTION_END
  74.  
  75. ;--------------------------------
  76. ;Uninstaller Section
  77.  
  78. Section "Uninstall"
  79.  
  80.   ;ADD YOUR OWN FILES HERE...
  81.  
  82.   Delete "$INSTDIR\Uninstall.exe"
  83.  
  84.   RMDir "$INSTDIR"
  85.  
  86.   DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
  87.  
  88. SectionEnd