VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh@ 95733

Last change on this file since 95733 was 95731, checked in by vboxsync, 3 years ago

Windows Additions/Installer: Fix documentation of CmdExecute (parameter "optional" was described incorrectly), and make the legacy VBox TS CA install optional (it will fail on reinstalling the cert). bugref:8691

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 23.2 KB
Line 
1; $Id: VBoxGuestAdditionsW2KXP.nsh 95731 2022-07-19 19:18:09Z vboxsync $
2;; @file
3; VBoxGuestAdditionsW2KXP.nsh - Guest Additions installation for Windows 2000/XP.
4;
5
6;
7; Copyright (C) 2006-2022 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17
18Function W2K_SetVideoResolution
19
20 ; NSIS only supports global vars, even in functions -- great
21 Var /GLOBAL i
22 Var /GLOBAL tmp
23 Var /GLOBAL tmppath
24 Var /GLOBAL dev_id
25 Var /GLOBAL dev_desc
26
27 ; Check for all required parameters
28 StrCmp $g_iScreenX "0" exit
29 StrCmp $g_iScreenY "0" exit
30 StrCmp $g_iScreenBpp "0" exit
31
32 ${LogVerbose} "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..."
33
34 ; Enumerate all video devices (up to 32 at the moment, use key "MaxObjectNumber" key later)
35 ${For} $i 0 32
36
37 ReadRegStr $tmp HKLM "HARDWARE\DEVICEMAP\VIDEO" "\Device\Video$i"
38 StrCmp $tmp "" dev_not_found
39
40 ; Extract path to video settings
41 ; Ex: \Registry\Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
42 ; Or: \Registry\Machine\System\CurrentControlSet\Control\Video\vboxvideo\Device0
43 ; Result: Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
44 Push "$tmp" ; String
45 Push "\" ; SubString
46 Push ">" ; SearchDirection
47 Push ">" ; StrInclusionDirection
48 Push "0" ; IncludeSubString
49 Push "2" ; Loops
50 Push "0" ; CaseSensitive
51 Call StrStrAdv
52 Pop $tmppath ; $1 only contains the full path
53 StrCmp $tmppath "" dev_not_found
54
55 ; Get device description
56 ReadRegStr $dev_desc HKLM "$tmppath" "Device Description"
57!ifdef _DEBUG
58 ${LogVerbose} "Registry path: $tmppath"
59 ${LogVerbose} "Registry path to device name: $temp"
60!endif
61 ${LogVerbose} "Detected video device: $dev_desc"
62
63 ${If} $dev_desc == "VirtualBox Graphics Adapter"
64 ${LogVerbose} "VirtualBox video device found!"
65 Goto dev_found
66 ${EndIf}
67 ${Next}
68 Goto dev_not_found
69
70dev_found:
71
72 ; If we're on Windows 2000, skip the ID detection ...
73 ${If} $g_strWinVersion == "2000"
74 Goto change_res
75 ${EndIf}
76 Goto dev_found_detect_id
77
78dev_found_detect_id:
79
80 StrCpy $i 0 ; Start at index 0
81 ${LogVerbose} "Detecting device ID ..."
82
83dev_found_detect_id_loop:
84
85 ; Resolve real path to hardware instance "{GUID}"
86 EnumRegKey $dev_id HKLM "SYSTEM\CurrentControlSet\Control\Video" $i
87 StrCmp $dev_id "" dev_not_found ; No more entries? Jump out
88!ifdef _DEBUG
89 ${LogVerbose} "Got device ID: $dev_id"
90!endif
91 ReadRegStr $dev_desc HKLM "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" "Device Description" ; Try to read device name
92 ${If} $dev_desc == "VirtualBox Graphics Adapter"
93 ${LogVerbose} "Device ID of $dev_desc: $dev_id"
94 Goto change_res
95 ${EndIf}
96
97 IntOp $i $i + 1 ; Increment index
98 goto dev_found_detect_id_loop
99
100dev_not_found:
101
102 ${LogVerbose} "No VirtualBox video device (yet) detected! No custom mode set."
103 Goto exit
104
105change_res:
106
107!ifdef _DEBUG
108 ${LogVerbose} "Device description: $dev_desc"
109 ${LogVerbose} "Device ID: $dev_id"
110!endif
111
112 Var /GLOBAL reg_path_device
113 Var /GLOBAL reg_path_monitor
114
115 ${LogVerbose} "Custom mode set: Platform is Windows $g_strWinVersion"
116 ${If} $g_strWinVersion == "2000"
117 ${OrIf} $g_strWinVersion == "Vista"
118 StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0"
119 StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0\Mon00000001"
120 ${ElseIf} $g_strWinVersion == "XP"
121 ${OrIf} $g_strWinVersion == "7"
122 ${OrIf} $g_strWinVersion == "8"
123 ${OrIf} $g_strWinVersion == "8_1"
124 ${OrIf} $g_strWinVersion == "10"
125 StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
126 StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
127 ${Else}
128 ${LogVerbose} "Custom mode set: Windows $g_strWinVersion not supported yet"
129 Goto exit
130 ${EndIf}
131
132 ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
133 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD" "false"
134 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD" "false"
135 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD" "false"
136
137 ; ... and tell Windows to use that mode on next start!
138 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
139 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
140 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
141
142 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
143 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
144 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
145
146 ${LogVerbose} "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
147
148exit:
149
150FunctionEnd
151
152Function W2K_Prepare
153
154 ${If} $g_bNoVBoxServiceExit == "false"
155 ; Stop / kill VBoxService
156 Call StopVBoxService
157 ${EndIf}
158
159 ${If} $g_bNoVBoxTrayExit == "false"
160 ; Stop / kill VBoxTray
161 Call StopVBoxTray
162 ${EndIf}
163
164 ; Delete VBoxService from registry
165 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
166
167 ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
168 Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
169
170!ifdef VBOX_SIGN_ADDITIONS && VBOX_WITH_VBOX_LEGACY_TS_CA
171 ; On guest OSes < Windows 10 we always go for the PreW10 drivers and install our legacy timestamp CA.
172 ${If} $g_strWinVersion != "10"
173 ${LogVerbose} "Installing legacy timestamp CA certificate ..."
174 SetOutPath "$INSTDIR\cert"
175 FILE "$%PATH_OUT%\bin\additions\vbox-legacy-timestamp-ca.cer"
176 FILE "$%PATH_OUT%\bin\additions\VBoxCertUtil.exe"
177 ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" add-trusted-publisher --root $\"$INSTDIR\cert\vbox-legacy-timestamp-ca.cer$\"" "true"
178 ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" display-all" "true"
179 ${EndIf}
180!endif
181
182FunctionEnd
183
184Function W2K_CopyFiles
185
186 Push $0
187 SetOutPath "$INSTDIR"
188
189 ; Video driver
190 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
191 FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
192
193 ; Mouse driver
194 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
195 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
196!ifdef VBOX_SIGN_ADDITIONS
197 ${If} $g_strWinVersion == "10"
198 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
199 ${Else}
200 FILE "/oname=VBoxMouse.cat" "$%PATH_OUT%\bin\additions\VBoxMouse-PreW10.cat"
201 ${EndIf}
202!endif
203
204 ; Guest driver
205 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
206 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
207!ifdef VBOX_SIGN_ADDITIONS
208 ${If} $g_strWinVersion == "10"
209 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
210 ${Else}
211 FILE "/oname=VBoxGuest.cat" "$%PATH_OUT%\bin\additions\VBoxGuest-PreW10.cat"
212 ${EndIf}
213!endif
214
215 ; Guest driver files
216 FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
217 FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
218
219!ifdef VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
220 FILE "$%PATH_OUT%\bin\additions\VBoxAudioTest.exe"
221!endif
222
223 SetOutPath $g_strSystemDir
224
225 ; VBoxService
226 ${If} $g_bNoVBoxServiceExit == "false"
227 ; VBoxService has been terminated before, so just install the file
228 ; in the regular way
229 FILE "$%PATH_OUT%\bin\additions\VBoxService.exe"
230 ${Else}
231 ; VBoxService is in use and wasn't terminated intentionally. So extract the
232 ; new version into a temporary location and install it on next reboot
233 Push $0
234 ClearErrors
235 GetTempFileName $0
236 IfErrors 0 +3
237 ${LogVerbose} "Error getting temp file for VBoxService.exe"
238 StrCpy "$0" "$INSTDIR\VBoxServiceTemp.exe"
239 ${LogVerbose} "VBoxService is in use, will be installed on next reboot (from '$0')"
240 File "/oname=$0" "$%PATH_OUT%\bin\additions\VBoxService.exe"
241 IfErrors 0 +2
242 ${LogVerbose} "Error copying VBoxService.exe to '$0'"
243 Rename /REBOOTOK "$0" "$g_strSystemDir\VBoxService.exe"
244 IfErrors 0 +2
245 ${LogVerbose} "Error renaming '$0' to '$g_strSystemDir\VBoxService.exe'"
246 Pop $0
247 ${EndIf}
248
249!if $%VBOX_WITH_WDDM% == "1"
250 ${If} $g_bWithWDDM == "true"
251 ; WDDM Video driver
252 SetOutPath "$INSTDIR"
253
254 !ifdef VBOX_SIGN_ADDITIONS
255 ${If} $g_strWinVersion == "10"
256 FILE "$%PATH_OUT%\bin\additions\VBoxWddm.cat"
257 ${Else}
258 FILE "/oname=VBoxWddm.cat" "$%PATH_OUT%\bin\additions\VBoxWddm-PreW10.cat"
259 ${EndIf}
260 !endif
261 FILE "$%PATH_OUT%\bin\additions\VBoxWddm.sys"
262 FILE "$%PATH_OUT%\bin\additions\VBoxWddm.inf"
263
264 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
265 !if $%VBOX_WITH_WDDM_DX% == "1"
266 FILE "$%PATH_OUT%\bin\additions\VBoxDX.dll"
267 !endif
268 !if $%VBOX_WITH_MESA3D% == "1"
269 FILE "$%PATH_OUT%\bin\additions\VBoxNine.dll"
270 FILE "$%PATH_OUT%\bin\additions\VBoxSVGA.dll"
271 FILE "$%PATH_OUT%\bin\additions\VBoxGL.dll"
272 !endif
273
274 !if $%KBUILD_TARGET_ARCH% == "amd64"
275 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
276 !if $%VBOX_WITH_WDDM_DX% == "1"
277 FILE "$%PATH_OUT%\bin\additions\VBoxDX-x86.dll"
278 !endif
279 !if $%VBOX_WITH_MESA3D% == "1"
280 FILE "$%PATH_OUT%\bin\additions\VBoxNine-x86.dll"
281 FILE "$%PATH_OUT%\bin\additions\VBoxSVGA-x86.dll"
282 FILE "$%PATH_OUT%\bin\additions\VBoxGL-x86.dll"
283 !endif
284 !endif ; $%KBUILD_TARGET_ARCH% == "amd64"
285
286 Goto doneCr
287 ${EndIf}
288!endif ; $%VBOX_WITH_WDDM% == "1"
289
290doneCr:
291
292 Pop $0
293
294FunctionEnd
295
296
297Function W2K_InstallFiles
298
299 ; The Shared Folder IFS goes to the system directory
300 !if $%BUILD_TARGET_ARCH% == "x86"
301 ; On x86 we have to use a different shared folder driver linked against an older RDBSS for Windows 7 and older.
302 ${If} $g_strWinVersion == "2000"
303 ${OrIf} $g_strWinVersion == "XP"
304 ${OrIf} $g_strWinVersion == "2003"
305 ${OrIf} $g_strWinVersion == "Vista"
306 ${OrIf} $g_strWinVersion == "7"
307 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxSFW2K.sys" "$g_strSystemDir\drivers\VBoxSF.sys" "$INSTDIR"
308 ${Else}
309 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxSF.sys" "$g_strSystemDir\drivers\VBoxSF.sys" "$INSTDIR"
310 ${EndIf}
311 !else
312 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxSF.sys" "$g_strSystemDir\drivers\VBoxSF.sys" "$INSTDIR"
313 !endif
314
315 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
316 AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
317 !if $%KBUILD_TARGET_ARCH% == "amd64"
318 ; Only 64-bit installer: Copy the 32-bit DLL for 32 bit applications.
319 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP-x86.dll" "$g_strSysWow64\VBoxMRXNP.dll" "$INSTDIR"
320 AccessControl::GrantOnFile "$g_strSysWow64\VBoxMRXNP.dll" "(BU)" "GenericRead"
321 !endif
322
323 ; The VBoxTray hook DLL also goes to the system directory; it might be locked
324 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
325 AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
326
327 ${LogVerbose} "Installing drivers ..."
328
329 Push $0 ; For fetching results
330
331 SetOutPath "$INSTDIR"
332
333 ${If} $g_bNoGuestDrv == "false"
334 ${LogVerbose} "Installing guest driver ..."
335 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
336 ${Else}
337 ${LogVerbose} "Guest driver installation skipped!"
338 ${EndIf}
339
340 ${If} $g_bNoVideoDrv == "false"
341 ${If} $g_bWithWDDM == "true"
342 ${LogVerbose} "Installing WDDM video driver..."
343 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
344 ${Else}
345 ${LogVerbose} "Installing video driver ..."
346 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
347 ${EndIf}
348 ${Else}
349 ${LogVerbose} "Video driver installation skipped!"
350 ${EndIf}
351
352 ${If} $g_bNoMouseDrv == "false"
353 ${LogVerbose} "Installing mouse driver ..."
354 ; The mouse filter does not contain any device IDs but a "DefaultInstall" section;
355 ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented
356 ; with VBoxDrvInst's "driver executeinf" routine
357 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxMouse.inf$\"" "false"
358 ${Else}
359 ${LogVerbose} "Mouse driver installation skipped!"
360 ${EndIf}
361
362 ; Create the VBoxService service
363 ; No need to stop/remove the service here! Do this only on uninstallation!
364 ${LogVerbose} "Installing VirtualBox service ..."
365 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\System32\VBoxService.exe$\" $\"Base$\"" "false"
366
367 ; Set service description
368 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
369
370sf:
371
372 ${LogVerbose} "Installing Shared Folders service ..."
373
374 ; Create the Shared Folders service ...
375 ; No need to stop/remove the service here! Do this only on uninstallation!
376 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxSF$\" $\"VirtualBox Shared Folders$\" 2 1 $\"\SystemRoot\System32\drivers\VBoxSF.sys$\" $\"NetworkProvider$\"" "false"
377
378 ; ... and the link to the network provider
379 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr"
380 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "Name" "VirtualBox Shared Folders"
381 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll"
382
383 ; Add default network providers (if not present or corrupted)
384 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add WebClient" "false"
385 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add LanmanWorkstation" "false"
386 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add RDPNP" "false"
387
388 ; Add the shared folders network provider
389 ${LogVerbose} "Adding network provider (Order = $g_iSfOrder) ..."
390 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" "false"
391
392 Goto done
393
394done:
395
396 Pop $0
397
398FunctionEnd
399
400Function W2K_Main
401
402 SetOutPath "$INSTDIR"
403 SetOverwrite on
404
405 Call W2K_Prepare
406 Call W2K_CopyFiles
407 Call W2K_InstallFiles
408 Call W2K_SetVideoResolution
409
410FunctionEnd
411
412!macro W2K_UninstallInstDir un
413Function ${un}W2K_UninstallInstDir
414
415 Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
416 Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
417 Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
418 Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
419
420 Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
421 Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
422 Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
423
424 Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
425
426 Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
427 Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
428 Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
429
430 Delete /REBOOTOK "$INSTDIR\VBCoInst.dll" ; Deprecated, does not get installed anymore
431 Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
432 Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; Deprecated, does not get installed anymore
433
434!if $%VBOX_WITH_WDDM% == "1"
435 Delete /REBOOTOK "$INSTDIR\VBoxWddm.cat"
436 Delete /REBOOTOK "$INSTDIR\VBoxWddm.sys"
437 Delete /REBOOTOK "$INSTDIR\VBoxWddm.inf"
438 ; Obsolete files begin
439 Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.cat"
440 Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.sys"
441 Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.inf"
442 Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.cat"
443 Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.sys"
444 Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.inf"
445 ; Obsolete files end
446 Delete /REBOOTOK "$INSTDIR\VBoxDispD3D.dll"
447 !if $%VBOX_WITH_WDDM_DX% == "1"
448 Delete /REBOOTOK "$INSTDIR\VBoxDX.dll"
449 !endif
450 !if $%VBOX_WITH_MESA3D% == "1"
451 Delete /REBOOTOK "$INSTDIR\VBoxNine.dll"
452 Delete /REBOOTOK "$INSTDIR\VBoxSVGA.dll"
453 Delete /REBOOTOK "$INSTDIR\VBoxICD.dll"
454 Delete /REBOOTOK "$INSTDIR\VBoxGL.dll"
455 !endif
456
457 Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm.dll"
458 Delete /REBOOTOK "$INSTDIR\wined3dwddm.dll"
459 ; Try to delete libWine in case it is there from old installation
460 Delete /REBOOTOK "$INSTDIR\libWine.dll"
461
462 !if $%KBUILD_TARGET_ARCH% == "amd64"
463 Delete /REBOOTOK "$INSTDIR\VBoxDispD3D-x86.dll"
464 !if $%VBOX_WITH_WDDM_DX% == "1"
465 Delete /REBOOTOK "$INSTDIR\VBoxDX-x86.dll"
466 !endif
467 !if $%VBOX_WITH_MESA3D% == "1"
468 Delete /REBOOTOK "$INSTDIR\VBoxNine-x86.dll"
469 Delete /REBOOTOK "$INSTDIR\VBoxSVGA-x86.dll"
470 Delete /REBOOTOK "$INSTDIR\VBoxICD-x86.dll"
471 Delete /REBOOTOK "$INSTDIR\VBoxGL-x86.dll"
472 !endif
473
474 Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm-x86.dll"
475 Delete /REBOOTOK "$INSTDIR\wined3dwddm-x86.dll"
476 !endif ; $%KBUILD_TARGET_ARCH% == "amd64"
477!endif ; $%VBOX_WITH_WDDM% == "1"
478
479 ; Log file
480 Delete /REBOOTOK "$INSTDIR\install.log"
481 Delete /REBOOTOK "$INSTDIR\install_ui.log"
482
483FunctionEnd
484!macroend
485!insertmacro W2K_UninstallInstDir ""
486!insertmacro W2K_UninstallInstDir "un."
487
488!macro W2K_Uninstall un
489Function ${un}W2K_Uninstall
490
491 Push $0
492
493 ; Remove VirtualBox video driver
494 ${LogVerbose} "Uninstalling video driver ..."
495 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo.inf$\"" "true"
496 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true"
497 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
498 Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
499
500 ; Remove video driver
501!if $%VBOX_WITH_WDDM% == "1"
502
503 ${LogVerbose} "Uninstalling WDDM video driver..."
504 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxWddm.inf$\"" "true"
505 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxWddm" "true"
506 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
507 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
508 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxWddm.sys"
509
510 ; Obsolete files begin
511 ${LogVerbose} "Uninstalling WDDM video driver for Windows 8..."
512 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" "true"
513 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" "true"
514 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
515 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
516 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoW8.sys"
517
518 ${LogVerbose} "Uninstalling WDDM video driver for Windows Vista and 7..."
519 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" "true"
520 ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
521 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" "true"
522 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
523 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
524 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
525 ; Obsolete files end
526
527 Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
528 !if $%KBUILD_TARGET_ARCH% == "amd64"
529 Delete /REBOOTOK "$g_strSysWow64\VBoxDispD3D-x86.dll"
530 !endif
531
532 !if $%VBOX_WITH_WDDM_DX% == "1"
533 Delete /REBOOTOK "$g_strSystemDir\VBoxDX.dll"
534 !if $%KBUILD_TARGET_ARCH% == "amd64"
535 Delete /REBOOTOK "$g_strSysWow64\VBoxDX-x86.dll"
536 !endif
537 !endif
538
539 !if $%VBOX_WITH_MESA3D% == "1"
540 Delete /REBOOTOK "$g_strSystemDir\VBoxNine.dll"
541 Delete /REBOOTOK "$g_strSystemDir\VBoxSVGA.dll"
542 Delete /REBOOTOK "$g_strSystemDir\VBoxICD.dll"
543 Delete /REBOOTOK "$g_strSystemDir\VBoxGL.dll"
544
545 !if $%KBUILD_TARGET_ARCH% == "amd64"
546 Delete /REBOOTOK "$g_strSysWow64\VBoxNine-x86.dll"
547 Delete /REBOOTOK "$g_strSysWow64\VBoxSVGA-x86.dll"
548 Delete /REBOOTOK "$g_strSysWow64\VBoxICD-x86.dll"
549 Delete /REBOOTOK "$g_strSysWow64\VBoxGL-x86.dll"
550 !endif
551 !endif
552!endif ; $%VBOX_WITH_WDDM% == "1"
553
554 ; Remove mouse driver
555 ${LogVerbose} "Removing mouse driver ..."
556 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" "true"
557 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
558 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" "true"
559
560 ; Delete the VBoxService service
561 Call ${un}StopVBoxService
562 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true"
563 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
564 Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
565
566 ; VBoxGINA
567 Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
568 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
569 ${If} $0 == "VBoxGINA.dll"
570 ${LogVerbose} "Removing auto-logon support ..."
571 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
572 ${EndIf}
573 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA"
574
575 ; Delete VBoxTray
576 Call ${un}StopVBoxTray
577 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
578
579 ; Remove guest driver
580 ${LogVerbose} "Removing guest driver ..."
581 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest.inf$\"" "true"
582
583 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true"
584 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
585 Delete /REBOOTOK "$g_strSystemDir\VBCoInst.dll" ; Deprecated, does not get installed anymore
586 Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
587 Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
588 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
589 Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
590
591 ; Remove shared folders driver
592 ${LogVerbose} "Removing shared folders driver ..."
593 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider remove VBoxSF" "true"
594 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxSF" "true"
595 Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
596 !if $%KBUILD_TARGET_ARCH% == "amd64"
597 ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
598 Delete /REBOOTOK "$g_strSysWow64\VBoxMRXNP.dll"
599 !endif ; amd64
600 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
601
602 Pop $0
603
604FunctionEnd
605!macroend
606!insertmacro W2K_Uninstall ""
607!insertmacro W2K_Uninstall "un."
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette