VBoxGuestAdditionsW2KXP.nsh revision 3f6d4775faa373634b2f3fc2a90fc517733f6fd6
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFunction W2K_SetVideoResolution
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; NSIS only supports global vars, even in functions -- great
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL i
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL tmp
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL tmppath
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL dev_id
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL dev_desc
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Check for all required parameters
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCmp $g_iScreenX "0" exit
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCmp $g_iScreenY "0" exit
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCmp $g_iScreenBpp "0" exit
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..."
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Enumerate all video devices (up to 32 at the moment, use key "MaxObjectNumber" key later)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${For} $i 0 32
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ReadRegStr $tmp HKLM "HARDWARE\DEVICEMAP\VIDEO" "\Device\Video$i"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCmp $tmp "" dev_not_found
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Extract path to video settings
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Ex: \Registry\Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Or: \Registry\Machine\System\CurrentControlSet\Control\Video\vboxvideo\Device0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Result: Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push "$tmp" ; String
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push "\" ; SubString
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push ">" ; SearchDirection
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push ">" ; StrInclusionDirection
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push "0" ; IncludeSubString
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push "2" ; Loops
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Push "0" ; CaseSensitive
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Call StrStrAdv
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Pop $tmppath ; $1 only contains the full path
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCmp $tmppath "" dev_not_found
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Get device description
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ReadRegStr $dev_desc HKLM "$tmppath" "Device Description"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync!ifdef _DEBUG
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Registry path: $tmppath"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Registry path to device name: $temp"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Detected video device: $dev_desc"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${If} $dev_desc == "VirtualBox Graphics Adapter"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "VirtualBox video device found!"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Goto dev_found
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Goto dev_not_found
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; If we're on Windows 2000, skip the ID detection ...
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${If} $g_strWinVersion == "2000"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Goto change_res
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Goto dev_found_detect_id
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncdev_found_detect_id:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCpy $i 0 ; Start at index 0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Detecting device ID ..."
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncdev_found_detect_id_loop:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Resolve real path to hardware instance "{GUID}"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync EnumRegKey $dev_id HKLM "SYSTEM\CurrentControlSet\Control\Video" $i
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCmp $dev_id "" dev_not_found ; No more entries? Jump out
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync!ifdef _DEBUG
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Got device ID: $dev_id"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ReadRegStr $dev_desc HKLM "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" "Device Description" ; Try to read device name
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${If} $dev_desc == "VirtualBox Graphics Adapter"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Device ID of $dev_desc: $dev_id"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Goto change_res
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync IntOp $i $i + 1 ; Increment index
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync goto dev_found_detect_id_loop
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncdev_not_found:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "No VirtualBox video device (yet) detected! No custom mode set."
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync!ifdef _DEBUG
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Device description: $dev_desc"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Device ID: $dev_id"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL reg_path_device
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Var /GLOBAL reg_path_monitor
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Custom mode set: Platform is Windows $g_strWinVersion"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${If} $g_strWinVersion == "2000"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${OrIf} $g_strWinVersion == "Vista"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0\Mon00000001"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${ElseIf} $g_strWinVersion == "XP"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ${OrIf} $g_strWinVersion == "7"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Custom mode set: Windows $g_strWinVersion not supported yet"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; ... and tell Windows to use that mode on next start!
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFunction W2K_Prepare
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Stop / kill VBoxService
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Call StopVBoxService
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Stop / kill VBoxTray
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Call StopVBoxTray
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Delete VBoxService from registry
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFunction W2K_CopyFiles
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync SetOutPath "$INSTDIR"
FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
FILE "$%PATH_OUT%\bin\additions\VBoxService.exe" ; Only used by W2K and up (for Shared Folders at the moment)
FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
FILE "$%PATH_OUT%\bin\additions\libWine.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll"
nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"'
nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"'
!insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
!insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideoWddm.inf" "Display"'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideo.inf" "Display"'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxGuest.inf" "Media"'
; No need to stop/remove the service here! Do this only on uninstallation!
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /createsvc "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxService.exe" "Base"'
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
; No need to stop/remove the service here! Do this only on uninstallation!
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /createsvc "VBoxSF" "VirtualBox Shared Folders" 2 1 "system32\drivers\VBoxSF.sys" "NetworkProvider"'
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr"
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "Name" "VirtualBox Shared Folders"
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider WebClient'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider LanmanWorkstation'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider RDPNP'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider VBoxSF $g_iSfOrder'
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
WriteRegStr HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
Delete /REBOOTOK "$INSTDIR\VBCoInst.dll"
Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; File from an older installation maybe, not present here anymore
Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
Delete /REBOOTOK "$INSTDIR\install.log"
Delete /REBOOTOK "$INSTDIR\install_ui.log"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /matchdrv "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "WDDM"'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00"'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00"'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideoWddm'
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideo'
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxMouse'
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /reg_delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxService'
Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
${If} $0 == "VBoxGINA.dll"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxGuest'
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
Delete /REBOOTOK "$g_strSystemDir\vbcoinst.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxSF'
Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
IfFileExists g_strSystemDir\dllcache\msd3d9.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGLarrayspu.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGLcrutil.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGLerrorspu.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGLpackspu.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGLpassthroughspu.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGLfeedbackspu.dll"
Delete /REBOOTOK "$SYSDIR\VBoxOGL.dll"
Delete /REBOOTOK "$SYSDIR\libWine.dll"
Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
Delete /REBOOTOK "$SYSDIR\wined3d.dll"
IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\d3d8.dll"
IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\d3d9.dll"