VirtualBox

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

Last change on this file since 78376 was 78340, checked in by vboxsync, 6 years ago

Additions: Remove the VBoxOGLarrayspu library as it is unused for a long time already bugref:9435

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