Examples/ExperienceUI/WelcomeFinish.nsi
changeset 0 d5ce4c64ef88
child 13 2ae1abe546fd
equal deleted inserted replaced
-1:000000000000 0:d5ce4c64ef88
       
     1 ;ExperienceUI for NSIS
       
     2 ;Welcome/Finish Page Example Script
       
     3 ;Written by Dan Fuhry
       
     4 
       
     5 ;OK, I cheated, Joost wrote it :)
       
     6 
       
     7 ;This script has been tested to compile with the Modern UI, ExperienceUI,
       
     8 ;UltraModernUI, and InstallSpider UI.  All compiled w/o warnings.
       
     9 
       
    10 ;!define XPUI_VERBOSE 4
       
    11 
       
    12 ;--------------------------------
       
    13 ;Include ExperienceUI
       
    14 
       
    15   !define XPUI_SKIN "Windows XP"
       
    16   !define XPUI_DISABLEBG
       
    17   !define UI "XPUI"
       
    18   !include "XPUI.nsh"
       
    19 
       
    20 ;--------------------------------
       
    21 ;General
       
    22 
       
    23   ;Name and file
       
    24   Name "ExperienceUI Test"
       
    25   OutFile "WelcomeFinish.exe"
       
    26 
       
    27   ;Default installation folder
       
    28   InstallDir "$PROGRAMFILES\ExperienceUI Test"
       
    29   
       
    30   ;Get installation folder from registry if available
       
    31   InstallDirRegKey HKCU "Software\ExperienceUI Test" ""
       
    32 
       
    33 ;--------------------------------
       
    34 ;Interface Settings
       
    35 
       
    36   !define MUI_ABORTWARNING
       
    37   
       
    38 ;--------------------------------
       
    39 ;Pages
       
    40 
       
    41   !insertmacro ${UI}_PAGE_WELCOME
       
    42   !insertmacro ${UI}_PAGE_LICENSE "${NSISDIR}\Contrib\ExperienceUI\License.rtf"
       
    43   !ifdef XPUI_INCLUDED
       
    44   !define ${UI}_FINISHPAGE_RUN        "$SYSDIR\Write.exe"
       
    45   !define ${UI}_FINISHPAGE_RUN_FILE   "$SYSDIR\Write.exe"
       
    46   !define ${UI}_FINISHPAGE_DOCS       "$SYSDIR\Write.exe"
       
    47   !define ${UI}_FINISHPAGE_DOCS_FILE  "$SYSDIR\Write.exe"
       
    48   !endif
       
    49   !insertmacro ${UI}_PAGE_FINISH
       
    50   !ifdef XPUI_INCLUDED
       
    51   !insertmacro ${UI}_PAGE_WELCOME2
       
    52   !endif
       
    53   !insertmacro ${UI}_PAGE_COMPONENTS
       
    54   !insertmacro ${UI}_PAGE_DIRECTORY
       
    55   !insertmacro ${UI}_PAGE_INSTFILES
       
    56   !ifdef XPUI_INCLUDED
       
    57   !define ${UI}_FINISHPAGE_RUN        "$WINDIR\Notepad.exe"
       
    58   !define ${UI}_FINISHPAGE_RUN_FILE   "$WINDIR\Notepad.exe"
       
    59   !define ${UI}_FINISHPAGE_DOCS       "$WINDIR\Notepad.exe"
       
    60   !define ${UI}_FINISHPAGE_DOCS_FILE  "$WINDIR\Notepad.exe"
       
    61   !endif
       
    62   !define MUI_PAGE_ABORT
       
    63   !insertmacro ${UI}_PAGE_FINISH
       
    64   
       
    65   !ifdef XPUI_VERSION
       
    66     !insertmacro XPUI_PAGE_ABORT
       
    67   !endif
       
    68 
       
    69   !ifdef XPUI_VERSION
       
    70     !insertmacro XPUI_PAGEMODE_UNINST
       
    71     !insertmacro XPUI_PAGE_WELCOME
       
    72     !insertmacro XPUI_PAGE_UNINSTCONFIRM_NSIS
       
    73     !insertmacro XPUI_PAGE_INSTFILES
       
    74     !define ${UI}_UNFINISHPAGE_RUN        "$WINDIR\Notepad.exe"
       
    75     !define ${UI}_UNFINISHPAGE_RUN_FILE   "$WINDIR\Notepad.exe"
       
    76     !define ${UI}_UNFINISHPAGE_DOCS       "$WINDIR\Notepad.exe"
       
    77     !define ${UI}_UNFINISHPAGE_DOCS_FILE  "$WINDIR\Notepad.exe"
       
    78     !insertmacro XPUI_PAGE_FINISH
       
    79     !insertmacro XPUI_PAGE_ABORT
       
    80   !else
       
    81     !insertmacro MUI_UNPAGE_WELCOME
       
    82     !insertmacro MUI_UNPAGE_CONFIRM
       
    83     !insertmacro MUI_UNPAGE_INSTFILES
       
    84     !insertmacro MUI_UNPAGE_FINISH
       
    85   !endif
       
    86   
       
    87   !ifdef XPUI_VERSION
       
    88     !insertmacro XPUI_PAGE_ABORT
       
    89   !endif
       
    90   
       
    91 ;--------------------------------
       
    92 ;Languages
       
    93  
       
    94   !insertmacro MUI_LANGUAGE "English"
       
    95 
       
    96 ;--------------------------------
       
    97 ;Installer Sections
       
    98 
       
    99 Section "Dummy Section" SecDummy
       
   100 
       
   101   SetOutPath "$INSTDIR"
       
   102   
       
   103   ;ADD YOUR OWN FILES HERE...
       
   104   
       
   105   ;Store installation folder
       
   106   WriteRegStr HKCU "Software\ExperienceUI Test" "" $INSTDIR
       
   107   
       
   108   ;Create uninstaller
       
   109   WriteUninstaller "$INSTDIR\Uninstall.exe"
       
   110 
       
   111 SectionEnd
       
   112 
       
   113 ;--------------------------------
       
   114 ;Descriptions
       
   115 
       
   116   ;Language strings
       
   117   LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
       
   118 
       
   119   ;Assign language strings to sections
       
   120   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
       
   121     !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
       
   122   !insertmacro MUI_FUNCTION_DESCRIPTION_END
       
   123  
       
   124 ;--------------------------------
       
   125 ;Uninstaller Section
       
   126 
       
   127 Section "Uninstall"
       
   128 
       
   129   ;ADD YOUR OWN FILES HERE...
       
   130 
       
   131   Delete "$INSTDIR\Uninstall.exe"
       
   132 
       
   133   RMDir "$INSTDIR"
       
   134 
       
   135   DeleteRegKey /ifempty HKCU "Software\ExperienceUI Test"
       
   136 
       
   137 SectionEnd  
       
   138 
       
   139 ;--------------------------------
       
   140 ; InstallSpider settings
       
   141 
       
   142   Function .onInit
       
   143     !ifmacrodef MUI_SHOWBANNER
       
   144       !insertmacro MUI_SHOWBANNER
       
   145       StrCpy $0 0
       
   146       loop:
       
   147         IntOp $0 $0 + 1
       
   148         !insertmacro MUI_SETPOS $0
       
   149         Sleep 20
       
   150         IntCmp $0 100 +2 0 +2
       
   151         Goto loop
       
   152       !insertmacro MUI_DESTROYBANNER
       
   153       !insertmacro MUI_UNLOAD_DLL
       
   154     !endif
       
   155   FunctionEnd