Horizon – Diff between revs 19 and 29

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 19 Rev 29
1 # This installs two files, app.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and 1 # This installs two files, app.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and
2 # adds uninstall information to the registry for Add/Remove Programs 2 # adds uninstall information to the registry for Add/Remove Programs
3 3
4 # To get started, put this script into a folder with the two files (app.exe, logo.ico, and license.rtf - 4 # To get started, put this script into a folder with the two files (app.exe, logo.ico, and license.rtf -
5 # You'll have to create these yourself) and run makensis on it 5 # You'll have to create these yourself) and run makensis on it
6 6
7 # If you change the names "app.exe", "logo.ico", or "license.rtf" you should do a search and replace - they 7 # If you change the names "app.exe", "logo.ico", or "license.rtf" you should do a search and replace - they
8 # show up in a few places. 8 # show up in a few places.
9 # All the other settings can be tweaked by editing the !defines at the top of this script 9 # All the other settings can be tweaked by editing the !defines at the top of this script
10 !define APPNAME "Horizon" 10 !define APPNAME "Horizon"
11 !define COMPANYNAME "Wizardry and Steamworks" 11 !define COMPANYNAME "Wizardry and Steamworks"
12 !define DESCRIPTION "Control computer power state after an user-configurable timeout." 12 !define DESCRIPTION "Control computer power state after an user-configurable timeout."
13 # These will be displayed by the "Click here for support information" link in "Add/Remove Programs" 13 # These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
14 # It is possible to use "mailto:" links in here to open the email client 14 # It is possible to use "mailto:" links in here to open the email client
15 !define HELPURL "http://horizon.grimore.org/" # "Support Information" link 15 !define HELPURL "http://horizon.grimore.org/" # "Support Information" link
16 !define UPDATEURL "http://horizon.grimore.org/download/" # "Product Updates" link 16 !define UPDATEURL "http://horizon.grimore.org/download/" # "Product Updates" link
17 !define ABOUTURL "http://grimore.org/" # "Publisher" link 17 !define ABOUTURL "http://grimore.org/" # "Publisher" link
18 # This is the size (in kB) of all the files copied into "Program Files" 18 # This is the size (in kB) of all the files copied into "Program Files"
19 #!define INSTALLSIZE 7233 19 #!define INSTALLSIZE 7233
20   20  
21 #### General Use Functions 21 #### General Use Functions
22   22  
23 ## Get version of an exe file. 23 ## Get version of an exe file.
24 Function GetFileVersion 24 Function GetFileVersion
25 !define GetFileVersion `!insertmacro GetFileVersionCall` 25 !define GetFileVersion `!insertmacro GetFileVersionCall`
26 26
27 !macro GetFileVersionCall _FILE _RESULT 27 !macro GetFileVersionCall _FILE _RESULT
28 Push `${_FILE}` 28 Push `${_FILE}`
29 Call GetFileVersion 29 Call GetFileVersion
30 Pop ${_RESULT} 30 Pop ${_RESULT}
31 !macroend 31 !macroend
32 32
33 Exch $0 33 Exch $0
34 Push $1 34 Push $1
35 Push $2 35 Push $2
36 Push $3 36 Push $3
37 Push $4 37 Push $4
38 Push $5 38 Push $5
39 Push $6 39 Push $6
40 ClearErrors 40 ClearErrors
41 41
42 GetDllVersion '$0' $1 $2 42 GetDllVersion '$0' $1 $2
43 IfErrors error 43 IfErrors error
44 IntOp $3 $1 >> 16 44 IntOp $3 $1 >> 16
45 IntOp $3 $3 & 0x0000FFFF 45 IntOp $3 $3 & 0x0000FFFF
46 IntOp $4 $1 & 0x0000FFFF 46 IntOp $4 $1 & 0x0000FFFF
47 IntOp $5 $2 >> 16 47 IntOp $5 $2 >> 16
48 IntOp $5 $5 & 0x0000FFFF 48 IntOp $5 $5 & 0x0000FFFF
49 IntOp $6 $2 & 0x0000FFFF 49 IntOp $6 $2 & 0x0000FFFF
50 StrCpy $0 '$3.$4.$5.$6' 50 StrCpy $0 '$3.$4.$5.$6'
51 goto end 51 goto end
52 52
53 error: 53 error:
54 SetErrors 54 SetErrors
55 StrCpy $0 '' 55 StrCpy $0 ''
56 56
57 end: 57 end:
58 Pop $6 58 Pop $6
59 Pop $5 59 Pop $5
60 Pop $4 60 Pop $4
61 Pop $3 61 Pop $3
62 Pop $2 62 Pop $2
63 Pop $1 63 Pop $1
64 Exch $0 64 Exch $0
65 FunctionEnd 65 FunctionEnd
66   66  
67 ## Explode 67 ## Explode
68 !include "LogicLib.nsh" 68 !include "LogicLib.nsh"
69 !define Explode "!insertmacro Explode" 69 !define Explode "!insertmacro Explode"
70   70  
71 Function Explode 71 Function Explode
72   72  
73 !macro Explode Length Separator String 73 !macro Explode Length Separator String
74 Push `${Separator}` 74 Push `${Separator}`
75 Push `${String}` 75 Push `${String}`
76 Call Explode 76 Call Explode
77 Pop `${Length}` 77 Pop `${Length}`
78 !macroend 78 !macroend
79   79  
80 ; Initialize variables 80 ; Initialize variables
81 Var /GLOBAL explString 81 Var /GLOBAL explString
82 Var /GLOBAL explSeparator 82 Var /GLOBAL explSeparator
83 Var /GLOBAL explStrLen 83 Var /GLOBAL explStrLen
84 Var /GLOBAL explSepLen 84 Var /GLOBAL explSepLen
85 Var /GLOBAL explOffset 85 Var /GLOBAL explOffset
86 Var /GLOBAL explTmp 86 Var /GLOBAL explTmp
87 Var /GLOBAL explTmp2 87 Var /GLOBAL explTmp2
88 Var /GLOBAL explTmp3 88 Var /GLOBAL explTmp3
89 Var /GLOBAL explArrCount 89 Var /GLOBAL explArrCount
90 Var /GLOBAL BonjourSetupError 90 Var /GLOBAL BonjourSetupError
91 91
92 ; Get input from user 92 ; Get input from user
93 Pop $explString 93 Pop $explString
94 Pop $explSeparator 94 Pop $explSeparator
95 95
96 ; Calculates initial values 96 ; Calculates initial values
97 StrLen $explStrLen $explString 97 StrLen $explStrLen $explString
98 StrLen $explSepLen $explSeparator 98 StrLen $explSepLen $explSeparator
99 StrCpy $explArrCount 1 99 StrCpy $explArrCount 1
100 100
101 ${If} $explStrLen <= 1 ; If we got a single character 101 ${If} $explStrLen <= 1 ; If we got a single character
102 ${OrIf} $explSepLen > $explStrLen ; or separator is larger than the string, 102 ${OrIf} $explSepLen > $explStrLen ; or separator is larger than the string,
103 Push $explString ; then we return initial string with no change 103 Push $explString ; then we return initial string with no change
104 Push 1 ; and set array's length to 1 104 Push 1 ; and set array's length to 1
105 Return 105 Return
106 ${EndIf} 106 ${EndIf}
107 107
108 ; Set offset to the last symbol of the string 108 ; Set offset to the last symbol of the string
109 StrCpy $explOffset $explStrLen 109 StrCpy $explOffset $explStrLen
110 IntOp $explOffset $explOffset - 1 110 IntOp $explOffset $explOffset - 1
111 111
112 ; Clear temp string to exclude the possibility of appearance of occasional data 112 ; Clear temp string to exclude the possibility of appearance of occasional data
113 StrCpy $explTmp "" 113 StrCpy $explTmp ""
114 StrCpy $explTmp2 "" 114 StrCpy $explTmp2 ""
115 StrCpy $explTmp3 "" 115 StrCpy $explTmp3 ""
116 116
117 ; Loop until the offset becomes negative 117 ; Loop until the offset becomes negative
118 ${Do} 118 ${Do}
119 ; If offset becomes negative, it is time to leave the function 119 ; If offset becomes negative, it is time to leave the function
120 ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|} 120 ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|}
121 121
122 ; Remove everything before and after the searched part ("TempStr") 122 ; Remove everything before and after the searched part ("TempStr")
123 StrCpy $explTmp $explString $explSepLen $explOffset 123 StrCpy $explTmp $explString $explSepLen $explOffset
124 124
125 ${If} $explTmp == $explSeparator 125 ${If} $explTmp == $explSeparator
126 ; Calculating offset to start copy from 126 ; Calculating offset to start copy from
127 IntOp $explTmp2 $explOffset + $explSepLen ; Offset equals to the current offset plus length of separator 127 IntOp $explTmp2 $explOffset + $explSepLen ; Offset equals to the current offset plus length of separator
128 StrCpy $explTmp3 $explString "" $explTmp2 128 StrCpy $explTmp3 $explString "" $explTmp2
129 129
130 Push $explTmp3 ; Throwing array item to the stack 130 Push $explTmp3 ; Throwing array item to the stack
131 IntOp $explArrCount $explArrCount + 1 ; Increasing array's counter 131 IntOp $explArrCount $explArrCount + 1 ; Increasing array's counter
132 132
133 StrCpy $explString $explString $explOffset 0 ; Cutting all characters beginning with the separator entry 133 StrCpy $explString $explString $explOffset 0 ; Cutting all characters beginning with the separator entry
134 StrLen $explStrLen $explString 134 StrLen $explStrLen $explString
135 ${EndIf} 135 ${EndIf}
136 136
137 ${If} $explOffset = 0 ; If the beginning of the line met and there is no separator, 137 ${If} $explOffset = 0 ; If the beginning of the line met and there is no separator,
138 ; copying the rest of the string 138 ; copying the rest of the string
139 ${If} $explSeparator == "" ; Fix for the empty separator 139 ${If} $explSeparator == "" ; Fix for the empty separator
140 IntOp $explArrCount $explArrCount - 1 140 IntOp $explArrCount $explArrCount - 1
141 ${Else} 141 ${Else}
142 Push $explString 142 Push $explString
143 ${EndIf} 143 ${EndIf}
144 ${EndIf} 144 ${EndIf}
145 145
146 IntOp $explOffset $explOffset - 1 146 IntOp $explOffset $explOffset - 1
147 ${Loop} 147 ${Loop}
148 148
149 Push $explArrCount 149 Push $explArrCount
150 FunctionEnd 150 FunctionEnd
151   151  
152 Function GetAppVersion 152 Function GetAppVersion
153 ; Create global variables. 153 ; Create global variables.
154 Var /GLOBAL VERSIONMAJOR 154 Var /GLOBAL VERSIONMAJOR
155 Var /GLOBAL VERSIONMINOR 155 Var /GLOBAL VERSIONMINOR
156 Var /GLOBAL VERSIONBUILD 156 Var /GLOBAL VERSIONBUILD
157   157  
158 ; Initialize global variables. 158 ; Initialize global variables.
159 StrCpy $VERSIONMAJOR 1 159 StrCpy $VERSIONMAJOR 1
160 StrCpy $VERSIONMINOR 0 160 StrCpy $VERSIONMINOR 0
161 StrCpy $VERSIONBUILD 0 161 StrCpy $VERSIONBUILD 0
162   162  
163 ; Retrieve executable version. 163 ; Retrieve executable version.
164 ${GetFileVersion} "${APPNAME}.exe" $R0 164 ${GetFileVersion} "${APPNAME}.exe" $R0
165 ${Explode} $0 "." $R0 165 ${Explode} $0 "." $R0
166 Pop $0 166 Pop $0
167 Pop $VERSIONMAJOR 167 Pop $VERSIONMAJOR
168 Pop $VERSIONMINOR 168 Pop $VERSIONMINOR
169 Pop $VERSIONBUILD 169 Pop $VERSIONBUILD
170 FunctionEnd 170 FunctionEnd
171 171
172 RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) 172 RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)
173 173
174 InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}" 174 InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}"
175 175
176 # rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) 176 # rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n)
177 LicenseData "LICENSE.txt" 177 LicenseData "LICENSE.txt"
178 # This will be in the installer/uninstaller's title bar 178 # This will be in the installer/uninstaller's title bar
179 Name "${APPNAME}" 179 Name "${APPNAME}"
180 Icon "${APPNAME}.ico" 180 Icon "${APPNAME}.ico"
181 # Set the output file. 181 # Set the output file.
182 outFile "${APPNAME}.exe" 182 outFile "${APPNAME}.exe"
183   183  
184 !include LogicLib.nsh 184 !include LogicLib.nsh
185 !include nsDialogs.nsh 185 !include nsDialogs.nsh
186 186
187 # Just three pages - license agreement, install location, and installation 187 # Just three pages - license agreement, install location, and installation
188 page custom nsDialogsImage 188 page custom nsDialogsImage
189 page license 189 page license
190 page directory 190 page directory
191 Page instfiles 191 Page instfiles
192 192
193 !macro VerifyUserIsAdmin 193 !macro VerifyUserIsAdmin
194 UserInfo::GetAccountType 194 UserInfo::GetAccountType
195 pop $0 195 pop $0
196 ${If} $0 != "admin" ;Require admin rights on NT4+ 196 ${If} $0 != "admin" ;Require admin rights on NT4+
197 messageBox mb_iconstop "Administrator rights required!" 197 messageBox mb_iconstop "Administrator rights required!"
198 setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED 198 setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
199 quit 199 quit
200 ${EndIf} 200 ${EndIf}
201 !macroend 201 !macroend
202 202
203 function .onInit 203 function .onInit
204 InitPluginsDir 204 InitPluginsDir
205 setShellVarContext all 205 setShellVarContext all
206 !insertmacro VerifyUserIsAdmin 206 !insertmacro VerifyUserIsAdmin
207 File /oname=$PLUGINSDIR\image.bmp "wasinstallerlogo.bmp" 207 File /oname=$PLUGINSDIR\image.bmp "wasinstallerlogo.bmp"
208 # Get the application version. 208 # Get the application version.
209 Call GetAppVersion 209 Call GetAppVersion
210 functionEnd 210 functionEnd
211   211  
212 Var Dialog 212 Var Dialog
213 Var Image 213 Var Image
214 Var ImageHandle 214 Var ImageHandle
215   215  
216 Function nsDialogsImage 216 Function nsDialogsImage
217 nsDialogs::Create 1018 217 nsDialogs::Create 1018
218 Pop $Dialog 218 Pop $Dialog
219   219  
220 ${If} $Dialog == error 220 ${If} $Dialog == error
221 Abort 221 Abort
222 ${EndIf} 222 ${EndIf}
223   223  
224 ${NSD_CreateBitmap} 0 0 100% 100% "" 224 ${NSD_CreateBitmap} 0 0 100% 100% ""
225 Pop $Image 225 Pop $Image
226 ${NSD_SetImage} $Image $PLUGINSDIR\image.bmp $ImageHandle 226 ${NSD_SetImage} $Image $PLUGINSDIR\image.bmp $ImageHandle
227   227  
228 nsDialogs::Show 228 nsDialogs::Show
229   229  
230 ${NSD_FreeImage} $ImageHandle 230 ${NSD_FreeImage} $ImageHandle
231 FunctionEnd 231 FunctionEnd
232 232
233 section "install" 233 section "install"
234 # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) 234 # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file)
235 setOutPath $INSTDIR 235 setOutPath $INSTDIR
236 # Files added here should be removed by the uninstaller (see section "uninstall") 236 # Files added here should be removed by the uninstaller (see section "uninstall")
237 file /r "bin\Release\*.*" 237 file /r "bin\Release\*.*"
238 file "${APPNAME}.ico" 238 file "${APPNAME}.ico"
239 # Add any other files for the install directory (license files, app data, etc) here 239 # Add any other files for the install directory (license files, app data, etc) here
240 240
241 # Uninstaller - See function un.onInit and section "uninstall" for configuration 241 # Uninstaller - See function un.onInit and section "uninstall" for configuration
242 writeUninstaller "$INSTDIR\uninstall.exe" 242 writeUninstaller "$INSTDIR\uninstall.exe"
243   243  
244 # Create start-menu items 244 # Create start-menu items
245 CreateDirectory "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}" 245 CreateDirectory "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}"
246 CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 246 CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
247 CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\${APPNAME}.exe" "" "$INSTDIR\${APPNAME}.ico" 247 CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\${APPNAME}.exe" "" "$INSTDIR\${APPNAME}.ico"
248   248  
249 # Create desktop shortcut 249 # Create desktop shortcut
250 CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${APPNAME}.exe" "" 250 CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${APPNAME}.exe" ""
251 251
252 # Registry information for add/remove programs 252 # Registry information for add/remove programs
253 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${APPNAME}" 253 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${APPNAME}"
254 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" 254 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
255 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" 255 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
256 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\"" 256 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
257 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\${APPNAME}.ico$\"" 257 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\${APPNAME}.ico$\""
258 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "$\"${COMPANYNAME}$\"" 258 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "$\"${COMPANYNAME}$\""
259 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "$\"${HELPURL}$\"" 259 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "$\"${HELPURL}$\""
260 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" 260 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\""
261 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\"" 261 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""
262 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "$\"$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD$\"" 262 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "$\"$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD$\""
263 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMajor" $VERSIONMAJOR 263 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMajor" $VERSIONMAJOR
264 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMinor" $VERSIONMINOR 264 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMinor" $VERSIONMINOR
265 # There is no option for modifying or repairing the install 265 # There is no option for modifying or repairing the install
266 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1 266 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1
267 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1 267 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1
268 # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size 268 # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
269 #WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${INSTALLSIZE} 269 #WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
270   -  
271 #DetailPrint "Running DirectX Setup..." -  
272 #ExecWait '"$EXEDIR\DirectX\DXSETUP.exe" /silent' $DirectXSetupError -  
273 #DetailPrint "Finished DirectX Setup" -  
274   270  
275 DetailPrint "Running Bonjopur Setup..." 271 DetailPrint "Running Bonjopur Setup..."
276 ExecWait '"$EXEDIR\redist\Bonjour\BonjourPSSetup.exe" /passive' $BonjourSetupError 272 ExecWait '"$EXEDIR\redist\Bonjour\BonjourPSSetup.exe" /passive' $BonjourSetupError
277 DetailPrint "Finished DirectX Setup" 273 DetailPrint "Finished Bonjour Setup"
278 sectionEnd 274 sectionEnd
279 275
280 # Uninstaller 276 # Uninstaller
281   277  
282 function un.onInit 278 function un.onInit
283 SetShellVarContext all 279 SetShellVarContext all
284 280
285 #Verify the uninstaller - last chance to back out 281 #Verify the uninstaller - last chance to back out
286 MessageBox MB_OKCANCEL "Permanantly remove ${APPNAME}?" IDOK next 282 MessageBox MB_OKCANCEL "Permanantly remove ${APPNAME}?" IDOK next
287 Abort 283 Abort
288 next: 284 next:
289 !insertmacro VerifyUserIsAdmin 285 !insertmacro VerifyUserIsAdmin
290 functionEnd 286 functionEnd
291 287
292 section "uninstall" 288 section "uninstall"
293 289
294 # Remove desktop shortcut 290 # Remove desktop shortcut
295 delete "$DESKTOP\${APPNAME}.lnk" 291 delete "$DESKTOP\${APPNAME}.lnk"
296 # Remove Start Menu items 292 # Remove Start Menu items
297 delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\uninstall.lnk" 293 delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\uninstall.lnk"
298 delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME}.lnk" 294 delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME}.lnk"
299 # Try to remove the Start Menu folder for the program. 295 # Try to remove the Start Menu folder for the program.
300 # NB: This will only happen if it is empty 296 # NB: This will only happen if it is empty
301 rmDir "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}" 297 rmDir "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}"
302 # Try to remove the Start Menu folder for the company. 298 # Try to remove the Start Menu folder for the company.
303 rmDir "$SMPROGRAMS\${COMPANYNAME}" 299 rmDir "$SMPROGRAMS\${COMPANYNAME}"
304 300
305 # Remove files 301 # Remove files
306 rmDir /r "$INSTDIR\*.*" 302 rmDir /r "$INSTDIR\*.*"
307 303
308 # Always delete uninstaller as the last action 304 # Always delete uninstaller as the last action
309 delete $INSTDIR\uninstall.exe 305 delete $INSTDIR\uninstall.exe
310 306
311 # Try to remove the install directory - this will only happen if it is empty 307 # Try to remove the install directory - this will only happen if it is empty
312 rmDir $INSTDIR 308 rmDir $INSTDIR
313 309
314 # Remove uninstaller information from the registry 310 # Remove uninstaller information from the registry
315 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" 311 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}"
316 sectionEnd 312 sectionEnd
317   313