VirtualBox

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

Last change on this file since 38876 was 38760, checked in by vboxsync, 13 years ago

More Windows 8 fixes

  • Property svn:eol-style set to native
File size: 27.7 KB
Line 
1; $Id: $
2;; @file
3; VBoxGuestAdditionsW2KXP.nsh - Guest Additions installation for Windows 2000/XP.
4;
5
6;
7; Copyright (C) 2006-2011 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 DetailPrint "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 DetailPrint "Registry path: $tmppath"
59 DetailPrint "Registry path to device name: $temp"
60!endif
61 DetailPrint "Detected video device: $dev_desc"
62
63 ${If} $dev_desc == "VirtualBox Graphics Adapter"
64 DetailPrint "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 DetailPrint "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 DetailPrint "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 DetailPrint "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 DetailPrint "No VirtualBox video device (yet) detected! No custom mode set."
103 Goto exit
104
105change_res:
106
107!ifdef _DEBUG
108 DetailPrint "Device description: $dev_desc"
109 DetailPrint "Device ID: $dev_id"
110!endif
111
112 Var /GLOBAL reg_path_device
113 Var /GLOBAL reg_path_monitor
114
115 DetailPrint "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 StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
124 StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
125 ${Else}
126 DetailPrint "Custom mode set: Windows $g_strWinVersion not supported yet"
127 Goto exit
128 ${EndIf}
129
130 ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
131 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
132 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
133 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
134
135 ; ... and tell Windows to use that mode on next start!
136 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
137 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
138 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
139
140 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
141 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
142 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
143
144 DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
145
146exit:
147
148FunctionEnd
149
150Function W2K_Prepare
151
152 ${If} $g_bNoVBoxServiceExit == "false"
153 ; Stop / kill VBoxService
154 Call StopVBoxService
155 ${EndIf}
156
157 ${If} $g_bNoVBoxTrayExit == "false"
158 ; Stop / kill VBoxTray
159 Call StopVBoxTray
160 ${EndIf}
161
162 ; Delete VBoxService from registry
163 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
164
165 ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
166 Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
167
168FunctionEnd
169
170Function W2K_CopyFiles
171
172 Push $0
173 SetOutPath "$INSTDIR"
174
175 ; Video driver
176 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
177 FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
178
179 ; Mouse driver
180 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
181 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
182!ifdef VBOX_SIGN_ADDITIONS
183 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
184!endif
185
186 ; Guest driver
187 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
188 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
189!ifdef VBOX_SIGN_ADDITIONS
190 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
191!endif
192
193 ; Guest driver files
194 FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
195 FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
196
197 ; WHQL fake
198!ifdef WHQL_FAKE
199 FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
200!endif
201
202 SetOutPath $g_strSystemDir
203
204 ; VBoxService
205 FILE "$%PATH_OUT%\bin\additions\VBoxService.exe" ; Only used by W2K and up (for Shared Folders at the moment)
206
207!if $%VBOX_WITH_WDDM% == "1"
208 ${If} $g_bWithWDDM == "true"
209 ; WDDM Video driver
210 SetOutPath "$INSTDIR"
211
212 !ifdef VBOX_SIGN_ADDITIONS
213 FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.cat"
214 !endif
215 FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
216 FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
217 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
218
219 !if $%VBOX_WITH_CROGL% == "1"
220 FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
221 FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
222 FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
223 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
224 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
225 FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
226 FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
227
228 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
229 FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
230 !endif ; $%VBOX_WITH_CROGL% == "1"
231
232 !if $%BUILD_TARGET_ARCH% == "amd64"
233 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
234
235 !if $%VBOX_WITH_CROGL% == "1"
236 FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu-x86.dll"
237 FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil-x86.dll"
238 FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu-x86.dll"
239 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu-x86.dll"
240 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu-x86.dll"
241 FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu-x86.dll"
242 FILE "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
243
244 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
245 FILE "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
246 !endif ; $%VBOX_WITH_CROGL% == "1"
247 !endif ; $%BUILD_TARGET_ARCH% == "amd64"
248
249 Goto doneCr
250 ${EndIf}
251!endif ; $%VBOX_WITH_WDDM% == "1"
252
253!if $%VBOX_WITH_CROGL% == "1"
254 ; crOpenGL
255 !if $%BUILD_TARGET_ARCH% == "amd64"
256 !define LIBRARY_X64 ; Enable installation of 64-bit libraries
257 !endif
258 StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL"
259 CreateDirectory "$0"
260 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll" "$g_strSystemDir\VBoxOGLarrayspu.dll" "$0"
261 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll" "$g_strSystemDir\VBoxOGLcrutil.dll" "$0"
262 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll" "$g_strSystemDir\VBoxOGLerrorspu.dll" "$0"
263 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll" "$g_strSystemDir\VBoxOGLpackspu.dll" "$0"
264 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll" "$g_strSystemDir\VBoxOGLpassthroughspu.dll" "$0"
265 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll" "$g_strSystemDir\VBoxOGLfeedbackspu.dll" "$0"
266 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGL.dll" "$g_strSystemDir\VBoxOGL.dll" "$0"
267 !if $%BUILD_TARGET_ARCH% == "amd64"
268 !undef LIBRARY_X64 ; Disable installation of 64-bit libraries
269 !endif
270
271 !if $%BUILD_TARGET_ARCH% == "amd64"
272 StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL32"
273 CreateDirectory "$0"
274 ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
275 ; Wow64 node (32-bit sub system). Note that $SYSDIR contains the 32-bit
276 ; path after calling EnableX64FSRedirection
277 ${EnableX64FSRedirection}
278 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll" "$SYSDIR\VBoxOGLarrayspu.dll" "$0"
279 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll" "$SYSDIR\VBoxOGLcrutil.dll" "$0"
280 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll" "$SYSDIR\VBoxOGLerrorspu.dll" "$0"
281 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll" "$SYSDIR\VBoxOGLpackspu.dll" "$0"
282 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll" "$SYSDIR\VBoxOGLpassthroughspu.dll" "$0"
283 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll" "$SYSDIR\VBoxOGLfeedbackspu.dll" "$0"
284 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll" "$SYSDIR\VBoxOGL.dll" "$0"
285 ${DisableX64FSRedirection}
286 !endif
287
288!endif ; VBOX_WITH_CROGL
289
290doneCr:
291
292 Pop $0
293
294FunctionEnd
295
296!ifdef WHQL_FAKE
297
298Function W2K_WHQLFakeOn
299
300 StrCmp $g_bFakeWHQL "true" do
301 Goto exit
302
303do:
304
305 DetailPrint "Turning off WHQL protection..."
306 nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"'
307
308exit:
309
310FunctionEnd
311
312Function W2K_WHQLFakeOff
313
314 StrCmp $g_bFakeWHQL "true" do
315 Goto exit
316
317do:
318
319 DetailPrint "Turning back on WHQL protection..."
320 nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"'
321
322exit:
323
324FunctionEnd
325
326!endif
327
328Function W2K_InstallFiles
329
330 ; The Shared Folder IFS goes to the system directory
331 FILE /oname=$g_strSystemDir\drivers\VBoxSF.sys "$%PATH_OUT%\bin\additions\VBoxSF.sys"
332 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
333 AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
334
335 ; The VBoxTray hook DLL also goes to the system directory; it might be locked
336 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
337 AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
338
339 DetailPrint "Installing drivers ..."
340
341 Push $0 ; For fetching results
342
343 SetOutPath "$INSTDIR"
344
345 ${If} $g_bNoGuestDrv == "false"
346 DetailPrint "Installing guest driver ..."
347 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxGuest.inf" "$INSTDIR\install_drivers.log"'
348 Pop $0 ; Ret value
349 LogText "Guest driver returned: $0"
350 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
351 ${Else}
352 LogText "Guest driver installation skipped!"
353 ${EndIf}
354
355 ${If} $g_bNoVideoDrv == "false"
356 ${If} $g_bWithWDDM == "true"
357 DetailPrint "Installing WDDM video driver ..."
358 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf" "$INSTDIR\install_drivers.log"'
359 ${Else}
360 DetailPrint "Installing video driver ..."
361 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideo.inf" "$INSTDIR\install_drivers.log"'
362 ${EndIf}
363 Pop $0 ; Ret value
364 LogText "Video driver returned: $0"
365 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
366 ${Else}
367 LogText "Video driver installation skipped!"
368 ${EndIf}
369
370 ${If} $g_bNoMouseDrv == "false"
371 DetailPrint "Installing mouse driver ..."
372 ; The mouse filter does not contain any device IDs but a "DefaultInstall" section;
373 ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented
374 ; with VBoxDrvInst's "driver executeinf" routine
375 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver executeinf "$INSTDIR\VBoxMouse.inf"'
376 Pop $0 ; Ret value
377 LogText "Mouse driver returned: $0"
378 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
379 ${Else}
380 LogText "Mouse driver installation skipped!"
381 ${EndIf}
382
383 ; Create the VBoxService service
384 ; No need to stop/remove the service here! Do this only on uninstallation!
385 DetailPrint "Installing VirtualBox service ..."
386 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxService.exe" "Base"'
387 Pop $0 ; Ret value
388 LogText "VBoxService returned: $0"
389
390 ; Set service description
391 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
392
393sf:
394
395 DetailPrint "Installing Shared Folders service ..."
396
397 ; Create the Shared Folders service ...
398 ; No need to stop/remove the service here! Do this only on uninstallation!
399 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxSF" "VirtualBox Shared Folders" 2 1 "system32\drivers\VBoxSF.sys" "NetworkProvider"'
400
401 ; ... and the link to the network provider
402 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr"
403 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "Name" "VirtualBox Shared Folders"
404 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll"
405
406 ; Add default network providers (if not present or corrupted)
407 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add WebClient'
408 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add LanmanWorkstation'
409 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add RDPNP'
410
411 ; Add the shared folders network provider
412 DetailPrint "Adding network provider (Order = $g_iSfOrder) ..."
413 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add VBoxSF $g_iSfOrder'
414 Pop $0 ; Ret value
415 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
416
417!if $%VBOX_WITH_CROGL% == "1"
418cropengl:
419 ${If} $g_bWithWDDM == "true"
420 ; Nothing to do here
421 ${Else}
422 DetailPrint "Installing 3D OpenGL support ..."
423 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
424 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
425 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
426 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
427!if $%BUILD_TARGET_ARCH% == "amd64"
428 SetRegView 32
429 ; Write additional keys required for Windows XP, Vista and 7 64-bit (but for 32-bit stuff)
430 ${If} $g_strWinVersion == '8'
431 ${OrIf} $g_strWinVersion == '7'
432 ${OrIf} $g_strWinVersion == 'Vista'
433 ${OrIf} $g_strWinVersion == '2003' ; Windows XP 64-bit is a renamed Windows 2003 really
434 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
435 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
436 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
437 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
438 ${EndIf}
439 SetRegView 64
440!endif
441 ${Endif}
442!endif
443
444 Goto done
445
446error:
447
448 Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
449
450done:
451
452 Pop $0
453
454FunctionEnd
455
456Function W2K_Main
457
458 SetOutPath "$INSTDIR"
459 SetOverwrite on
460
461 Call W2K_Prepare
462 Call W2K_CopyFiles
463
464!ifdef WHQL_FAKE
465 Call W2K_WHQLFakeOn
466!endif
467
468 Call W2K_InstallFiles
469
470!ifdef WHQL_FAKE
471 Call W2K_WHQLFakeOff
472!endif
473
474 Call W2K_SetVideoResolution
475
476FunctionEnd
477
478!macro W2K_UninstallInstDir un
479Function ${un}W2K_UninstallInstDir
480
481 Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
482 Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
483 Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
484 Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
485
486 Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
487 Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
488 Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
489
490 Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
491
492 Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
493 Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
494 Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
495
496 Delete /REBOOTOK "$INSTDIR\VBCoInst.dll" ; Deprecated, does not get installed anymore
497 Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
498 Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; Deprecated, does not get installed anymore
499
500!if $%VBOX_WITH_WDDM% == "1"
501 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxVideoWddm.cat"
502 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
503 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
504 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
505
506 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
507 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
508 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
509 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
510 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
511 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
512 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
513
514 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
515 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
516 ; Try to delete libWine in case it is there from old installation
517 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\libWine.dll"
518
519 !if $%BUILD_TARGET_ARCH% == "amd64"
520 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
521
522 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu-x86.dll"
523 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLcrutil-x86.dll"
524 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu-x86.dll"
525 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpackspu-x86.dll"
526 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu-x86.dll"
527 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu-x86.dll"
528 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
529
530 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
531 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
532 !endif ; $%BUILD_TARGET_ARCH% == "amd64"
533!endif ; $%VBOX_WITH_WDDM% == "1"
534
535 ; WHQL fake
536!ifdef WHQL_FAKE
537 Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
538!endif
539
540 ; Log file
541 Delete /REBOOTOK "$INSTDIR\install.log"
542 Delete /REBOOTOK "$INSTDIR\install_ui.log"
543
544FunctionEnd
545!macroend
546!insertmacro W2K_UninstallInstDir ""
547!insertmacro W2K_UninstallInstDir "un."
548
549!macro W2K_Uninstall un
550Function ${un}W2K_Uninstall
551
552 Push $0
553
554 ; Remove VirtualBox video driver
555 DetailPrint "Uninstalling video driver ..."
556 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideo.inf'
557 Pop $0 ; Ret value
558 ; @todo Add error handling here!
559 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideo'
560 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
561 Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
562
563 ; Remove video driver
564!if $%VBOX_WITH_WDDM% == "1"
565 DetailPrint "Uninstalling WDDM video driver ..."
566 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf"'
567 Pop $0 ; Ret value
568 ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
569 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideoWddm'
570 Pop $0 ; Ret value
571 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
572 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
573 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
574 Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
575!endif ; $%VBOX_WITH_WDDM% == "1"
576
577!if $%VBOX_WITH_CROGL% == "1"
578
579 DetailPrint "Removing 3D graphics support ..."
580
581 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
582 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
583 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
584 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
585 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
586 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
587 Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
588
589 ; Remove D3D stuff
590 ; @todo add a feature flag to only remove if installed explicitly
591 Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
592 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
593 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
594 Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
595 ; Update DLL cache
596 IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
597 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
598 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
599 IfFileExists "$g_strSystemDir\dllcache\msd3d9.dll" 0 +2
600 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
601 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
602 ; Restore original DX DLLs
603 IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
604 Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
605 Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
606 IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
607 Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
608 Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
609
610 !if $%BUILD_TARGET_ARCH% == "amd64"
611
612 ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
613 ${EnableX64FSRedirection}
614 Delete /REBOOTOK "$SYSDIR\VBoxOGLarrayspu.dll"
615 Delete /REBOOTOK "$SYSDIR\VBoxOGLcrutil.dll"
616 Delete /REBOOTOK "$SYSDIR\VBoxOGLerrorspu.dll"
617 Delete /REBOOTOK "$SYSDIR\VBoxOGLpackspu.dll"
618 Delete /REBOOTOK "$SYSDIR\VBoxOGLpassthroughspu.dll"
619 Delete /REBOOTOK "$SYSDIR\VBoxOGLfeedbackspu.dll"
620 Delete /REBOOTOK "$SYSDIR\VBoxOGL.dll"
621
622 ; Remove D3D stuff
623 ; @todo add a feature flag to only remove if installed explicitly
624 Delete /REBOOTOK "$SYSDIR\libWine.dll"
625 Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
626 Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
627 Delete /REBOOTOK "$SYSDIR\wined3d.dll"
628 ; Update DLL cache
629 IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
630 Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
631 Rename /REBOOTOK "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll"
632 IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
633 Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
634 Rename /REBOOTOK "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll"
635 ; Restore original DX DLLs
636 IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
637 Delete /REBOOTOK "$SYSDIR\d3d8.dll"
638 Rename /REBOOTOK "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll"
639 IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
640 Delete /REBOOTOK "$SYSDIR\d3d9.dll"
641 Rename /REBOOTOK "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll"
642 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
643 ${DisableX64FSRedirection}
644 !endif ; amd64
645
646 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
647
648!endif ; VBOX_WITH_CROGL
649
650 ; Remove mouse driver
651 DetailPrint "Removing mouse driver ..."
652 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxMouse'
653 Pop $0 ; Ret value
654 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
655 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
656 Pop $0 ; Ret value
657 ; @todo Add error handling here!
658
659 ; Delete the VBoxService service
660 Call ${un}StopVBoxService
661 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxService'
662 Pop $0 ; Ret value
663 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
664 Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
665
666 ; VBoxGINA
667 Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
668 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
669 ${If} $0 == "VBoxGINA.dll"
670 DetailPrint "Removing auto-logon support ..."
671 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
672 ${EndIf}
673
674 ; Delete VBoxTray
675 Call ${un}StopVBoxTray
676 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
677
678 ; Remove guest driver
679 DetailPrint "Removing guest driver ..."
680 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxGuest.inf"'
681 Pop $0 ; Ret value
682 ; @todo Add error handling here!
683
684 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxGuest'
685 Pop $0 ; Ret value
686 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
687 Delete /REBOOTOK "$g_strSystemDir\VBCoInst.dll" ; Deprecated, does not get installed anymore
688 Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
689 Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
690 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
691 Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
692
693 ; Remove shared folders driver
694 DetailPrint "Removing shared folders driver ..."
695 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider remove VBoxSF'
696 Pop $0 ; Ret value
697 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxSF'
698 Pop $0 ; Ret value
699 Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
700 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
701
702 Pop $0
703
704FunctionEnd
705!macroend
706!insertmacro W2K_Uninstall ""
707!insertmacro W2K_Uninstall "un."
708
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