VirtualBox

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

Last change on this file since 79241 was 78408, checked in by vboxsync, 6 years ago

Additions,GuestHost/OpenGL,HostServices/SharedOpenGL: Get rid of the individual SPU shared libraries and merge them into the VBoxSharedCrOpenGL shared libraries on the host and VBoxOGL{,-x86} shared libraries for the guest additions, bugref:9435

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 29.8 KB
Line 
1; $Id: VBoxGuestAdditionsW2KXP.nsh 78408 2019-05-06 21:31:01Z vboxsync $
2;; @file
3; VBoxGuestAdditionsW2KXP.nsh - Guest Additions installation for Windows 2000/XP.
4;
5
6;
7; Copyright (C) 2006-2019 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
170FunctionEnd
171
172Function W2K_CopyFiles
173
174 Push $0
175 SetOutPath "$INSTDIR"
176
177 ; Video driver
178 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
179 FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
180
181 ; Mouse driver
182 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
183 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
184!ifdef VBOX_SIGN_ADDITIONS
185 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
186!endif
187
188 ; Guest driver
189 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
190 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
191!ifdef VBOX_SIGN_ADDITIONS
192 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
193!endif
194
195 ; Guest driver files
196 FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
197 FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
198
199 ; WHQL fake
200!ifdef WHQL_FAKE
201 FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
202!endif
203
204 SetOutPath $g_strSystemDir
205
206 ; VBoxService
207 ${If} $g_bNoVBoxServiceExit == "false"
208 ; VBoxService has been terminated before, so just install the file
209 ; in the regular way
210 FILE "$%PATH_OUT%\bin\additions\VBoxService.exe"
211 ${Else}
212 ; VBoxService is in use and wasn't terminated intentionally. So extract the
213 ; new version into a temporary location and install it on next reboot
214 Push $0
215 ClearErrors
216 GetTempFileName $0
217 IfErrors 0 +3
218 ${LogVerbose} "Error getting temp file for VBoxService.exe"
219 StrCpy "$0" "$INSTDIR\VBoxServiceTemp.exe"
220 ${LogVerbose} "VBoxService is in use, will be installed on next reboot (from '$0')"
221 File "/oname=$0" "$%PATH_OUT%\bin\additions\VBoxService.exe"
222 IfErrors 0 +2
223 ${LogVerbose} "Error copying VBoxService.exe to '$0'"
224 Rename /REBOOTOK "$0" "$g_strSystemDir\VBoxService.exe"
225 IfErrors 0 +2
226 ${LogVerbose} "Error renaming '$0' to '$g_strSystemDir\VBoxService.exe'"
227 Pop $0
228 ${EndIf}
229
230!if $%VBOX_WITH_WDDM% == "1"
231 ${If} $g_bWithWDDM == "true"
232 ; WDDM Video driver
233 SetOutPath "$INSTDIR"
234
235 !ifdef VBOX_SIGN_ADDITIONS
236 FILE "$%PATH_OUT%\bin\additions\VBoxWddm.cat"
237 !endif
238 FILE "$%PATH_OUT%\bin\additions\VBoxWddm.sys"
239 FILE "$%PATH_OUT%\bin\additions\VBoxWddm.inf"
240
241 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
242 !if $%VBOX_WITH_MESA3D% == "1"
243 FILE "$%PATH_OUT%\bin\additions\VBoxNine.dll"
244 FILE "$%PATH_OUT%\bin\additions\VBoxSVGA.dll"
245 FILE "$%PATH_OUT%\bin\additions\VBoxICD.dll"
246 FILE "$%PATH_OUT%\bin\additions\VBoxGL.dll"
247 !endif
248
249 !if $%VBOX_WITH_CROGL% == "1"
250 FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
251
252 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
253 FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
254 !endif ; $%VBOX_WITH_CROGL% == "1"
255
256 !if $%BUILD_TARGET_ARCH% == "amd64"
257 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
258 !if $%VBOX_WITH_MESA3D% == "1"
259 FILE "$%PATH_OUT%\bin\additions\VBoxNine-x86.dll"
260 FILE "$%PATH_OUT%\bin\additions\VBoxSVGA-x86.dll"
261 FILE "$%PATH_OUT%\bin\additions\VBoxICD-x86.dll"
262 FILE "$%PATH_OUT%\bin\additions\VBoxGL-x86.dll"
263 !endif
264
265 !if $%VBOX_WITH_CROGL% == "1"
266 FILE "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
267
268 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
269 FILE "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
270 !endif ; $%VBOX_WITH_CROGL% == "1"
271 !endif ; $%BUILD_TARGET_ARCH% == "amd64"
272
273 Goto doneCr
274 ${EndIf}
275!endif ; $%VBOX_WITH_WDDM% == "1"
276
277!if $%VBOX_WITH_CROGL% == "1"
278 ; crOpenGL
279 !if $%BUILD_TARGET_ARCH% == "amd64"
280 !define LIBRARY_X64 ; Enable installation of 64-bit libraries
281 !endif
282 StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL"
283 CreateDirectory "$0"
284 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGL.dll" "$g_strSystemDir\VBoxOGL.dll" "$0"
285 !if $%BUILD_TARGET_ARCH% == "amd64"
286 !undef LIBRARY_X64 ; Disable installation of 64-bit libraries
287 !endif
288
289 !if $%BUILD_TARGET_ARCH% == "amd64"
290 StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL32"
291 CreateDirectory "$0"
292 ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
293 ; Wow64 node (32-bit sub system). Note that $SYSDIR contains the 32-bit
294 ; path after calling EnableX64FSRedirection
295 ${EnableX64FSRedirection}
296 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll" "$SYSDIR\VBoxOGL.dll" "$0"
297 ${DisableX64FSRedirection}
298 !endif
299
300!endif ; VBOX_WITH_CROGL
301
302doneCr:
303
304 Pop $0
305
306FunctionEnd
307
308!ifdef WHQL_FAKE
309
310Function W2K_WHQLFakeOn
311
312 StrCmp $g_bFakeWHQL "true" do
313 Goto exit
314
315do:
316
317 ${LogVerbose} "Turning off WHQL protection..."
318 ${CmdExecute} "$\"$INSTDIR\VBoxWHQLFake.exe$\" $\"ignore$\"" "true"
319
320exit:
321
322FunctionEnd
323
324Function W2K_WHQLFakeOff
325
326 StrCmp $g_bFakeWHQL "true" do
327 Goto exit
328
329do:
330
331 ${LogVerbose} "Turning back on WHQL protection..."
332 ${CmdExecute} "$\"$INSTDIR\VBoxWHQLFake.exe$\" $\"warn$\"" "true"
333
334exit:
335
336FunctionEnd
337
338!endif
339
340Function W2K_InstallFiles
341
342 ; The Shared Folder IFS goes to the system directory
343 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxSF.sys" "$g_strSystemDir\drivers\VBoxSF.sys" "$INSTDIR"
344 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
345 AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
346 !if $%BUILD_TARGET_ARCH% == "amd64"
347 ; Only 64-bit installer: Copy the 32-bit DLL for 32 bit applications.
348 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP-x86.dll" "$g_strSysWow64\VBoxMRXNP.dll" "$INSTDIR"
349 AccessControl::GrantOnFile "$g_strSysWow64\VBoxMRXNP.dll" "(BU)" "GenericRead"
350 !endif
351
352 ; The VBoxTray hook DLL also goes to the system directory; it might be locked
353 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
354 AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
355
356 ${LogVerbose} "Installing drivers ..."
357
358 Push $0 ; For fetching results
359
360 SetOutPath "$INSTDIR"
361
362 ${If} $g_bNoGuestDrv == "false"
363 ${LogVerbose} "Installing guest driver ..."
364 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
365 ${Else}
366 ${LogVerbose} "Guest driver installation skipped!"
367 ${EndIf}
368
369 ${If} $g_bNoVideoDrv == "false"
370 ${If} $g_bWithWDDM == "true"
371 ${LogVerbose} "Installing WDDM video driver..."
372 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
373 ${Else}
374 ${LogVerbose} "Installing video driver ..."
375 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
376 ${EndIf}
377 ${Else}
378 ${LogVerbose} "Video driver installation skipped!"
379 ${EndIf}
380
381 ${If} $g_bNoMouseDrv == "false"
382 ${LogVerbose} "Installing mouse driver ..."
383 ; The mouse filter does not contain any device IDs but a "DefaultInstall" section;
384 ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented
385 ; with VBoxDrvInst's "driver executeinf" routine
386 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver executeinf $\"$INSTDIR\VBoxMouse.inf$\"" "false"
387 ${Else}
388 ${LogVerbose} "Mouse driver installation skipped!"
389 ${EndIf}
390
391 ; Create the VBoxService service
392 ; No need to stop/remove the service here! Do this only on uninstallation!
393 ${LogVerbose} "Installing VirtualBox service ..."
394 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\System32\VBoxService.exe$\" $\"Base$\"" "false"
395
396 ; Set service description
397 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
398
399sf:
400
401 ${LogVerbose} "Installing Shared Folders service ..."
402
403 ; Create the Shared Folders service ...
404 ; No need to stop/remove the service here! Do this only on uninstallation!
405 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxSF$\" $\"VirtualBox Shared Folders$\" 2 1 $\"\SystemRoot\System32\drivers\VBoxSF.sys$\" $\"NetworkProvider$\"" "false"
406
407 ; ... and the link to the network provider
408 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr"
409 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "Name" "VirtualBox Shared Folders"
410 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll"
411
412 ; Add default network providers (if not present or corrupted)
413 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add WebClient" "false"
414 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add LanmanWorkstation" "false"
415 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add RDPNP" "false"
416
417 ; Add the shared folders network provider
418 ${LogVerbose} "Adding network provider (Order = $g_iSfOrder) ..."
419 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" "false"
420
421!if $%VBOX_WITH_CROGL% == "1"
422cropengl:
423 ${If} $g_bWithWDDM == "true"
424 ; Nothing to do here
425 ${Else}
426 ${LogVerbose} "Installing 3D OpenGL support ..."
427 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
428 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
429 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
430 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
431!if $%BUILD_TARGET_ARCH% == "amd64"
432 SetRegView 32
433 ; Write additional keys required for Windows XP, Vista and 7 64-bit (but for 32-bit stuff)
434 ${If} $g_strWinVersion == '10'
435 ${OrIf} $g_strWinVersion == '8_1'
436 ${OrIf} $g_strWinVersion == '8'
437 ${OrIf} $g_strWinVersion == '7'
438 ${OrIf} $g_strWinVersion == 'Vista'
439 ${OrIf} $g_strWinVersion == '2003' ; Windows XP 64-bit is a renamed Windows 2003 really
440 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
441 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
442 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
443 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL-x86.dll"
444 ${EndIf}
445 SetRegView 64
446!endif
447 ${Endif}
448!endif
449
450 Goto done
451
452done:
453
454 Pop $0
455
456FunctionEnd
457
458Function W2K_Main
459
460 SetOutPath "$INSTDIR"
461 SetOverwrite on
462
463 Call W2K_Prepare
464 Call W2K_CopyFiles
465
466!ifdef WHQL_FAKE
467 Call W2K_WHQLFakeOn
468!endif
469
470 Call W2K_InstallFiles
471
472!ifdef WHQL_FAKE
473 Call W2K_WHQLFakeOff
474!endif
475
476 Call W2K_SetVideoResolution
477
478FunctionEnd
479
480!macro W2K_UninstallInstDir un
481Function ${un}W2K_UninstallInstDir
482
483 Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
484 Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
485 Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
486 Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
487
488 Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
489 Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
490 Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
491
492 Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
493
494 Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
495 Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
496 Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
497
498 Delete /REBOOTOK "$INSTDIR\VBCoInst.dll" ; Deprecated, does not get installed anymore
499 Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
500 Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; Deprecated, does not get installed anymore
501
502!if $%VBOX_WITH_WDDM% == "1"
503 Delete /REBOOTOK "$INSTDIR\VBoxWddm.cat"
504 Delete /REBOOTOK "$INSTDIR\VBoxWddm.sys"
505 Delete /REBOOTOK "$INSTDIR\VBoxWddm.inf"
506 ; Obsolete files begin
507 Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.cat"
508 Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.sys"
509 Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.inf"
510 Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.cat"
511 Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.sys"
512 Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.inf"
513 ; Obsolete files end
514 Delete /REBOOTOK "$INSTDIR\VBoxDispD3D.dll"
515 !if $%VBOX_WITH_MESA3D% == "1"
516 Delete /REBOOTOK "$INSTDIR\VBoxNine.dll"
517 Delete /REBOOTOK "$INSTDIR\VBoxSVGA.dll"
518 Delete /REBOOTOK "$INSTDIR\VBoxICD.dll"
519 Delete /REBOOTOK "$INSTDIR\VBoxGL.dll"
520 !endif
521
522 ; Obsolete files begin (they were merged into VBoxOGL.dll)
523 Delete /REBOOTOK "$INSTDIR\VBoxOGLcrutil.dll"
524 Delete /REBOOTOK "$INSTDIR\VBoxOGLarrayspu.dll"
525 Delete /REBOOTOK "$INSTDIR\VBoxOGLerrorspu.dll"
526 Delete /REBOOTOK "$INSTDIR\VBoxOGLpackspu.dll"
527 Delete /REBOOTOK "$INSTDIR\VBoxOGLpassthroughspu.dll"
528 Delete /REBOOTOK "$INSTDIR\VBoxOGLfeedbackspu.dll"
529 ; Obsolete files end
530
531 Delete /REBOOTOK "$INSTDIR\VBoxOGL.dll"
532
533 Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm.dll"
534 Delete /REBOOTOK "$INSTDIR\wined3dwddm.dll"
535 ; Try to delete libWine in case it is there from old installation
536 Delete /REBOOTOK "$INSTDIR\libWine.dll"
537
538 !if $%BUILD_TARGET_ARCH% == "amd64"
539 Delete /REBOOTOK "$INSTDIR\VBoxDispD3D-x86.dll"
540 !if $%VBOX_WITH_MESA3D% == "1"
541 Delete /REBOOTOK "$INSTDIR\VBoxNine-x86.dll"
542 Delete /REBOOTOK "$INSTDIR\VBoxSVGA-x86.dll"
543 Delete /REBOOTOK "$INSTDIR\VBoxICD-x86.dll"
544 Delete /REBOOTOK "$INSTDIR\VBoxGL-x86.dll"
545 !endif
546
547 ; Obsolete files begin (they were merged into VBoxOGL-x86.dll)
548 Delete /REBOOTOK "$INSTDIR\VBoxOGLcrutil-x86.dll"
549 Delete /REBOOTOK "$INSTDIR\VBoxOGLarrayspu-x86.dll"
550 Delete /REBOOTOK "$INSTDIR\VBoxOGLerrorspu-x86.dll"
551 Delete /REBOOTOK "$INSTDIR\VBoxOGLpackspu-x86.dll"
552 Delete /REBOOTOK "$INSTDIR\VBoxOGLpassthroughspu-x86.dll"
553 Delete /REBOOTOK "$INSTDIR\VBoxOGLfeedbackspu-x86.dll"
554 ; Obsolete files end
555
556 Delete /REBOOTOK "$INSTDIR\VBoxOGL-x86.dll"
557
558 Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm-x86.dll"
559 Delete /REBOOTOK "$INSTDIR\wined3dwddm-x86.dll"
560 !endif ; $%BUILD_TARGET_ARCH% == "amd64"
561!endif ; $%VBOX_WITH_WDDM% == "1"
562
563 ; WHQL fake
564!ifdef WHQL_FAKE
565 Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
566!endif
567
568 ; Log file
569 Delete /REBOOTOK "$INSTDIR\install.log"
570 Delete /REBOOTOK "$INSTDIR\install_ui.log"
571
572FunctionEnd
573!macroend
574!insertmacro W2K_UninstallInstDir ""
575!insertmacro W2K_UninstallInstDir "un."
576
577!macro W2K_Uninstall un
578Function ${un}W2K_Uninstall
579
580 Push $0
581
582 ; Remove VirtualBox video driver
583 ${LogVerbose} "Uninstalling video driver ..."
584 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo.inf$\"" "true"
585 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true"
586 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
587 Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
588
589 ; Remove video driver
590!if $%VBOX_WITH_WDDM% == "1"
591
592 ${LogVerbose} "Uninstalling WDDM video driver..."
593 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxWddm.inf$\"" "true"
594 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxWddm" "true"
595 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
596 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
597 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxWddm.sys"
598
599 ; Obsolete files begin
600 ${LogVerbose} "Uninstalling WDDM video driver for Windows 8..."
601 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" "true"
602 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" "true"
603 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
604 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
605 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoW8.sys"
606
607 ${LogVerbose} "Uninstalling WDDM video driver for Windows Vista and 7..."
608 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" "true"
609 ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
610 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" "true"
611 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
612 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
613 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
614 ; Obsolete files end
615
616 Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
617 !if $%BUILD_TARGET_ARCH% == "amd64"
618 Delete /REBOOTOK "$g_strSysWow64\VBoxDispD3D-x86.dll"
619 !endif
620
621 !if $%VBOX_WITH_MESA3D% == "1"
622 Delete /REBOOTOK "$g_strSystemDir\VBoxNine.dll"
623 Delete /REBOOTOK "$g_strSystemDir\VBoxSVGA.dll"
624 Delete /REBOOTOK "$g_strSystemDir\VBoxICD.dll"
625 Delete /REBOOTOK "$g_strSystemDir\VBoxGL.dll"
626
627 !if $%BUILD_TARGET_ARCH% == "amd64"
628 Delete /REBOOTOK "$g_strSysWow64\VBoxNine-x86.dll"
629 Delete /REBOOTOK "$g_strSysWow64\VBoxSVGA-x86.dll"
630 Delete /REBOOTOK "$g_strSysWow64\VBoxICD-x86.dll"
631 Delete /REBOOTOK "$g_strSysWow64\VBoxGL-x86.dll"
632 !endif
633 !endif
634!endif ; $%VBOX_WITH_WDDM% == "1"
635
636!if $%VBOX_WITH_CROGL% == "1"
637
638 ${LogVerbose} "Removing Direct3D support ..."
639
640 ; Do file validation before we uninstall
641 Call ${un}ValidateD3DFiles
642 Pop $0
643 ${If} $0 == "1" ; D3D files are invalid
644 ${LogVerbose} $(VBOX_UNINST_INVALID_D3D)
645 MessageBox MB_ICONSTOP|MB_OK $(VBOX_UNINST_INVALID_D3D) /SD IDOK
646 Goto d3d_uninstall_end
647 ${EndIf}
648
649 ; Obsolete files begin (they were merged into VBoxOGL.dll)
650 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
651 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
652 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
653 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
654 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
655 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
656 ; Obsolete files end
657
658 Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
659
660 ; Remove D3D stuff
661 ; @todo add a feature flag to only remove if installed explicitly
662 Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
663 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
664 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
665 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9wddm.dll"
666 Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
667 Delete /REBOOTOK "$g_strSystemDir\wined3dwddm.dll"
668 ; Update DLL cache
669 ${If} ${FileExists} "$g_strSystemDir\dllcache\msd3d8.dll"
670 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
671 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
672 ${EndIf}
673 ${If} ${FileExists} "$g_strSystemDir\dllcache\msd3d9.dll"
674 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
675 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
676 ${EndIf}
677 ; Restore original DX DLLs
678 ${If} ${FileExists} "$g_strSystemDir\msd3d8.dll"
679 Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
680 Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
681 ${EndIf}
682 ${If} ${FileExists} "$g_strSystemDir\msd3d9.dll"
683 Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
684 Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
685 ${EndIf}
686
687 !if $%BUILD_TARGET_ARCH% == "amd64"
688 ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
689 ; Obsolete files begin (they were merged into VBoxOGL-x86.dll)
690 Delete /REBOOTOK "$g_strSysWow64\VBoxOGLcrutil-x86.dll"
691 Delete /REBOOTOK "$g_strSysWow64\VBoxOGLarrayspu-x86.dll"
692 Delete /REBOOTOK "$g_strSysWow64\VBoxOGLerrorspu-x86.dll"
693 Delete /REBOOTOK "$g_strSysWow64\VBoxOGLpackspu-x86.dll"
694 Delete /REBOOTOK "$g_strSysWow64\VBoxOGLpassthroughspu-x86.dll"
695 Delete /REBOOTOK "$g_strSysWow64\VBoxOGLfeedbackspu-x86.dll"
696 ; Obsolete files end
697
698 Delete /REBOOTOK "$g_strSysWow64\VBoxOGL-x86.dll"
699
700 ; Remove D3D stuff
701 ; @todo add a feature flag to only remove if installed explicitly
702 Delete /REBOOTOK "$g_strSysWow64\libWine.dll"
703 Delete /REBOOTOK "$g_strSysWow64\VBoxD3D8-x86.dll"
704 Delete /REBOOTOK "$g_strSysWow64\VBoxD3D9-x86.dll"
705 Delete /REBOOTOK "$g_strSysWow64\VBoxD3D9wddm-x86.dll"
706 Delete /REBOOTOK "$g_strSysWow64\wined3dwddm-x86.dll"
707 Delete /REBOOTOK "$g_strSysWow64\wined3d.dll"
708 ; Update DLL cache
709 ${If} ${FileExists} "$g_strSysWow64\dllcache\msd3d8.dll"
710 Delete /REBOOTOK "$g_strSysWow64\dllcache\d3d8.dll"
711 Rename /REBOOTOK "$g_strSysWow64\dllcache\msd3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll"
712 ${EndIf}
713 ${If} ${FileExists} "$g_strSysWow64\dllcache\msd3d9.dll"
714 Delete /REBOOTOK "$g_strSysWow64\dllcache\d3d9.dll"
715 Rename /REBOOTOK "$g_strSysWow64\dllcache\msd3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll"
716 ${EndIf}
717 ; Restore original DX DLLs
718 ${If} ${FileExists} "$g_strSysWow64\msd3d8.dll"
719 Delete /REBOOTOK "$g_strSysWow64\d3d8.dll"
720 Rename /REBOOTOK "$g_strSysWow64\msd3d8.dll" "$g_strSysWow64\d3d8.dll"
721 ${EndIf}
722 ${If} ${FileExists} "$g_strSysWow64\msd3d9.dll"
723 Delete /REBOOTOK "$g_strSysWow64\d3d9.dll"
724 Rename /REBOOTOK "$g_strSysWow64\msd3d9.dll" "$g_strSysWow64\d3d9.dll"
725 ${EndIf}
726 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
727 !endif ; amd64
728
729 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
730
731d3d_uninstall_end:
732
733!endif ; VBOX_WITH_CROGL
734
735 ; Remove mouse driver
736 ${LogVerbose} "Removing mouse driver ..."
737 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" "true"
738 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
739 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" "true"
740
741 ; Delete the VBoxService service
742 Call ${un}StopVBoxService
743 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true"
744 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
745 Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
746
747 ; VBoxGINA
748 Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
749 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
750 ${If} $0 == "VBoxGINA.dll"
751 ${LogVerbose} "Removing auto-logon support ..."
752 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
753 ${EndIf}
754 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA"
755
756 ; Delete VBoxTray
757 Call ${un}StopVBoxTray
758 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
759
760 ; Remove guest driver
761 ${LogVerbose} "Removing guest driver ..."
762 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest.inf$\"" "true"
763
764 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true"
765 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
766 Delete /REBOOTOK "$g_strSystemDir\VBCoInst.dll" ; Deprecated, does not get installed anymore
767 Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
768 Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
769 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
770 Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
771
772 ; Remove shared folders driver
773 ${LogVerbose} "Removing shared folders driver ..."
774 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider remove VBoxSF" "true"
775 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxSF" "true"
776 Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
777 !if $%BUILD_TARGET_ARCH% == "amd64"
778 ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
779 Delete /REBOOTOK "$g_strSysWow64\VBoxMRXNP.dll"
780 !endif ; amd64
781 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
782
783 Pop $0
784
785FunctionEnd
786!macroend
787!insertmacro W2K_Uninstall ""
788!insertmacro W2K_Uninstall "un."
789
Note: See TracBrowser for help on using the repository browser.

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