Examples/ExperienceUI/Basic.nsi
changeset 0 d5ce4c64ef88
child 13 2ae1abe546fd
equal deleted inserted replaced
-1:000000000000 0:d5ce4c64ef88
       
     1 ;ExperienceUI for NSIS
       
     2 ;Basic Example Script
       
     3 ;Written by Dan Fuhry
       
     4 
       
     5 ;OK, I cheated, Joost wrote it. :-)
       
     6 
       
     7 ;--------------------------------
       
     8 ;Include ExperienceUI
       
     9 
       
    10   !include "XPUI.nsh"
       
    11 
       
    12 ;--------------------------------
       
    13 ;General
       
    14 
       
    15   ;Name and file
       
    16   Name "ExperienceUI Test"
       
    17   OutFile "Basic.exe"
       
    18 
       
    19   ;Default installation folder
       
    20   InstallDir "$PROGRAMFILES\ExperienceUI Test"
       
    21   
       
    22   ;Get installation folder from registry if available
       
    23   InstallDirRegKey HKCU "Software\ExperienceUI Test" ""
       
    24 
       
    25 ;--------------------------------
       
    26 ;Interface Settings
       
    27 
       
    28   !define XPUI_ABORTWARNING
       
    29 
       
    30 ;--------------------------------
       
    31 ;Pages
       
    32 
       
    33   ${Page} Welcome
       
    34   ${LicensePage} "${NSISDIR}\Contrib\ExperienceUI\License.rtf"
       
    35   ${Page} Components
       
    36   ${Page} Directory
       
    37   ${Page} InstFiles
       
    38   ${Page} Finish
       
    39   
       
    40   ${UnPage} Welcome
       
    41   !insertmacro XPUI_PAGEMODE_UNINST
       
    42   !insertmacro XPUI_PAGE_UNINSTCONFIRM_NSIS
       
    43   !insertmacro XPUI_PAGE_INSTFILES
       
    44   
       
    45 ;--------------------------------
       
    46 ;Languages
       
    47  
       
    48   !insertmacro XPUI_LANGUAGE "English"
       
    49 
       
    50 ;--------------------------------
       
    51 ;Installer Sections
       
    52 
       
    53 Section "Dummy Section" SecDummy
       
    54 
       
    55   SetOutPath "$INSTDIR"
       
    56   
       
    57   ;ADD YOUR OWN FILES HERE...
       
    58   
       
    59   ;Store installation folder
       
    60   WriteRegStr HKCU "Software\ExperienceUI Test" "" $INSTDIR
       
    61   
       
    62   ;Create uninstaller
       
    63   WriteUninstaller "$INSTDIR\Uninstall.exe"
       
    64 
       
    65 SectionEnd
       
    66 
       
    67 ;--------------------------------
       
    68 ;Descriptions
       
    69 
       
    70   ;Language strings
       
    71   LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
       
    72 
       
    73   ;Assign language strings to sections
       
    74   !insertmacro XPUI_FUNCTION_DESCRIPTION_BEGIN
       
    75     !insertmacro XPUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
       
    76   !insertmacro XPUI_FUNCTION_DESCRIPTION_END
       
    77 
       
    78 ;--------------------------------
       
    79 ;Uninstaller Section
       
    80 
       
    81 Section "Uninstall"
       
    82 
       
    83   ;ADD YOUR OWN FILES HERE...
       
    84 
       
    85   Delete "$INSTDIR\Uninstall.exe"
       
    86 
       
    87   RMDir "$INSTDIR"
       
    88 
       
    89   DeleteRegKey /ifempty HKCU "Software\ExperienceUI Test"
       
    90 
       
    91 SectionEnd