VirtualBox

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

Last change on this file since 35703 was 35703, checked in by vboxsync, 14 years ago

Windows Guest Additions installer: Log driver installation.

  • Property svn:eol-style set to native
File size: 27.6 KB
Line 
1;*
2;* @file
3;* VBoxGuestAdditionsW2KXP.nsh - Guest Additions installation for Windows 2000/XP.
4;*
5
6;*
7;* Copyright (C) 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 StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
123 StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
124 ${Else}
125 DetailPrint "Custom mode set: Windows $g_strWinVersion not supported yet"
126 Goto exit
127 ${EndIf}
128
129 ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
130 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
131 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
132 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
133
134 ; ... and tell Windows to use that mode on next start!
135 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
136 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
137 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
138
139 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
140 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
141 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
142
143 DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
144
145exit:
146
147FunctionEnd
148
149Function W2K_Prepare
150
151 ${If} $g_bNoVBoxServiceExit == "false"
152 ; Stop / kill VBoxService
153 Call StopVBoxService
154 ${EndIf}
155
156 ${If} $g_bNoVBoxTrayExit == "false"
157 ; Stop / kill VBoxTray
158 Call StopVBoxTray
159 ${EndIf}
160
161 ; Delete VBoxService from registry
162 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
163
164 ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
165 Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
166
167FunctionEnd
168
169Function W2K_CopyFiles
170
171 Push $0
172 SetOutPath "$INSTDIR"
173
174 ; Video driver
175 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
176 FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
177
178 ; Mouse driver
179 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
180 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
181!ifdef VBOX_SIGN_ADDITIONS
182 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
183!endif
184
185 ; Guest driver
186 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
187 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
188!ifdef VBOX_SIGN_ADDITIONS
189 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
190!endif
191
192 ; Guest driver files
193 FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
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 == '7'
431 ${OrIf} $g_strWinVersion == 'Vista'
432 ${OrIf} $g_strWinVersion == '2003' ; Windows XP 64-bit is a renamed Windows 2003 really
433 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
434 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
435 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
436 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
437 ${EndIf}
438 SetRegView 64
439!endif
440 ${Endif}
441!endif
442
443 Goto done
444
445error:
446
447 Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
448
449done:
450
451 Pop $0
452
453FunctionEnd
454
455Function W2K_Main
456
457 SetOutPath "$INSTDIR"
458 SetOverwrite on
459
460 Call W2K_Prepare
461 Call W2K_CopyFiles
462
463!ifdef WHQL_FAKE
464 Call W2K_WHQLFakeOn
465!endif
466
467 Call W2K_InstallFiles
468
469!ifdef WHQL_FAKE
470 Call W2K_WHQLFakeOff
471!endif
472
473 Call W2K_SetVideoResolution
474
475FunctionEnd
476
477!macro W2K_UninstallInstDir un
478Function ${un}W2K_UninstallInstDir
479
480 Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
481 Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
482 Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
483 Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
484
485 Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
486 Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
487 Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
488
489 Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
490
491 Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
492 Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
493 Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
494
495 Delete /REBOOTOK "$INSTDIR\VBCoInst.dll"
496 Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
497 Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; File from an older installation maybe, not present here anymore
498
499!if $%VBOX_WITH_WDDM% == "1"
500 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxVideoWddm.cat"
501 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
502 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
503 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
504
505 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
506 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
507 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
508 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
509 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
510 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
511 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
512
513 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
514 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
515 ; Try to delete libWine in case it is there from old installation
516 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\libWine.dll"
517
518 !if $%BUILD_TARGET_ARCH% == "amd64"
519 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
520
521 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu-x86.dll"
522 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLcrutil-x86.dll"
523 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu-x86.dll"
524 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpackspu-x86.dll"
525 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu-x86.dll"
526 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu-x86.dll"
527 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
528
529 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
530 Delete /REBOOTOK "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
531 !endif ; $%BUILD_TARGET_ARCH% == "amd64"
532!endif ; $%VBOX_WITH_WDDM% == "1"
533
534 ; WHQL fake
535!ifdef WHQL_FAKE
536 Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
537!endif
538
539 ; Log file
540 Delete /REBOOTOK "$INSTDIR\install.log"
541 Delete /REBOOTOK "$INSTDIR\install_ui.log"
542
543FunctionEnd
544!macroend
545!insertmacro W2K_UninstallInstDir ""
546!insertmacro W2K_UninstallInstDir "un."
547
548!macro W2K_Uninstall un
549Function ${un}W2K_Uninstall
550
551 Push $0
552
553 ; Remove VirtualBox video driver
554 DetailPrint "Uninstalling video driver ..."
555 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideo.inf'
556 Pop $0 ; Ret value
557 ; @todo Add error handling here!
558 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideo'
559 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
560 Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
561
562 ; Remove video driver
563!if $%VBOX_WITH_WDDM% == "1"
564 DetailPrint "Uninstalling WDDM video driver ..."
565 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf"'
566 Pop $0 ; Ret value
567 ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
568 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideoWddm'
569 Pop $0 ; Ret value
570 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
571 ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
572 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
573 Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
574!endif ; $%VBOX_WITH_WDDM% == "1"
575
576!if $%VBOX_WITH_CROGL% == "1"
577
578 DetailPrint "Removing 3D graphics support ..."
579
580 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
581 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
582 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
583 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
584 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
585 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
586 Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
587
588 ; Remove D3D stuff
589 ; @todo add a feature flag to only remove if installed explicitly
590 Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
591 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
592 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
593 Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
594 ; Update DLL cache
595 IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
596 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
597 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
598 IfFileExists g_strSystemDir\dllcache\msd3d9.dll" 0 +2
599 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
600 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
601 ; Restore original DX DLLs
602 IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
603 Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
604 Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
605 IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
606 Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
607 Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
608
609 !if $%BUILD_TARGET_ARCH% == "amd64"
610
611 ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
612 ${EnableX64FSRedirection}
613 Delete /REBOOTOK "$SYSDIR\VBoxOGLarrayspu.dll"
614 Delete /REBOOTOK "$SYSDIR\VBoxOGLcrutil.dll"
615 Delete /REBOOTOK "$SYSDIR\VBoxOGLerrorspu.dll"
616 Delete /REBOOTOK "$SYSDIR\VBoxOGLpackspu.dll"
617 Delete /REBOOTOK "$SYSDIR\VBoxOGLpassthroughspu.dll"
618 Delete /REBOOTOK "$SYSDIR\VBoxOGLfeedbackspu.dll"
619 Delete /REBOOTOK "$SYSDIR\VBoxOGL.dll"
620
621 ; Remove D3D stuff
622 ; @todo add a feature flag to only remove if installed explicitly
623 Delete /REBOOTOK "$SYSDIR\libWine.dll"
624 Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
625 Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
626 Delete /REBOOTOK "$SYSDIR\wined3d.dll"
627 ; Update DLL cache
628 IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
629 Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
630 Rename /REBOOTOK "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll"
631 IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
632 Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
633 Rename /REBOOTOK "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll"
634 ; Restore original DX DLLs
635 IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
636 Delete /REBOOTOK "$SYSDIR\d3d8.dll"
637 Rename /REBOOTOK "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll"
638 IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
639 Delete /REBOOTOK "$SYSDIR\d3d9.dll"
640 Rename /REBOOTOK "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll"
641 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
642 ${DisableX64FSRedirection}
643 !endif ; amd64
644
645 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
646
647!endif ; VBOX_WITH_CROGL
648
649 ; Remove mouse driver
650 DetailPrint "Removing mouse driver ..."
651 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxMouse'
652 Pop $0 ; Ret value
653 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
654 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
655 Pop $0 ; Ret value
656 ; @todo Add error handling here!
657
658 ; Delete the VBoxService service
659 Call ${un}StopVBoxService
660 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxService'
661 Pop $0 ; Ret value
662 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
663 Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
664
665 ; GINA
666 Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
667 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
668 ${If} $0 == "VBoxGINA.dll"
669 DetailPrint "Removing GINA ..."
670 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
671 ${EndIf}
672
673 ; Delete VBoxTray
674 Call ${un}StopVBoxTray
675 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
676
677 ; Remove guest driver
678 DetailPrint "Removing guest driver ..."
679 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxGuest.inf"'
680 Pop $0 ; Ret value
681 ; @todo Add error handling here!
682
683 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxGuest'
684 Pop $0 ; Ret value
685 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
686 Delete /REBOOTOK "$g_strSystemDir\vbcoinst.dll"
687 Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
688 Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
689 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
690 Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
691
692 ; Remove shared folders driver
693 DetailPrint "Removing shared folders driver ..."
694 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider remove VBoxSF'
695 Pop $0 ; Ret value
696 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxSF'
697 Pop $0 ; Ret value
698 Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
699 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
700
701 Pop $0
702
703FunctionEnd
704!macroend
705!insertmacro W2K_Uninstall ""
706!insertmacro W2K_Uninstall "un."
707
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