Examples/ExperienceUI/StartMenu.nsi
author Dan
Mon, 03 Aug 2009 19:54:04 -0400
changeset 6 feec5a7d3f7d
parent 0 d5ce4c64ef88
child 13 2ae1abe546fd
permissions -rwxr-xr-x
Removed installer script - it's crud.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     1
;ExperienceUI for NSIS
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     2
;Header Bitmap Example Script
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     3
;Written by Dan Fuhry
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     4
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     5
;OK, I cheated, Joost wrote it :)
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     6
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     7
!define XPUI_WANSIS
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     8
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
     9
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    10
;Include ExperienceUI
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    11
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    12
  !include "XPUI.nsh"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    13
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    14
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    15
;General
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    16
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    17
  ;Name and file
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    18
  Name "ExperienceUI Test"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    19
  OutFile "StartMenu.exe"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    20
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    21
  ;Default installation folder
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    22
  InstallDir "$PROGRAMFILES\ExperienceUI Test"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    23
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    24
  ;Get installation folder from registry if available
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    25
  InstallDirRegKey HKCU "Software\ExperienceUI Test" ""
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    26
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    27
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    28
;Variables
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    29
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    30
  Var XPUI_TEMP
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    31
  Var STARTMENU_FOLDER
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    32
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    33
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    34
;Interface Settings
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    35
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    36
  !define XPUI_ABORTWARNING
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    37
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    38
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    39
;Pages
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    40
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    41
  !insertmacro XPUI_PAGE_LICENSE "${NSISDIR}\Contrib\ExperienceUI\License.rtf"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    42
  !insertmacro XPUI_PAGE_COMPONENTS
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    43
  !insertmacro XPUI_PAGE_DIRECTORY
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    44
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    45
  ;Start Menu Folder Page Configuration
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    46
  !define XPUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    47
  !define XPUI_STARTMENUPAGE_REGISTRY_KEY "Software\ExperienceUI Test"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    48
  !define XPUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    49
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    50
  !insertmacro XPUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    51
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    52
  !insertmacro XPUI_PAGE_INSTFILES
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    53
  !insertmacro XPUI_PAGE_FINISH
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    54
  !insertmacro XPUI_PAGE_ABORT
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    55
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    56
  !insertmacro XPUI_PAGEMODE_UNINST
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    57
  !insertmacro XPUI_PAGE_UNINSTCONFIRM_NSIS
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    58
  !insertmacro XPUI_PAGE_INSTFILES
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    59
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    60
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    61
;Languages
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    62
 
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    63
  !insertmacro XPUI_LANGUAGE "English"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    64
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    65
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    66
;Installer Sections
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    67
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    68
Section "Dummy Section" SecDummy
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    69
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    70
  SetOutPath "$INSTDIR"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    71
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    72
  ;ADD YOUR OWN FILES HERE...
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    73
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    74
  ;Store installation folder
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    75
  WriteRegStr HKCU "Software\ExperienceUI Test" "" $INSTDIR
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    76
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    77
  ;Create uninstaller
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    78
  WriteUninstaller "$INSTDIR\Uninstall.exe"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    79
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    80
  !insertmacro XPUI_STARTMENU_WRITE_BEGIN Application
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    81
    
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    82
    ;Create shortcuts
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    83
    CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    84
    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    85
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    86
  !insertmacro XPUI_STARTMENU_WRITE_END
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    87
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    88
SectionEnd
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    89
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    90
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    91
;Descriptions
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    92
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    93
  ;Language strings
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    94
  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    95
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    96
  ;Assign language strings to sections
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    97
  !insertmacro XPUI_FUNCTION_DESCRIPTION_BEGIN
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    98
    !insertmacro XPUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
    99
  !insertmacro XPUI_FUNCTION_DESCRIPTION_END
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   100
 
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   101
;--------------------------------
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   102
;Uninstaller Section
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   103
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   104
Section "Uninstall"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   105
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   106
  ;ADD YOUR OWN FILES HERE...
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   107
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   108
  Delete "$INSTDIR\Uninstall.exe"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   109
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   110
  RMDir "$INSTDIR"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   111
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   112
  !insertmacro XPUI_STARTMENU_GETFOLDER Application $XPUI_TEMP
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   113
    
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   114
  Delete "$SMPROGRAMS\$XPUI_TEMP\Uninstall.lnk"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   115
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   116
  ;Delete empty start menu parent diretories
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   117
  StrCpy $XPUI_TEMP "$SMPROGRAMS\$XPUI_TEMP"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   118
 
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   119
  startMenuDeleteLoop:
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   120
	ClearErrors
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   121
    RMDir $XPUI_TEMP
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   122
    GetFullPathName $XPUI_TEMP "$XPUI_TEMP\.."
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   123
    
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   124
    IfErrors startMenuDeleteLoopDone
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   125
  
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   126
    StrCmp $XPUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   127
  startMenuDeleteLoopDone:
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   128
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   129
  DeleteRegKey /ifempty HKCU "Software\ExperienceUI Test"
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   130
d5ce4c64ef88 Initial population with stock ExUI 1.11pre + a couple of fixes needed to compile the installer
Dan
parents:
diff changeset
   131
SectionEnd