| Line 111... |
Line 111... |
| 111 |
; The macro should be inserted in an install section, usually the same one that calls VIX_CREATE_UNINSTALLER_AND_REGISTRY
|
111 |
; The macro should be inserted in an install section, usually the same one that calls VIX_CREATE_UNINSTALLER_AND_REGISTRY
|
| 112 |
;
|
112 |
;
|
| 113 |
; Uses registers $0, $1, $2, $3, $4, $5, $6 without saving them
|
113 |
; Uses registers $0, $1, $2, $3, $4, $5, $6 without saving them
|
| 114 |
;
|
114 |
;
|
| 115 |
; The following defines are available after this macro is inserted
|
115 |
; The following defines are available after this macro is inserted
|
| - |
|
116 |
; VIX_PACKAGING_ROOTKEY - The Root key where VIX_PACKAGING_SUBKEY is rooted
|
| 116 |
; VIX_PACKAGING_SUBKEY - The Registry key where the values are inserted
|
117 |
; VIX_PACKAGING_SUBKEY - The Registry key where the values are inserted
|
| 117 |
; VIX_PACKAGING_PARAMETERS_SUBKEY - A Subdir of VIX_PACKAGING_SUBKEY that can contain installer parameters
|
118 |
; VIX_PACKAGING_PARAMETERS_SUBKEY - A Subdir of VIX_PACKAGING_SUBKEY that can contain installer parameters
|
| 118 |
; Used by VIX_SAVE_PACKAGING_PARAMETER & VIX_GET_PACKAGING_PARAMETER macros
|
119 |
; Used by VIX_SAVE_PACKAGING_PARAMETER & VIX_GET_PACKAGING_PARAMETER macros
|
| 119 |
; to save and retrieve installer parameters
|
120 |
; to save and retrieve installer parameters
|
| 120 |
;
|
121 |
;
|
| Line 131... |
Line 132... |
| 131 |
; SectionEnd
|
132 |
; SectionEnd
|
| 132 |
|
133 |
|
| 133 |
!define VIX_CREATE_PACKAGING_REGISTRY `!insertmacro VIX_CREATE_PACKAGING_REGISTRY`
|
134 |
!define VIX_CREATE_PACKAGING_REGISTRY `!insertmacro VIX_CREATE_PACKAGING_REGISTRY`
|
| 134 |
!macro VIX_CREATE_PACKAGING_REGISTRY
|
135 |
!macro VIX_CREATE_PACKAGING_REGISTRY
|
| 135 |
|
136 |
|
| - |
|
137 |
!ifdef VIX_PACKAGING_ROOTKEY
|
| - |
|
138 |
!undef VIX_PACKAGING_ROOTKEY
|
| - |
|
139 |
!endif
|
| - |
|
140 |
!define VIX_PACKAGING_ROOTKEY "SOFTWARE\ERG\AFC"
|
| 136 |
!ifdef VIX_PACKAGING_SUBKEY
|
141 |
!ifdef VIX_PACKAGING_SUBKEY
|
| 137 |
!undef VIX_PACKAGING_SUBKEY
|
142 |
!undef VIX_PACKAGING_SUBKEY
|
| 138 |
!endif
|
143 |
!endif
|
| 139 |
!define VIX_PACKAGING_SUBKEY "SOFTWARE\ERG\AFC\${GBE_PACKAGE}"
|
144 |
!define VIX_PACKAGING_SUBKEY "${VIX_PACKAGING_ROOTKEY}\${GBE_PACKAGE}"
|
| 140 |
!ifdef VIX_PACKAGING_PARAMETERS_SUBKEY
|
145 |
!ifdef VIX_PACKAGING_PARAMETERS_SUBKEY
|
| 141 |
!undef VIX_PACKAGING_PARAMETERS_SUBKEY
|
146 |
!undef VIX_PACKAGING_PARAMETERS_SUBKEY
|
| 142 |
!endif
|
147 |
!endif
|
| 143 |
!define VIX_PACKAGING_PARAMETERS_SUBKEY "SOFTWARE\ERG\AFC\${GBE_PACKAGE}\InstallParameters"
|
148 |
!define VIX_PACKAGING_PARAMETERS_SUBKEY "${VIX_PACKAGING_ROOTKEY}\${GBE_PACKAGE}\InstallParameters"
|
| 144 |
|
149 |
|
| 145 |
ClearErrors
|
150 |
ClearErrors
|
| 146 |
|
151 |
|
| 147 |
; Determine the install time in format MM-DD-YYYY HH:MM:SS
|
152 |
; Determine the install time in format MM-DD-YYYY HH:MM:SS
|
| 148 |
${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6
|
153 |
${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6
|
| Line 198... |
Line 203... |
| 198 |
|
203 |
|
| 199 |
!macroend
|
204 |
!macroend
|
| 200 |
|
205 |
|
| 201 |
|
206 |
|
| 202 |
|
207 |
|
| - |
|
208 |
;---------------------------------------------------------------------------------------------------
|
| - |
|
209 |
; macro VIX_CHECK_VIXPKG_PREREQ
|
| - |
|
210 |
; Checks the VIX_PACKAGING_ROOTKEY for PKGNAME to see if package has been intalled.
|
| - |
|
211 |
; This is for VIX packages that create the registry entries using VIX_CREATE_PACKAGING_REGISTRY in NSIS or in installshield
|
| - |
|
212 |
; It does not use the Uninstaller registry locations
|
| - |
|
213 |
;
|
| - |
|
214 |
; Parameters
|
| - |
|
215 |
; PKGNAME - The name of the VIX Package to look for
|
| - |
|
216 |
; KEYVALUE - A Variable that has PKGNAME appended to it if PkgName is not installed.
|
| - |
|
217 |
;
|
| - |
|
218 |
; Used in .onInit function
|
| - |
|
219 |
; Declare Global var first
|
| - |
|
220 |
; Var MISSING_PREREQ
|
| - |
|
221 |
; Then in .onInit
|
| - |
|
222 |
; ${VIX_CHECK_VIXPKG_PREREQ} "ERGcots" $MISSING_PREREQ
|
| - |
|
223 |
; ${VIX_CHECK_VIXPKG_PREREQ} "ERGsnmpagt" $MISSING_PREREQ
|
| - |
|
224 |
;StrCmp $MISSING_PREREQ "" +2
|
| - |
|
225 |
; MessageBox MB_OK|MB_ICONINFORMATION 'The following pre-requisite Package(s) are not installed. Please install to complete installation$\n$MISSING_PREREQ' /SD IDOK
|
| - |
|
226 |
|
| - |
|
227 |
!define VIX_CHECK_VIXPKG_PREREQ `!insertmacro VIX_CHECK_VIXPKG_PREREQ`
|
| - |
|
228 |
!macro VIX_CHECK_VIXPKG_PREREQ PKGNAME PKGSNOTFOUND
|
| - |
|
229 |
|
| - |
|
230 |
ClearErrors
|
| - |
|
231 |
|
| - |
|
232 |
!ifndef VIX_PACKAGING_ROOTKEY
|
| - |
|
233 |
!error "The VIX_CHECK_VIXPKG_PREREQ macro must be inserted in script after VIX_CREATE_PACKAGING_REGISTRY"
|
| - |
|
234 |
!endif
|
| - |
|
235 |
|
| - |
|
236 |
push $0
|
| - |
|
237 |
ReadRegStr $0 HKLM "${VIX_PACKAGING_ROOTKEY}\${PKGNAME}" "PkgName"
|
| - |
|
238 |
IfErrors 0 +5
|
| - |
|
239 |
StrCmp ${PKGSNOTFOUND} "" +3
|
| - |
|
240 |
StrCpy ${PKGSNOTFOUND} "${PKGSNOTFOUND}, ${PKGNAME}"
|
| - |
|
241 |
Goto +2
|
| - |
|
242 |
StrCpy ${PKGSNOTFOUND} "${PKGNAME}"
|
| - |
|
243 |
|
| - |
|
244 |
pop $0
|
| - |
|
245 |
!macroend
|
| - |
|
246 |
|
| - |
|
247 |
|
| 203 |
|
248 |
|
| 204 |
;---------------------------------------------------------------------------------------------------
|
249 |
;---------------------------------------------------------------------------------------------------
|
| 205 |
; macro VIX_SAVE_PACKAGING_PARAMETER
|
250 |
; macro VIX_SAVE_PACKAGING_PARAMETER
|
| 206 |
; Saves key values in VIX_PACKAGING_PARAMETERS_SUBKEY registry for recall on when installing new version
|
251 |
; Saves key values in VIX_PACKAGING_PARAMETERS_SUBKEY registry for recall on when installing new version
|
| 207 |
; Must be inserted in your script after the insertion of VIX_CREATE_PACKAGING_REGISTRY for required defines
|
252 |
; Must be inserted in your script after the insertion of VIX_CREATE_PACKAGING_REGISTRY for required defines
|
| Line 266... |
Line 311... |
| 266 |
!ifndef VIX_UNINSTALL_KEY
|
311 |
!ifndef VIX_UNINSTALL_KEY
|
| 267 |
!error "The VIX_SETINSTDIR_IFINSTALLED macro must be inserted in script after VIX_CREATE_UNINSTALLER_AND_REGISTRY"
|
312 |
!error "The VIX_SETINSTDIR_IFINSTALLED macro must be inserted in script after VIX_CREATE_UNINSTALLER_AND_REGISTRY"
|
| 268 |
!endif
|
313 |
!endif
|
| 269 |
|
314 |
|
| 270 |
ClearErrors
|
315 |
ClearErrors
|
| 271 |
|
316 |
|
| - |
|
317 |
push $0
|
| 272 |
ReadRegStr $0 HKLM ${VIX_UNINSTALL_KEY} "InstallLocation"
|
318 |
ReadRegStr $0 HKLM ${VIX_UNINSTALL_KEY} "InstallLocation"
|
| 273 |
IfErrors +2 0
|
319 |
IfErrors +2 0
|
| 274 |
; set default installdir to what was previously used
|
320 |
; set default installdir to what was previously used
|
| 275 |
StrCpy $INSTDIR $0
|
321 |
StrCpy $INSTDIR $0
|
| 276 |
|
322 |
|
| 277 |
Nop
|
323 |
Pop $0
|
| 278 |
!macroend
|
324 |
!macroend
|
| 279 |
|
325 |
|
| 280 |
|
326 |
|
| 281 |
;---------------------------------------------------------------------------------------------------
|
327 |
;---------------------------------------------------------------------------------------------------
|
| 282 |
; macro VIX_ONINIT_UNINSTALL_EXISTING_VERSION
|
328 |
; macro VIX_ONINIT_UNINSTALL_EXISTING_VERSION
|
| Line 286... |
Line 332... |
| 286 |
;
|
332 |
;
|
| 287 |
; Parameter:
|
333 |
; Parameter:
|
| 288 |
; OLDVERSION: Contains the version number of the uninstalled version (or ???? if old version is detected but cant get version number)
|
334 |
; OLDVERSION: Contains the version number of the uninstalled version (or ???? if old version is detected but cant get version number)
|
| 289 |
; otherwise set to empty string to indicate no uninstall is done
|
335 |
; otherwise set to empty string to indicate no uninstall is done
|
| 290 |
;
|
336 |
;
|
| 291 |
; Uses registers $0, $1, $2, $3 without saving
|
337 |
; Uses registers $0, $1, $2, $3
|
| 292 |
;
|
338 |
;
|
| 293 |
!define VIX_ONINIT_UNINSTALL_EXISTING_VERSION `!insertmacro VIX_ONINIT_UNINSTALL_EXISTING_VERSION`
|
339 |
!define VIX_ONINIT_UNINSTALL_EXISTING_VERSION `!insertmacro VIX_ONINIT_UNINSTALL_EXISTING_VERSION`
|
| 294 |
!macro VIX_ONINIT_UNINSTALL_EXISTING_VERSION OLDVERSION
|
340 |
!macro VIX_ONINIT_UNINSTALL_EXISTING_VERSION OLDVERSION
|
| 295 |
|
341 |
|
| 296 |
!ifndef VIX_UNINSTALL_KEY
|
342 |
!ifndef VIX_UNINSTALL_KEY
|
| 297 |
!error "The VIX_ONINIT_UNINSTALL_EXISTING_VERSION macro must be inserted in script after VIX_CREATE_UNINSTALLER_AND_REGISTRY"
|
343 |
!error "The VIX_ONINIT_UNINSTALL_EXISTING_VERSION macro must be inserted in script after VIX_CREATE_UNINSTALLER_AND_REGISTRY"
|
| 298 |
!endif
|
344 |
!endif
|
| 299 |
|
345 |
|
| 300 |
ClearErrors
|
346 |
ClearErrors
|
| 301 |
|
347 |
|
| - |
|
348 |
push $0
|
| - |
|
349 |
push $1
|
| - |
|
350 |
push $2
|
| - |
|
351 |
push $3
|
| - |
|
352 |
|
| 302 |
StrCpy ${OLDVERSION} "" ; Empty string indicates no uninstall done
|
353 |
StrCpy ${OLDVERSION} "" ; Empty string indicates no uninstall done
|
| 303 |
|
354 |
|
| 304 |
; If these are not in registry then package is not installed so do nothing
|
355 |
; If these are not in registry then package is not installed so do nothing
|
| 305 |
ReadRegStr $0 HKLM ${VIX_UNINSTALL_KEY} "UninstallString"
|
356 |
ReadRegStr $0 HKLM ${VIX_UNINSTALL_KEY} "UninstallString"
|
| 306 |
IfErrors Label.VIX_ONINIT_UNINSTALL_EXISTING_VERSION.done
|
357 |
IfErrors Label.VIX_ONINIT_UNINSTALL_EXISTING_VERSION.done
|
| Line 333... |
Line 384... |
| 333 |
MessageBox MB_OK "Failed to uninstall current version"
|
384 |
MessageBox MB_OK "Failed to uninstall current version"
|
| 334 |
Abort
|
385 |
Abort
|
| 335 |
Delete $3
|
386 |
Delete $3
|
| 336 |
|
387 |
|
| 337 |
Label.VIX_ONINIT_UNINSTALL_EXISTING_VERSION.done:
|
388 |
Label.VIX_ONINIT_UNINSTALL_EXISTING_VERSION.done:
|
| - |
|
389 |
pop $3
|
| - |
|
390 |
pop $2
|
| - |
|
391 |
pop $1
|
| - |
|
392 |
pop $0
|
| 338 |
|
393 |
|
| 339 |
!macroend
|
394 |
!macroend
|