1 | ; $Id: VBoxGuestAdditionsUninstallOld.nsh 108772 2025-03-27 15:32:33Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; VBoxGuestAdditionsUninstallOld.nsh - Guest Additions uninstallation and migration handling
|
---|
4 | ; for older Guest Additions and legacy (Sun [xVM] / innotek) packages.
|
---|
5 | ;
|
---|
6 |
|
---|
7 | ;
|
---|
8 | ; Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
9 | ;
|
---|
10 | ; This file is part of VirtualBox base platform packages, as
|
---|
11 | ; available from https://www.virtualbox.org.
|
---|
12 | ;
|
---|
13 | ; This program is free software; you can redistribute it and/or
|
---|
14 | ; modify it under the terms of the GNU General Public License
|
---|
15 | ; as published by the Free Software Foundation, in version 3 of the
|
---|
16 | ; License.
|
---|
17 | ;
|
---|
18 | ; This program is distributed in the hope that it will be useful, but
|
---|
19 | ; WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
21 | ; General Public License for more details.
|
---|
22 | ;
|
---|
23 | ; You should have received a copy of the GNU General Public License
|
---|
24 | ; along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
25 | ;
|
---|
26 | ; SPDX-License-Identifier: GPL-3.0-only
|
---|
27 | ;
|
---|
28 |
|
---|
29 | !macro Uninstall_WipeInstallationDirectory un
|
---|
30 | ;;
|
---|
31 | ; Wipes the installation directory (recursively).
|
---|
32 | ;
|
---|
33 | ; Only used for wiping legacy installations (innotek, Sun, Sun xVM).
|
---|
34 | ;
|
---|
35 | ; Input:
|
---|
36 | ; Stack[0]: Installation directory to wipe.
|
---|
37 | ; Output:
|
---|
38 | ; Stack[0}: Return code. 0 means success.
|
---|
39 | ;
|
---|
40 | Function ${un}Uninstall_WipeInstallationDirectory
|
---|
41 |
|
---|
42 | Pop $0
|
---|
43 | Push $1
|
---|
44 | Push $2
|
---|
45 |
|
---|
46 | ; Do some basic sanity checks for not screwing up too fatal ...
|
---|
47 | ${LogVerbose} "Removing old installation directory ($0) ..."
|
---|
48 | ${If} $0 != $PROGRAMFILES
|
---|
49 | ${AndIf} $0 != $PROGRAMFILES32
|
---|
50 | ${AndIf} $0 != $PROGRAMFILES64
|
---|
51 | ${AndIf} $0 != $COMMONFILES32
|
---|
52 | ${AndIf} $0 != $COMMONFILES64
|
---|
53 | ${AndIf} $0 != $WINDIR
|
---|
54 | ${AndIf} $0 != $SYSDIR
|
---|
55 | ${LogVerbose} "Wiping ($0) ..."
|
---|
56 | Goto wipe
|
---|
57 | ${EndIf}
|
---|
58 | Goto wipe_abort
|
---|
59 |
|
---|
60 | wipe:
|
---|
61 |
|
---|
62 | RMDir /r /REBOOTOK "$0"
|
---|
63 | StrCpy $0 0 ; All went well.
|
---|
64 | Goto exit
|
---|
65 |
|
---|
66 | wipe_abort:
|
---|
67 |
|
---|
68 | ${LogVerbose} "Won't remove directory ($0)!"
|
---|
69 | StrCpy $0 1 ; Signal some failure.
|
---|
70 | Goto exit
|
---|
71 |
|
---|
72 | exit:
|
---|
73 |
|
---|
74 | Pop $2
|
---|
75 | Pop $1
|
---|
76 | Push $0
|
---|
77 |
|
---|
78 | FunctionEnd
|
---|
79 | !macroend
|
---|
80 | !insertmacro Uninstall_WipeInstallationDirectory ""
|
---|
81 |
|
---|
82 |
|
---|
83 | !ifndef UNINSTALLER_ONLY
|
---|
84 | !macro Uninstall_Before7_2 un
|
---|
85 | ;;
|
---|
86 | ; Uninstalls all files of a < 7.2 Guest Additions installation.
|
---|
87 | ;
|
---|
88 | ; These were stored in a "flat" hierarchy directly in the installation directory,
|
---|
89 | ; which made it impossible to tell which files belong to which component.
|
---|
90 | ;
|
---|
91 | ; This also will be run when installing 7.2 Guest Additions to clean things up.
|
---|
92 | ;
|
---|
93 | ; Input:
|
---|
94 | ; None
|
---|
95 | ; Output:
|
---|
96 | ; None
|
---|
97 | ;
|
---|
98 | Function ${un}Uninstall_Before7_2
|
---|
99 |
|
---|
100 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
|
---|
101 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
|
---|
102 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
|
---|
103 | Delete /REBOOTOK "$INSTDIR\VBoxVideoEarlyNT.inf"
|
---|
104 | Delete /REBOOTOK "$INSTDIR\VBoxVideoEarlyNT.cat"
|
---|
105 | Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
|
---|
106 |
|
---|
107 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
|
---|
108 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
|
---|
109 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
|
---|
110 |
|
---|
111 | Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
|
---|
112 |
|
---|
113 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
|
---|
114 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
|
---|
115 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
|
---|
116 | Delete /REBOOTOK "$INSTDIR\VBoxGuestEarlyNT.inf"
|
---|
117 | Delete /REBOOTOK "$INSTDIR\VBoxGuestEarlyNT.cat"
|
---|
118 |
|
---|
119 | Delete /REBOOTOK "$INSTDIR\VBCoInst.dll" ; Deprecated, does not get installed anymore.
|
---|
120 | Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
|
---|
121 | Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
|
---|
122 | Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"; Removed in r152293 (runup to 7.0).
|
---|
123 | Delete /REBOOTOK "$INSTDIR\VBoxICD.dll" ; Removed in r151892 (runup to 7.0).
|
---|
124 |
|
---|
125 | !if $%VBOX_WITH_WDDM% == "1"
|
---|
126 | Delete /REBOOTOK "$INSTDIR\VBoxWddm.cat"
|
---|
127 | Delete /REBOOTOK "$INSTDIR\VBoxWddm.sys"
|
---|
128 | Delete /REBOOTOK "$INSTDIR\VBoxWddm.inf"
|
---|
129 | ; Obsolete files begin
|
---|
130 | Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.cat"
|
---|
131 | Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.sys"
|
---|
132 | Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.inf"
|
---|
133 | Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.cat"
|
---|
134 | Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.sys"
|
---|
135 | Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.inf"
|
---|
136 | ; Obsolete files end
|
---|
137 | Delete /REBOOTOK "$INSTDIR\VBoxDispD3D.dll"
|
---|
138 | !if $%VBOX_WITH_WDDM_DX% == "1"
|
---|
139 | Delete /REBOOTOK "$INSTDIR\VBoxDX.dll"
|
---|
140 | !endif
|
---|
141 | !if $%VBOX_WITH_MESA3D% == "1"
|
---|
142 | Delete /REBOOTOK "$INSTDIR\VBoxNine.dll"
|
---|
143 | Delete /REBOOTOK "$INSTDIR\VBoxSVGA.dll"
|
---|
144 | Delete /REBOOTOK "$INSTDIR\VBoxICD.dll"
|
---|
145 | Delete /REBOOTOK "$INSTDIR\VBoxGL.dll"
|
---|
146 | !endif
|
---|
147 |
|
---|
148 | Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm.dll"
|
---|
149 | Delete /REBOOTOK "$INSTDIR\wined3dwddm.dll"
|
---|
150 | ; Try to delete libWine in case it is there from old installation.
|
---|
151 | Delete /REBOOTOK "$INSTDIR\libWine.dll"
|
---|
152 |
|
---|
153 | !if $%KBUILD_TARGET_ARCH% == "amd64"
|
---|
154 | Delete /REBOOTOK "$INSTDIR\VBoxDispD3D-x86.dll"
|
---|
155 | !if $%VBOX_WITH_WDDM_DX% == "1"
|
---|
156 | Delete /REBOOTOK "$INSTDIR\VBoxDX-x86.dll"
|
---|
157 | !endif
|
---|
158 | !if $%VBOX_WITH_MESA3D% == "1"
|
---|
159 | Delete /REBOOTOK "$INSTDIR\VBoxNine-x86.dll"
|
---|
160 | Delete /REBOOTOK "$INSTDIR\VBoxSVGA-x86.dll"
|
---|
161 | Delete /REBOOTOK "$INSTDIR\VBoxICD-x86.dll"
|
---|
162 | Delete /REBOOTOK "$INSTDIR\VBoxGL-x86.dll"
|
---|
163 | !endif
|
---|
164 |
|
---|
165 | Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm-x86.dll"
|
---|
166 | Delete /REBOOTOK "$INSTDIR\wined3dwddm-x86.dll"
|
---|
167 | !endif ; $%KBUILD_TARGET_ARCH% == "amd64"
|
---|
168 | !endif ; $%VBOX_WITH_WDDM% == "1"
|
---|
169 |
|
---|
170 | Delete /REBOOTOK "$INSTDIR\RegCleanup.exe" ; Obsolete since r165894 (see #10799).
|
---|
171 | Delete /REBOOTOK "$INSTDIR\VBoxDrvInst.exe"
|
---|
172 | Delete /REBOOTOK "$INSTDIR\VBoxGuestInstallHelper.exe"
|
---|
173 |
|
---|
174 | Delete "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" ; Old name. Changed to Website.url in r153663.
|
---|
175 | Delete "$DESKTOP\${PRODUCT_NAME}.lnk" ; Obsolete. We don't install a desktop link any more.
|
---|
176 |
|
---|
177 | FunctionEnd
|
---|
178 | !macroend
|
---|
179 | !insertmacro Uninstall_Before7_2 ""
|
---|
180 | !endif ; UNINSTALLER_ONLY
|
---|
181 |
|
---|
182 |
|
---|
183 | !macro Uninstall_Sun un
|
---|
184 | ;;
|
---|
185 | ; Function to clean up an old Sun (pre-Oracle) installation.
|
---|
186 | ;
|
---|
187 | ; Input:
|
---|
188 | ; None
|
---|
189 | ; Output:
|
---|
190 | ; None
|
---|
191 | ;
|
---|
192 | Function ${un}Uninstall_Sun
|
---|
193 |
|
---|
194 | Push $0
|
---|
195 | Push $1
|
---|
196 | Push $2
|
---|
197 |
|
---|
198 | ; Get current installation path.
|
---|
199 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
|
---|
200 | StrCmp $0 "" exit
|
---|
201 |
|
---|
202 | ; Extract path
|
---|
203 | Push "$0" ; String
|
---|
204 | Push "\" ; SubString
|
---|
205 | Push "<" ; SearchDirection
|
---|
206 | Push "<" ; StrInclusionDirection
|
---|
207 | Push "0" ; IncludeSubString
|
---|
208 | Push "0" ; Loops
|
---|
209 | Push "0" ; CaseSensitive
|
---|
210 | Call ${un}StrStrAdv
|
---|
211 | Pop $1 ; $1 only contains the full path
|
---|
212 |
|
---|
213 | StrCmp $1 "" exit
|
---|
214 |
|
---|
215 | ; Save current i8042prt info to new uninstall registry path.
|
---|
216 | ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
|
---|
217 | WriteRegStr HKLM "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}" $0
|
---|
218 |
|
---|
219 | ; Try to wipe current installation directory.
|
---|
220 | Push $1 ; Push uninstaller path to stack.
|
---|
221 | Call ${un}Uninstall_WipeInstallationDirectory
|
---|
222 | Pop $2 ; Get uninstaller exit code from stack
|
---|
223 | StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit.
|
---|
224 |
|
---|
225 | common:
|
---|
226 |
|
---|
227 | ; Make sure everything is cleaned up in case the old uninstaller did forget something.
|
---|
228 | DeleteRegKey HKLM "SOFTWARE\Sun\VirtualBox Guest Additions"
|
---|
229 | DeleteRegKey /ifempty HKLM "SOFTWARE\Sun"
|
---|
230 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions"
|
---|
231 | Delete /REBOOTOK "$1\netamd.inf"
|
---|
232 | Delete /REBOOTOK "$1\pcntpci5.cat"
|
---|
233 | Delete /REBOOTOK "$1\PCNTPCI5.sys"
|
---|
234 |
|
---|
235 | ; Try to remove old installation directory if empty.
|
---|
236 | RMDir /r /REBOOTOK "$SMPROGRAMS\Sun VirtualBox Guest Additions"
|
---|
237 | RMDir /REBOOTOK "$1"
|
---|
238 |
|
---|
239 | ; Get original mouse driver info and restore it.
|
---|
240 | ;ReadRegStr $0 "${REGISTRY_KEY_UNINST_ROOT}" "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
|
---|
241 | ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
|
---|
242 | ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys"
|
---|
243 |
|
---|
244 | ; Delete vendor installation directory (only if completely empty)
|
---|
245 | !if $%KBUILD_TARGET_ARCH% == "x86"
|
---|
246 | RMDir /REBOOTOK "$PROGRAMFILES32\Sun"
|
---|
247 | !else ; 64-bit
|
---|
248 | RMDir /REBOOTOK "$PROGRAMFILES64\Sun"
|
---|
249 | !endif
|
---|
250 |
|
---|
251 | exit:
|
---|
252 |
|
---|
253 | Pop $2
|
---|
254 | Pop $1
|
---|
255 | Pop $0
|
---|
256 |
|
---|
257 | FunctionEnd
|
---|
258 | !macroend
|
---|
259 | !insertmacro Uninstall_Sun ""
|
---|
260 |
|
---|
261 |
|
---|
262 | !macro Uninstall_SunXVM un
|
---|
263 | ;;
|
---|
264 | ; Function to clean up an old Sun xVM installation.
|
---|
265 | ;
|
---|
266 | ; Input:
|
---|
267 | ; None
|
---|
268 | ; Output:
|
---|
269 | ; None
|
---|
270 | ;
|
---|
271 | Function ${un}Uninstall_SunXVM
|
---|
272 |
|
---|
273 | Push $0
|
---|
274 | Push $1
|
---|
275 | Push $2
|
---|
276 |
|
---|
277 | ; Get current installation path.
|
---|
278 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
|
---|
279 | StrCmp $0 "" exit
|
---|
280 |
|
---|
281 | ; Extract path.
|
---|
282 | Push "$0" ; String
|
---|
283 | Push "\" ; SubString
|
---|
284 | Push "<" ; SearchDirection
|
---|
285 | Push "<" ; StrInclusionDirection
|
---|
286 | Push "0" ; IncludeSubString
|
---|
287 | Push "0" ; Loops
|
---|
288 | Push "0" ; CaseSensitive
|
---|
289 | Call ${un}StrStrAdv
|
---|
290 | Pop $1 ; $1 only contains the full path
|
---|
291 |
|
---|
292 | StrCmp $1 "" exit
|
---|
293 |
|
---|
294 | ; Save current i8042prt info to new uninstall registry path.
|
---|
295 | ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" ${REGISTRY_VAL_ORG_MOUSE_PATH}
|
---|
296 | WriteRegStr HKLM "${REGISTRY_KEY_UNINST_PRODUCT}" ${REGISTRY_VAL_ORG_MOUSE_PATH} $0
|
---|
297 |
|
---|
298 | ; Try to wipe current installation directory.
|
---|
299 | Push $1 ; Push uninstaller path to stack.
|
---|
300 | Call ${un}Uninstall_WipeInstallationDirectory
|
---|
301 | Pop $2 ; Get uninstaller exit code from stack.
|
---|
302 | StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit.
|
---|
303 |
|
---|
304 | common:
|
---|
305 |
|
---|
306 | ; Make sure everything is cleaned up in case the old uninstaller did forget something.
|
---|
307 | DeleteRegKey HKLM "SOFTWARE\Sun\xVM VirtualBox Guest Additions"
|
---|
308 | DeleteRegKey /ifempty HKLM "SOFTWARE\Sun"
|
---|
309 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions"
|
---|
310 | Delete /REBOOTOK "$1\netamd.inf"
|
---|
311 | Delete /REBOOTOK "$1\pcntpci5.cat"
|
---|
312 | Delete /REBOOTOK "$1\PCNTPCI5.sys"
|
---|
313 |
|
---|
314 | ; Try to remove old installation directory if empty.
|
---|
315 | RMDir /r /REBOOTOK "$SMPROGRAMS\Sun xVM VirtualBox Guest Additions"
|
---|
316 | RMDir /REBOOTOK "$1"
|
---|
317 |
|
---|
318 | ; Delete vendor installation directory (only if completely empty).
|
---|
319 | !if $%KBUILD_TARGET_ARCH% == "x86"
|
---|
320 | RMDir /REBOOTOK "$PROGRAMFILES32\Sun"
|
---|
321 | !else
|
---|
322 | RMDir /REBOOTOK "$PROGRAMFILES64\Sun"
|
---|
323 | !endif
|
---|
324 |
|
---|
325 | ; Get original mouse driver info and restore it.
|
---|
326 | ;ReadRegStr $0 "${REGISTRY_KEY_UNINST_ROOT}" "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
|
---|
327 | ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
|
---|
328 | ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys"
|
---|
329 |
|
---|
330 | exit:
|
---|
331 |
|
---|
332 | Pop $2
|
---|
333 | Pop $1
|
---|
334 | Pop $0
|
---|
335 |
|
---|
336 | FunctionEnd
|
---|
337 | !macroend
|
---|
338 | !insertmacro Uninstall_SunXVM ""
|
---|
339 |
|
---|
340 |
|
---|
341 | !macro Uninstall_Innotek un
|
---|
342 | ;;
|
---|
343 | ; Function to clean up an old innotek installation.
|
---|
344 | ;
|
---|
345 | ; Input:
|
---|
346 | ; None
|
---|
347 | ; Output:
|
---|
348 | ; None
|
---|
349 | ;
|
---|
350 | Function ${un}Uninstall_Innotek
|
---|
351 |
|
---|
352 | Push $0
|
---|
353 | Push $1
|
---|
354 | Push $2
|
---|
355 |
|
---|
356 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
|
---|
357 | StrCmp $0 "" exit
|
---|
358 |
|
---|
359 | ; Extract path
|
---|
360 | Push "$0" ; String
|
---|
361 | Push "\" ; SubString
|
---|
362 | Push "<" ; SearchDirection
|
---|
363 | Push "<" ; StrInclusionDirection
|
---|
364 | Push "0" ; IncludeSubString
|
---|
365 | Push "0" ; Loops
|
---|
366 | Push "0" ; CaseSensitive
|
---|
367 | Call ${un}StrStrAdv
|
---|
368 | Pop $1 ; $1 only contains the full path
|
---|
369 |
|
---|
370 | StrCmp $1 "" exit
|
---|
371 |
|
---|
372 | ; Save current i8042prt info to new uninstall registry path.
|
---|
373 | ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
|
---|
374 | WriteRegStr HKLM "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}" $0
|
---|
375 |
|
---|
376 | ; Try to wipe current installation directory.
|
---|
377 | Push $1 ; Push uninstaller path to stack.
|
---|
378 | Call ${un}Uninstall_WipeInstallationDirectory
|
---|
379 | Pop $2 ; Get uninstaller exit code from stack.
|
---|
380 | StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit.
|
---|
381 |
|
---|
382 | common:
|
---|
383 |
|
---|
384 | ; Remove left over files which were not entirely cached by the formerly running uninstaller.
|
---|
385 | DeleteRegKey HKLM "SOFTWARE\innotek\VirtualBox Guest Additions"
|
---|
386 | DeleteRegKey HKLM "SOFTWARE\innotek"
|
---|
387 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions"
|
---|
388 | Delete /REBOOTOK "$1\VBoxGuestDrvInst.exe"
|
---|
389 | Delete /REBOOTOK "$1\VBoxMouseInst.exe"
|
---|
390 | Delete /REBOOTOK "$1\VBoxSFDrvInst.exe"
|
---|
391 | Delete /REBOOTOK "$1\RegCleanup.exe"
|
---|
392 | Delete /REBOOTOK "$1\VBoxService.exe"
|
---|
393 | Delete /REBOOTOK "$1\VBoxMouseInst.exe"
|
---|
394 | Delete /REBOOTOK "$1\innotek VirtualBox Guest Additions.url"
|
---|
395 | Delete /REBOOTOK "$1\uninst.exe"
|
---|
396 | Delete /REBOOTOK "$1\iexplore.ico"
|
---|
397 | Delete /REBOOTOK "$1\install.log"
|
---|
398 | Delete /REBOOTOK "$1\VBCoInst.dll"
|
---|
399 | Delete /REBOOTOK "$1\VBoxControl.exe"
|
---|
400 | Delete /REBOOTOK "$1\VBoxDisp.dll"
|
---|
401 | Delete /REBOOTOK "$1\VBoxGINA.dll"
|
---|
402 | Delete /REBOOTOK "$1\VBoxGuest.cat"
|
---|
403 | Delete /REBOOTOK "$1\VBoxGuest.inf"
|
---|
404 | Delete /REBOOTOK "$1\VBoxGuest.sys"
|
---|
405 | Delete /REBOOTOK "$1\VBoxMouse.inf"
|
---|
406 | Delete /REBOOTOK "$1\VBoxMouse.sys"
|
---|
407 | Delete /REBOOTOK "$1\VBoxVideo.cat"
|
---|
408 | Delete /REBOOTOK "$1\VBoxVideo.inf"
|
---|
409 | Delete /REBOOTOK "$1\VBoxVideo.sys"
|
---|
410 |
|
---|
411 | ; Try to remove old installation directory if empty.
|
---|
412 | RMDir /r /REBOOTOK "$SMPROGRAMS\innotek VirtualBox Guest Additions"
|
---|
413 | RMDir /REBOOTOK "$1"
|
---|
414 |
|
---|
415 | ; Delete vendor installation directory (only if completely empty).
|
---|
416 | !if $%KBUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
417 | RMDir /REBOOTOK "$PROGRAMFILES32\innotek"
|
---|
418 | !else ; 64-bit
|
---|
419 | RMDir /REBOOTOK "$PROGRAMFILES64\innotek"
|
---|
420 | !endif
|
---|
421 |
|
---|
422 | ; Get original mouse driver info and restore it.
|
---|
423 | ;ReadRegStr $0 "${REGISTRY_KEY_UNINST_ROOT}" "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
|
---|
424 | ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
|
---|
425 | ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys".
|
---|
426 |
|
---|
427 | exit:
|
---|
428 |
|
---|
429 | Pop $2
|
---|
430 | Pop $1
|
---|
431 | Pop $0
|
---|
432 |
|
---|
433 | FunctionEnd
|
---|
434 | !macroend
|
---|
435 | !insertmacro Uninstall_Innotek ""
|
---|
436 |
|
---|
437 |
|
---|
438 | ;;
|
---|
439 | ; Handles uninstallation of legacy Guest Additions and/or performs necessary migration steps.
|
---|
440 | ;
|
---|
441 | ; Input:
|
---|
442 | ; None
|
---|
443 | ; Output:
|
---|
444 | ; None
|
---|
445 | ;
|
---|
446 | Function HandleOldGuestAdditions
|
---|
447 |
|
---|
448 | Push $0
|
---|
449 | Push $1
|
---|
450 | Push $2
|
---|
451 |
|
---|
452 | ${LogVerbose} "Checking for old Guest Additions ..."
|
---|
453 |
|
---|
454 | ; Check for old "Sun VirtualBox Guest Additions"
|
---|
455 | ; - before rebranding to Oracle
|
---|
456 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
|
---|
457 | ${If} $0 == ""
|
---|
458 | goto sun_xvm_check ; If string is empty, Sun additions are probably not installed (anymore)
|
---|
459 | ${EndIf}
|
---|
460 |
|
---|
461 | MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_uninstall
|
---|
462 | Pop $2
|
---|
463 | Pop $1
|
---|
464 | Pop $0
|
---|
465 | MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
|
---|
466 | Quit
|
---|
467 |
|
---|
468 | sun_uninstall:
|
---|
469 |
|
---|
470 | Call Uninstall_Sun
|
---|
471 | Goto migration_check
|
---|
472 |
|
---|
473 | sun_xvm_check:
|
---|
474 |
|
---|
475 | ; Check for old "Sun xVM VirtualBox Guest Additions"
|
---|
476 | ; - before getting rid of the "xVM" namespace
|
---|
477 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
|
---|
478 | ${If} $0 == ""
|
---|
479 | goto innotek_check ; If string is empty, Sun xVM additions are probably not installed (anymore).
|
---|
480 | ${EndIf}
|
---|
481 |
|
---|
482 | MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_xvm_uninstall
|
---|
483 | Pop $2
|
---|
484 | Pop $1
|
---|
485 | Pop $0
|
---|
486 | MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
|
---|
487 | Quit
|
---|
488 |
|
---|
489 | sun_xvm_uninstall:
|
---|
490 |
|
---|
491 | Call Uninstall_SunXVM
|
---|
492 | Goto migration_check
|
---|
493 |
|
---|
494 | innotek_check:
|
---|
495 |
|
---|
496 | ; Check for old "innotek" Guest Additions" before rebranding to "Sun".
|
---|
497 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
|
---|
498 | ${If} $0 == ""
|
---|
499 | goto migration_check ; If string is empty, innotek Guest Additions are probably not installed (anymore).
|
---|
500 | ${EndIf}
|
---|
501 |
|
---|
502 | MessageBox MB_YESNO $(VBOX_INNOTEK_FOUND) /SD IDYES IDYES innotek_uninstall
|
---|
503 | Pop $2
|
---|
504 | Pop $1
|
---|
505 | Pop $0
|
---|
506 | MessageBox MB_ICONSTOP $(VBOX_INNOTEK_ABORTED) /SD IDOK
|
---|
507 | Quit
|
---|
508 |
|
---|
509 | innotek_uninstall:
|
---|
510 |
|
---|
511 | Call Uninstall_Innotek
|
---|
512 | Goto migration_check
|
---|
513 |
|
---|
514 | migration_check:
|
---|
515 |
|
---|
516 | ${If} $g_strAddVerMaj != ""
|
---|
517 | goto migration_perform
|
---|
518 | ${EndIf}
|
---|
519 | goto done
|
---|
520 |
|
---|
521 | migration_perform:
|
---|
522 |
|
---|
523 | ${LogVerbose} "Running migration steps ..."
|
---|
524 |
|
---|
525 | ; Migrate old(er) installation directories (< 7.2) to new structure.
|
---|
526 | Call Uninstall_Before7_2
|
---|
527 |
|
---|
528 | done:
|
---|
529 |
|
---|
530 | Pop $2
|
---|
531 | Pop $1
|
---|
532 | Pop $0
|
---|
533 |
|
---|
534 | FunctionEnd
|
---|