VirtualBox

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

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

Windows Guest Additions installer: Create temporary directories for 3D file replacement.

  • Property svn:eol-style set to native
File size: 25.3 KB
Line 
1
2Function W2K_SetVideoResolution
3
4 ; NSIS only supports global vars, even in functions -- great
5 Var /GLOBAL i
6 Var /GLOBAL tmp
7 Var /GLOBAL tmppath
8 Var /GLOBAL dev_id
9 Var /GLOBAL dev_desc
10
11 ; Check for all required parameters
12 StrCmp $g_iScreenX "0" exit
13 StrCmp $g_iScreenY "0" exit
14 StrCmp $g_iScreenBpp "0" exit
15
16 DetailPrint "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..."
17
18 ; Enumerate all video devices (up to 32 at the moment, use key "MaxObjectNumber" key later)
19 ${For} $i 0 32
20
21 ReadRegStr $tmp HKLM "HARDWARE\DEVICEMAP\VIDEO" "\Device\Video$i"
22 StrCmp $tmp "" dev_not_found
23
24 ; Extract path to video settings
25 ; Ex: \Registry\Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
26 ; Or: \Registry\Machine\System\CurrentControlSet\Control\Video\vboxvideo\Device0
27 ; Result: Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
28 Push "$tmp" ; String
29 Push "\" ; SubString
30 Push ">" ; SearchDirection
31 Push ">" ; StrInclusionDirection
32 Push "0" ; IncludeSubString
33 Push "2" ; Loops
34 Push "0" ; CaseSensitive
35 Call StrStrAdv
36 Pop $tmppath ; $1 only contains the full path
37 StrCmp $tmppath "" dev_not_found
38
39 ; Get device description
40 ReadRegStr $dev_desc HKLM "$tmppath" "Device Description"
41!ifdef _DEBUG
42 DetailPrint "Registry path: $tmppath"
43 DetailPrint "Registry path to device name: $temp"
44!endif
45 DetailPrint "Detected video device: $dev_desc"
46
47 ${If} $dev_desc == "VirtualBox Graphics Adapter"
48 DetailPrint "VirtualBox video device found!"
49 Goto dev_found
50 ${EndIf}
51 ${Next}
52 Goto dev_not_found
53
54dev_found:
55
56 ; If we're on Windows 2000, skip the ID detection ...
57 ${If} $g_strWinVersion == "2000"
58 Goto change_res
59 ${EndIf}
60 Goto dev_found_detect_id
61
62dev_found_detect_id:
63
64 StrCpy $i 0 ; Start at index 0
65 DetailPrint "Detecting device ID ..."
66
67dev_found_detect_id_loop:
68
69 ; Resolve real path to hardware instance "{GUID}"
70 EnumRegKey $dev_id HKLM "SYSTEM\CurrentControlSet\Control\Video" $i
71 StrCmp $dev_id "" dev_not_found ; No more entries? Jump out
72!ifdef _DEBUG
73 DetailPrint "Got device ID: $dev_id"
74!endif
75 ReadRegStr $dev_desc HKLM "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" "Device Description" ; Try to read device name
76 ${If} $dev_desc == "VirtualBox Graphics Adapter"
77 DetailPrint "Device ID of $dev_desc: $dev_id"
78 Goto change_res
79 ${EndIf}
80
81 IntOp $i $i + 1 ; Increment index
82 goto dev_found_detect_id_loop
83
84dev_not_found:
85
86 DetailPrint "No VirtualBox video device (yet) detected! No custom mode set."
87 Goto exit
88
89change_res:
90
91!ifdef _DEBUG
92 DetailPrint "Device description: $dev_desc"
93 DetailPrint "Device ID: $dev_id"
94!endif
95
96 Var /GLOBAL reg_path_device
97 Var /GLOBAL reg_path_monitor
98
99 DetailPrint "Custom mode set: Platform is Windows $g_strWinVersion"
100 ${If} $g_strWinVersion == "2000"
101 ${OrIf} $g_strWinVersion == "Vista"
102 StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0"
103 StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0\Mon00000001"
104 ${ElseIf} $g_strWinVersion == "XP"
105 ${OrIf} $g_strWinVersion == "7"
106 StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
107 StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
108 ${Else}
109 DetailPrint "Custom mode set: Windows $g_strWinVersion not supported yet"
110 Goto exit
111 ${EndIf}
112
113 ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
114 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
115 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
116 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
117
118 ; ... and tell Windows to use that mode on next start!
119 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
120 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
121 WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
122
123 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
124 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
125 WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
126
127 DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
128
129exit:
130
131FunctionEnd
132
133Function W2K_Prepare
134
135 ${If} $g_bNoVBoxServiceExit == "false"
136 ; Stop / kill VBoxService
137 Call StopVBoxService
138 ${EndIf}
139
140 ${If} $g_bNoVBoxTrayExit == "false"
141 ; Stop / kill VBoxTray
142 Call StopVBoxTray
143 ${EndIf}
144
145 ; Delete VBoxService from registry
146 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
147
148 ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
149 Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
150
151FunctionEnd
152
153Function W2K_CopyFiles
154
155 Push $0
156 SetOutPath "$INSTDIR"
157
158 ; Video driver
159 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
160 FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
161
162 ; Mouse driver
163 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
164 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
165!ifdef VBOX_SIGN_ADDITIONS
166 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
167!endif
168
169 ; Guest driver
170 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
171 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
172!ifdef VBOX_SIGN_ADDITIONS
173 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
174!endif
175
176 ; Guest driver files
177 FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
178 FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
179 FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
180
181 ; WHQL fake
182!ifdef WHQL_FAKE
183 FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
184!endif
185
186 SetOutPath $g_strSystemDir
187
188 ; VBoxService
189 FILE "$%PATH_OUT%\bin\additions\VBoxService.exe" ; Only used by W2K and up (for Shared Folders at the moment)
190
191!if $%VBOX_WITH_CROGL% == "1"
192 !if $%VBOX_WITH_WDDM% == "1"
193 !if $%BUILD_TARGET_ARCH% == "x86"
194 ${If} $g_bWithWDDM == "true"
195 ; WDDM Video driver
196 StrCpy $0 "$TEMP\VBoxGuestAdditions\WDDM"
197 CreateDirectory "$0"
198 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys" "$INSTDIR\VBoxVideoWddm.sys" "$0"
199 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf" "$INSTDIR\VBoxVideoWddm.inf" "$0"
200 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll" "$INSTDIR\VBoxDispD3D.dll" "$0"
201
202 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll" "$INSTDIR\VBoxOGLarrayspu.dll" "$0"
203 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll" "$INSTDIR\VBoxOGLcrutil.dll" "$0"
204 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll" "$INSTDIR\VBoxOGLerrorspu.dll" "$0"
205 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll" "$INSTDIR\VBoxOGLpackspu.dll" "$0"
206 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll" "$INSTDIR\VBoxOGLpassthroughspu.dll" "$0"
207 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll" "$INSTDIR\VBoxOGLfeedbackspu.dll" "$0"
208 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGL.dll" "$INSTDIR\VBoxOGL.dll" "$0"
209
210 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\libWine.dll" "$INSTDIR\libWine.dll" "$0"
211 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll" "$INSTDIR\VBoxD3D9wddm.dll" "$0"
212 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\wined3dwddm.dll" "$INSTDIR\wined3dwddm.dll" "$0"
213
214 Goto doneCr
215 ${EndIf}
216 !endif ; $%BUILD_TARGET_ARCH% == "x86"
217 !endif ; $%VBOX_WITH_WDDM% == "1"
218 ; crOpenGL
219 !if $%BUILD_TARGET_ARCH% == "amd64"
220 !define LIBRARY_X64 ; Enable installation of 64-bit libraries
221 !endif
222 StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL"
223 CreateDirectory "$0"
224 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll" "$g_strSystemDir\VBoxOGLarrayspu.dll" "$0"
225 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll" "$g_strSystemDir\VBoxOGLcrutil.dll" "$0"
226 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll" "$g_strSystemDir\VBoxOGLerrorspu.dll" "$0"
227 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll" "$g_strSystemDir\VBoxOGLpackspu.dll" "$0"
228 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll" "$g_strSystemDir\VBoxOGLpassthroughspu.dll" "$0"
229 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll" "$g_strSystemDir\VBoxOGLfeedbackspu.dll" "$0"
230 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGL.dll" "$g_strSystemDir\VBoxOGL.dll" "$0"
231 !if $%BUILD_TARGET_ARCH% == "amd64"
232 !undef LIBRARY_X64 ; Disable installation of 64-bit libraries
233 !endif
234
235 !if $%BUILD_TARGET_ARCH% == "amd64"
236 StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL32"
237 CreateDirectory "$0"
238 ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
239 ; Wow64 node (32-bit sub system). Note that $SYSDIR contains the 32-bit
240 ; path after calling EnableX64FSRedirection
241 ${EnableX64FSRedirection}
242 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll" "$SYSDIR\VBoxOGLarrayspu.dll" "$0"
243 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll" "$SYSDIR\VBoxOGLcrutil.dll" "$0"
244 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll" "$SYSDIR\VBoxOGLerrorspu.dll" "$0"
245 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll" "$SYSDIR\VBoxOGLpackspu.dll" "$0"
246 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll" "$SYSDIR\VBoxOGLpassthroughspu.dll" "$0"
247 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll" "$SYSDIR\VBoxOGLfeedbackspu.dll" "$0"
248 !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll" "$SYSDIR\VBoxOGL.dll" "$0"
249 ${DisableX64FSRedirection}
250 !endif
251
252doneCr:
253
254!endif ; VBOX_WITH_CROGL
255
256 Pop $0
257
258FunctionEnd
259
260!ifdef WHQL_FAKE
261
262Function W2K_WHQLFakeOn
263
264 StrCmp $g_bFakeWHQL "true" do
265 Goto exit
266
267do:
268
269 DetailPrint "Turning off WHQL protection..."
270 nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"'
271
272exit:
273
274FunctionEnd
275
276Function W2K_WHQLFakeOff
277
278 StrCmp $g_bFakeWHQL "true" do
279 Goto exit
280
281do:
282
283 DetailPrint "Turning back on WHQL protection..."
284 nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"'
285
286exit:
287
288FunctionEnd
289
290!endif
291
292Function W2K_InstallFiles
293
294 ; The Shared Folder IFS goes to the system directory
295 FILE /oname=$g_strSystemDir\drivers\VBoxSF.sys "$%PATH_OUT%\bin\additions\VBoxSF.sys"
296 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
297 AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
298
299 ; The VBoxTray hook DLL also goes to the system directory; it might be locked
300 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
301 AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
302
303 DetailPrint "Installing Drivers..."
304
305drv_video:
306
307 StrCmp $g_bNoVideoDrv "true" drv_guest
308 SetOutPath "$INSTDIR"
309 ${If} $g_bWithWDDM == "true"
310 DetailPrint "Installing WDDM video driver ..."
311 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideoWddm.inf" "Display"'
312 ${Else}
313 DetailPrint "Installing video driver ..."
314 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideo.inf" "Display"'
315 ${EndIf}
316 Pop $0 ; Ret value
317 LogText "Video driver result: $0"
318 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
319
320drv_guest:
321
322 StrCmp $g_bNoGuestDrv "true" drv_mouse
323 DetailPrint "Installing guest driver ..."
324 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxGuest.inf" "Media"'
325 Pop $0 ; Ret value
326 LogText "Guest driver result: $0"
327 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
328
329drv_mouse:
330
331 StrCmp $g_bNoMouseDrv "true" vbox_service
332 DetailPrint "Installing mouse filter ..."
333 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /inf "$INSTDIR\VBoxMouse.inf"'
334 Pop $0 ; Ret value
335 LogText "Mouse driver returned: $0"
336 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
337
338vbox_service:
339
340 DetailPrint "Installing VirtualBox service ..."
341
342 ; Create the VBoxService service
343 ; No need to stop/remove the service here! Do this only on uninstallation!
344 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /createsvc "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxService.exe" "Base"'
345 Pop $0 ; Ret value
346 LogText "VBoxService returned: $0"
347
348 ; Set service description
349 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
350
351sf:
352
353 DetailPrint "Installing Shared Folders service ..."
354
355 ; Create the Shared Folders service ...
356 ; No need to stop/remove the service here! Do this only on uninstallation!
357 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /createsvc "VBoxSF" "VirtualBox Shared Folders" 2 1 "system32\drivers\VBoxSF.sys" "NetworkProvider"'
358
359 ; ... and the link to the network provider
360 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr"
361 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "Name" "VirtualBox Shared Folders"
362 WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll"
363
364 ; Add default network providers (if not present or corrupted)
365 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider WebClient'
366 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider LanmanWorkstation'
367 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider RDPNP'
368
369 ; Add the shared folders network provider
370 DetailPrint "Adding network provider (Order = $g_iSfOrder) ..."
371 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider VBoxSF $g_iSfOrder'
372 Pop $0 ; Ret value
373 IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
374
375!if $%VBOX_WITH_CROGL% == "1"
376cropengl:
377 ${If} $g_bWithWDDM == "true"
378 ; Nothing to do here
379 ${Else}
380 DetailPrint "Installing 3D OpenGL support ..."
381 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
382 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
383 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
384 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
385!if $%BUILD_TARGET_ARCH% == "amd64"
386 ; Write additional keys required for Windows XP, Vista and 7 64-bit (but for 32-bit stuff)
387 ${If} $g_strWinVersion == '7'
388 ${OrIf} $g_strWinVersion == 'Vista'
389 ${OrIf} $g_strWinVersion == 'XP'
390 WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
391 WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
392 WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
393 WriteRegStr HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
394 ${EndIf}
395!endif
396 ${Endif}
397!endif
398
399 Goto done
400
401error:
402
403 Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
404
405done:
406
407FunctionEnd
408
409Function W2K_Main
410
411 SetOutPath "$INSTDIR"
412 SetOverwrite on
413
414 Call W2K_Prepare
415 Call W2K_CopyFiles
416
417!ifdef WHQL_FAKE
418 Call W2K_WHQLFakeOn
419!endif
420
421 Call W2K_InstallFiles
422
423!ifdef WHQL_FAKE
424 Call W2K_WHQLFakeOff
425!endif
426
427 Call W2K_SetVideoResolution
428
429FunctionEnd
430
431!macro W2K_UninstallInstDir un
432Function ${un}W2K_UninstallInstDir
433
434 Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
435 Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
436 Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
437 Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
438
439 Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
440 Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
441 Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
442
443 Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
444
445 Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
446 Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
447 Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
448
449 Delete /REBOOTOK "$INSTDIR\VBCoInst.dll"
450 Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
451 Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; File from an older installation maybe, not present here anymore
452
453 ; WHQL fake
454!ifdef WHQL_FAKE
455 Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
456!endif
457
458 ; Log file
459 Delete /REBOOTOK "$INSTDIR\install.log"
460 Delete /REBOOTOK "$INSTDIR\install_ui.log"
461
462FunctionEnd
463!macroend
464!insertmacro W2K_UninstallInstDir ""
465!insertmacro W2K_UninstallInstDir "un."
466
467!macro W2K_Uninstall un
468Function ${un}W2K_Uninstall
469
470 Push $0
471!if $%VBOX_WITH_WDDM% == "1"
472 ; First check whether WDDM driver is installed
473 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /matchdrv "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "WDDM"'
474 Pop $0 ; Ret value
475 ${If} $0 == "0"
476 DetailPrint "WDDM display driver is installed"
477 StrCpy $g_bWithWDDM "true"
478 ${ElseIf} $0 == "4"
479 DetailPrint "Non-WDDM display driver is installed"
480 ${Else}
481 DetailPrint "Error occured"
482 ; @todo Add error handling here!
483 ${Endif}
484!endif
485
486 ; Remove VirtualBox graphics adapter & PCI base drivers
487 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00"'
488 Pop $0 ; Ret value
489 ; @todo Add error handling here!
490
491 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00"'
492 Pop $0 ; Ret value
493 ; @todo Add error handling here!
494
495 ; @todo restore old drivers
496
497 ; Remove video driver
498 ${If} $g_bWithWDDM == "true"
499 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideoWddm'
500 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
501 Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
502 ${Else}
503 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideo'
504 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
505 Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
506 ${Endif}
507
508 ; Remove mouse driver
509 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxMouse'
510 Pop $0 ; Ret value
511 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
512 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /reg_delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
513 Pop $0 ; Ret value
514 ; @todo Add error handling here!
515
516 ; Delete the VBoxService service
517 Call ${un}StopVBoxService
518 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxService'
519 Pop $0 ; Ret value
520 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
521 Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
522
523 ; GINA
524 Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
525 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
526 ${If} $0 == "VBoxGINA.dll"
527 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
528 ${EndIf}
529
530 ; Delete VBoxTray
531 Call ${un}StopVBoxTray
532 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
533
534 ; Remove guest driver
535 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxGuest'
536 Pop $0 ; Ret value
537 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
538 Delete /REBOOTOK "$g_strSystemDir\vbcoinst.dll"
539 Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
540 Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
541 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
542 Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
543
544 ; Remove shared folders driver
545 call ${un}RemoveProvider ; Remove Shared Folders network provider from registry
546 ; @todo Add a /delnetprovider to VBoxDrvInst for doing this job!
547 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxSF'
548 Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
549 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
550
551!if $%VBOX_WITH_CROGL% == "1"
552
553 DetailPrint "Removing 3D graphics support ..."
554 !if $%BUILD_TARGET_ARCH% == "x86"
555 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
556 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
557 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
558 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
559 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
560 Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
561 Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
562
563 ; Remove D3D stuff
564 ; @todo add a feature flag to only remove if installed explicitly
565 Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
566 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
567 Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
568 Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
569 ; Update DLL cache
570 IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
571 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
572 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
573 IfFileExists g_strSystemDir\dllcache\msd3d9.dll" 0 +2
574 Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
575 Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
576 ; Restore original DX DLLs
577 IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
578 Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
579 Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
580 IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
581 Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
582 Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
583
584 !else ; amd64
585
586 ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
587 ${EnableX64FSRedirection}
588 Delete /REBOOTOK "$SYSDIR\VBoxOGLarrayspu.dll"
589 Delete /REBOOTOK "$SYSDIR\VBoxOGLcrutil.dll"
590 Delete /REBOOTOK "$SYSDIR\VBoxOGLerrorspu.dll"
591 Delete /REBOOTOK "$SYSDIR\VBoxOGLpackspu.dll"
592 Delete /REBOOTOK "$SYSDIR\VBoxOGLpassthroughspu.dll"
593 Delete /REBOOTOK "$SYSDIR\VBoxOGLfeedbackspu.dll"
594 Delete /REBOOTOK "$SYSDIR\VBoxOGL.dll"
595
596 ; Remove D3D stuff
597 ; @todo add a feature flag to only remove if installed explicitly
598 Delete /REBOOTOK "$SYSDIR\libWine.dll"
599 Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
600 Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
601 Delete /REBOOTOK "$SYSDIR\wined3d.dll"
602 ; Update DLL cache
603 IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
604 Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
605 Rename /REBOOTOK "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll"
606 IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
607 Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
608 Rename /REBOOTOK "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll"
609 ; Restore original DX DLLs
610 IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
611 Delete /REBOOTOK "$SYSDIR\d3d8.dll"
612 Rename /REBOOTOK "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll"
613 IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
614 Delete /REBOOTOK "$SYSDIR\d3d9.dll"
615 Rename /REBOOTOK "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll"
616 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
617 ${DisableX64FSRedirection}
618 !endif ; amd64
619
620 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
621
622!endif ; VBOX_WITH_CROGL
623
624 Pop $0
625
626FunctionEnd
627!macroend
628!insertmacro W2K_Uninstall ""
629!insertmacro W2K_Uninstall "un."
630
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