VBoxGuestAdditionsW2KXP.nsh revision e7a38576d54d605f0a98a9646abb201ff8d995e4
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsyncFunction W2K_SetVideoResolution
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; NSIS only supports global vars, even in functions -- great
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Var /GLOBAL i
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Var /GLOBAL tmp
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync Var /GLOBAL tmppath
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Var /GLOBAL dev_id
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Var /GLOBAL dev_desc
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; Check for all required parameters
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync StrCmp $g_iScreenX "0" exit
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync StrCmp $g_iScreenY "0" exit
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync StrCmp $g_iScreenBpp "0" exit
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync DetailPrint "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..."
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync ; Enumerate all video devices (up to 32 at the moment, use key "MaxObjectNumber" key later)
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync ${For} $i 0 32
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ReadRegStr $tmp HKLM "HARDWARE\DEVICEMAP\VIDEO" "\Device\Video$i"
456f370fcde010d585d9174df045978a6c9893c1vboxsync StrCmp $tmp "" dev_not_found
27537ffef7291d0bb3a24e459a6b94c65586defevboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; Extract path to video settings
8c5d1958147c3988a7693b5a7666f5fe21a93b7bvboxsync ; Ex: \Registry\Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; Or: \Registry\Machine\System\CurrentControlSet\Control\Video\vboxvideo\Device0
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; Result: Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Push "$tmp" ; String
8c5d1958147c3988a7693b5a7666f5fe21a93b7bvboxsync Push "\" ; SubString
c4c106ad74e0ad745ac49a2c4182c4f42ced7248vboxsync Push ">" ; SearchDirection
742ee7392dfc0ce0b48216189ce26534208b3f48vboxsync Push ">" ; StrInclusionDirection
c4c106ad74e0ad745ac49a2c4182c4f42ced7248vboxsync Push "0" ; IncludeSubString
c4c106ad74e0ad745ac49a2c4182c4f42ced7248vboxsync Push "2" ; Loops
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Push "0" ; CaseSensitive
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Call StrStrAdv
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Pop $tmppath ; $1 only contains the full path
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync StrCmp $tmppath "" dev_not_found
b72771e8c6ba3b3d9ebdd7977730325131ae0f98vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; Get device description
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ReadRegStr $dev_desc HKLM "$tmppath" "Device Description"
f7d6665d93770b79026556438d5e081807917420vboxsync!ifdef _DEBUG
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync DetailPrint "Registry path: $tmppath"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync DetailPrint "Registry path to device name: $temp"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync!endif
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync DetailPrint "Detected video device: $dev_desc"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync ${If} $dev_desc == "VirtualBox Graphics Adapter"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync DetailPrint "VirtualBox video device found!"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Goto dev_found
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ${EndIf}
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ${Next}
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Goto dev_not_found
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsyncdev_found:
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ; If we're on Windows 2000, skip the ID detection ...
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${If} $g_strWinVersion == "2000"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync Goto change_res
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${EndIf}
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync Goto dev_found_detect_id
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsyncdev_found_detect_id:
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync StrCpy $i 0 ; Start at index 0
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync DetailPrint "Detecting device ID ..."
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsyncdev_found_detect_id_loop:
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ; Resolve real path to hardware instance "{GUID}"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync EnumRegKey $dev_id HKLM "SYSTEM\CurrentControlSet\Control\Video" $i
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync StrCmp $dev_id "" dev_not_found ; No more entries? Jump out
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync!ifdef _DEBUG
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync DetailPrint "Got device ID: $dev_id"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync!endif
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ReadRegStr $dev_desc HKLM "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" "Device Description" ; Try to read device name
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync ${If} $dev_desc == "VirtualBox Graphics Adapter"
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync DetailPrint "Device ID of $dev_desc: $dev_id"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Goto change_res
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${EndIf}
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync IntOp $i $i + 1 ; Increment index
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync goto dev_found_detect_id_loop
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsyncdev_not_found:
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync DetailPrint "No VirtualBox video device (yet) detected! No custom mode set."
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync Goto exit
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsyncchange_res:
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync!ifdef _DEBUG
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync DetailPrint "Device description: $dev_desc"
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync DetailPrint "Device ID: $dev_id"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync!endif
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Var /GLOBAL reg_path_device
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Var /GLOBAL reg_path_monitor
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync DetailPrint "Custom mode set: Platform is Windows $g_strWinVersion"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${If} $g_strWinVersion == "2000"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${OrIf} $g_strWinVersion == "Vista"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0\Mon00000001"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${ElseIf} $g_strWinVersion == "XP"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${OrIf} $g_strWinVersion == "7"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${Else}
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync DetailPrint "Custom mode set: Windows $g_strWinVersion not supported yet"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync Goto exit
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${EndIf}
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ; ... and tell Windows to use that mode on next start!
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncexit:
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsyncFunctionEnd
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsyncFunction W2K_Prepare
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${If} $g_bNoVBoxServiceExit == "false"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ; Stop / kill VBoxService
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync Call StopVBoxService
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${EndIf}
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${If} $g_bNoVBoxTrayExit == "false"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ; Stop / kill VBoxTray
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync Call StopVBoxTray
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync ${EndIf}
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
df3d4c8e9c81584c535676a3d40c57d868ac61bbvboxsync ; Delete VBoxService from registry
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
ea17f2e36383176db94ff3608f628a1e7432fa60vboxsyncFunctionEnd
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsyncFunction W2K_CopyFiles
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Push $0
9c59bcefe2993070fafaf0d6cee9673f48479128vboxsync SetOutPath "$INSTDIR"
f902ede7eb073d09a81c1d470c089c7b14921714vboxsync
97674677e4f2aeae576c39f966568dd664ba7979vboxsync ; Video driver
efbdd9fc22305720d20be7cc37b4f45f43146b09vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
18673eee0624b4581d3d56ab9ad9d10ebc7f5bddvboxsync
22e47c581ecabc66ee210e93099727074f74b2b9vboxsync ; Mouse driver
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync!ifdef VBOX_SIGN_ADDITIONS
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync!endif
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; Guest driver
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync!ifdef VBOX_SIGN_ADDITIONS
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
3b58b08293698f7f081b5558c52e80741a4a6763vboxsync!endif
c5861c548c83913808475ea59cab2e09a23247c8vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync ; Guest driver files
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; WHQL fake
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync!ifdef WHQL_FAKE
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync!endif
ea17f2e36383176db94ff3608f628a1e7432fa60vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync SetOutPath $g_strSystemDir
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; VBoxService
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxService.exe" ; Only used by W2K and up (for Shared Folders at the moment)
9c59bcefe2993070fafaf0d6cee9673f48479128vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync!if $%VBOX_WITH_CROGL% == "1"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !if $%VBOX_WITH_WDDM% == "1"
efbdd9fc22305720d20be7cc37b4f45f43146b09vboxsync !if $%BUILD_TARGET_ARCH% == "x86"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ${If} $g_bWithWDDM == "true"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; WDDM Video driver
771761cda2c81e899526a0dce22c8cd2510fff82vboxsync StrCpy $0 "$TEMP\VBoxGuestAdditions\WDDM"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync CreateDirectory "$0"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys" "$INSTDIR\VBoxVideoWddm.sys" "$0"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf" "$INSTDIR\VBoxVideoWddm.inf" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll" "$INSTDIR\VBoxDispD3D.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll" "$INSTDIR\VBoxOGLarrayspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll" "$INSTDIR\VBoxOGLcrutil.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll" "$INSTDIR\VBoxOGLerrorspu.dll" "$0"
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll" "$INSTDIR\VBoxOGLpackspu.dll" "$0"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll" "$INSTDIR\VBoxOGLpassthroughspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll" "$INSTDIR\VBoxOGLfeedbackspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGL.dll" "$INSTDIR\VBoxOGL.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\libWine.dll" "$INSTDIR\libWine.dll" "$0"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll" "$INSTDIR\VBoxD3D9wddm.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\wined3dwddm.dll" "$INSTDIR\wined3dwddm.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync Goto doneCr
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${EndIf}
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !endif ; $%BUILD_TARGET_ARCH% == "x86"
8e1c5c73ab19c968abbd3decf41e4783cbd8c017vboxsync !endif ; $%VBOX_WITH_WDDM% == "1"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ; crOpenGL
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !if $%BUILD_TARGET_ARCH% == "amd64"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !define LIBRARY_X64 ; Enable installation of 64-bit libraries
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !endif
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync CreateDirectory "$0"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll" "$g_strSystemDir\VBoxOGLarrayspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll" "$g_strSystemDir\VBoxOGLcrutil.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll" "$g_strSystemDir\VBoxOGLerrorspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll" "$g_strSystemDir\VBoxOGLpackspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll" "$g_strSystemDir\VBoxOGLpassthroughspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll" "$g_strSystemDir\VBoxOGLfeedbackspu.dll" "$0"
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%PATH_OUT%\bin\additions\VBoxOGL.dll" "$g_strSystemDir\VBoxOGL.dll" "$0"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync !if $%BUILD_TARGET_ARCH% == "amd64"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !undef LIBRARY_X64 ; Disable installation of 64-bit libraries
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !endif
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync !if $%BUILD_TARGET_ARCH% == "amd64"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync StrCpy $0 "$TEMP\VBoxGuestAdditions\VBoxOGL32"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync CreateDirectory "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ; Wow64 node (32-bit sub system). Note that $SYSDIR contains the 32-bit
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ; path after calling EnableX64FSRedirection
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ${EnableX64FSRedirection}
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll" "$SYSDIR\VBoxOGLarrayspu.dll" "$0"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll" "$SYSDIR\VBoxOGLcrutil.dll" "$0"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll" "$SYSDIR\VBoxOGLerrorspu.dll" "$0"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll" "$SYSDIR\VBoxOGLpackspu.dll" "$0"
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll" "$SYSDIR\VBoxOGLpassthroughspu.dll" "$0"
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll" "$SYSDIR\VBoxOGLfeedbackspu.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll" "$SYSDIR\VBoxOGL.dll" "$0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ${DisableX64FSRedirection}
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync !endif
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsyncdoneCr:
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync!endif ; VBOX_WITH_CROGL
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync Pop $0
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsyncFunctionEnd
ae9aaa62489b8ace9ce2a0a15f0b2f7d3be340c6vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync!ifdef WHQL_FAKE
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsyncFunction W2K_WHQLFakeOn
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync StrCmp $g_bFakeWHQL "true" do
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync Goto exit
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsyncdo:
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync DetailPrint "Turning off WHQL protection..."
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"'
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsyncexit:
ae9aaa62489b8ace9ce2a0a15f0b2f7d3be340c6vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsyncFunctionEnd
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsyncFunction W2K_WHQLFakeOff
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync StrCmp $g_bFakeWHQL "true" do
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync Goto exit
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsync
1d258b8772ee104b5fab3d1743eabc2f5cfe2fa4vboxsyncdo:
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync DetailPrint "Turning back on WHQL protection..."
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"'
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsyncexit:
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncFunctionEnd
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync!endif
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsyncFunction W2K_InstallFiles
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ; The Shared Folder IFS goes to the system directory
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync FILE /oname=$g_strSystemDir\drivers\VBoxSF.sys "$%PATH_OUT%\bin\additions\VBoxSF.sys"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync ; The VBoxTray hook DLL also goes to the system directory; it might be locked
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
6e3cc82d5d5effda92c9fec18b870d54386f99favboxsync
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync DetailPrint "Installing Drivers..."
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsyncdrv_video:
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync StrCmp $g_bNoVideoDrv "true" drv_guest
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync SetOutPath "$INSTDIR"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ${If} $g_bWithWDDM == "true"
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync DetailPrint "Installing WDDM video driver ..."
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideoWddm.inf" "Display"'
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync ${Else}
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync DetailPrint "Installing video driver ..."
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideo.inf" "Display"'
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync ${EndIf}
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync Pop $0 ; Ret value
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync LogText "Video driver result: $0"
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsync
76800c2d8e954bb5249d2d30f4af41c6ea03ad5evboxsyncdrv_guest:
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync StrCmp $g_bNoGuestDrv "true" drv_mouse
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync DetailPrint "Installing guest driver ..."
8dc3361c3de6b4f38230d57c547ab74b713f6ff1vboxsync nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxGuest.inf" "Media"'
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync Pop $0 ; Ret value
LogText "Guest driver result: $0"
IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
drv_mouse:
StrCmp $g_bNoMouseDrv "true" vbox_service
DetailPrint "Installing mouse filter ..."
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /inf "$INSTDIR\VBoxMouse.inf"'
Pop $0 ; Ret value
LogText "Mouse driver returned: $0"
IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
vbox_service:
DetailPrint "Installing VirtualBox service ..."
; Create the VBoxService service
; 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"'
Pop $0 ; Ret value
LogText "VBoxService returned: $0"
; Set service description
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
sf:
DetailPrint "Installing Shared Folders service ..."
; Create the Shared Folders service ...
; 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"'
; ... and the link to the network provider
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"
; Add default network providers (if not present or corrupted)
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider WebClient'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider LanmanWorkstation'
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider RDPNP'
; Add the shared folders network provider
DetailPrint "Adding network provider (Order = $g_iSfOrder) ..."
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider VBoxSF $g_iSfOrder'
Pop $0 ; Ret value
IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
!if $%VBOX_WITH_CROGL% == "1"
cropengl:
${If} $g_bWithWDDM == "true"
; Nothing to do here
${Else}
DetailPrint "Installing 3D OpenGL support ..."
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
!if $%BUILD_TARGET_ARCH% == "amd64"
; Write additional keys required for Windows XP, Vista and 7 64-bit (but for 32-bit stuff)
${If} $g_strWinVersion == '7'
${OrIf} $g_strWinVersion == 'Vista'
${OrIf} $g_strWinVersion == 'XP'
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"
${EndIf}
!endif
${Endif}
!endif
Goto done
error:
Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
done:
FunctionEnd
Function W2K_Main
SetOutPath "$INSTDIR"
SetOverwrite on
Call W2K_Prepare
Call W2K_CopyFiles
!ifdef WHQL_FAKE
Call W2K_WHQLFakeOn
!endif
Call W2K_InstallFiles
!ifdef WHQL_FAKE
Call W2K_WHQLFakeOff
!endif
Call W2K_SetVideoResolution
FunctionEnd
!macro W2K_UninstallInstDir un
Function ${un}W2K_UninstallInstDir
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
; WHQL fake
!ifdef WHQL_FAKE
Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
!endif
; Log file
Delete /REBOOTOK "$INSTDIR\install.log"
Delete /REBOOTOK "$INSTDIR\install_ui.log"
FunctionEnd
!macroend
!insertmacro W2K_UninstallInstDir ""
!insertmacro W2K_UninstallInstDir "un."
!macro W2K_Uninstall un
Function ${un}W2K_Uninstall
Push $0
!if $%VBOX_WITH_WDDM% == "1"
; First check whether WDDM driver is installed
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /matchdrv "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "WDDM"'
Pop $0 ; Ret value
${If} $0 == "0"
DetailPrint "WDDM display driver is installed"
StrCpy $g_bWithWDDM "true"
${ElseIf} $0 == "4"
DetailPrint "Non-WDDM display driver is installed"
${Else}
DetailPrint "Error occured"
; @todo Add error handling here!
${Endif}
!endif
; Remove VirtualBox graphics adapter & PCI base drivers
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00"'
Pop $0 ; Ret value
; @todo Add error handling here!
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00"'
Pop $0 ; Ret value
; @todo Add error handling here!
; @todo restore old drivers
; Remove video driver
${If} $g_bWithWDDM == "true"
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideoWddm'
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
${Else}
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideo'
Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
${Endif}
; Remove mouse driver
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxMouse'
Pop $0 ; Ret value
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"'
Pop $0 ; Ret value
; @todo Add error handling here!
; Delete the VBoxService service
Call ${un}StopVBoxService
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxService'
Pop $0 ; Ret value
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
; GINA
Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
${If} $0 == "VBoxGINA.dll"
DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
${EndIf}
; Delete VBoxTray
Call ${un}StopVBoxTray
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
; Remove guest driver
nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxGuest'
Pop $0 ; Ret value
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"
; Remove shared folders driver
call ${un}RemoveProvider ; Remove Shared Folders network provider from registry
; @todo Add a /delnetprovider to VBoxDrvInst for doing this job!
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"
!if $%VBOX_WITH_CROGL% == "1"
DetailPrint "Removing 3D graphics support ..."
!if $%BUILD_TARGET_ARCH% == "x86"
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"
; Remove D3D stuff
; @todo add a feature flag to only remove if installed explicitly
Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
; Update DLL cache
IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
IfFileExists g_strSystemDir\dllcache\msd3d9.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
; Restore original DX DLLs
IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
!else ; amd64
; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
${EnableX64FSRedirection}
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"
; Remove D3D stuff
; @todo add a feature flag to only remove if installed explicitly
Delete /REBOOTOK "$SYSDIR\libWine.dll"
Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
Delete /REBOOTOK "$SYSDIR\wined3d.dll"
; Update DLL cache
IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
Rename /REBOOTOK "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll"
IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
Rename /REBOOTOK "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll"
; Restore original DX DLLs
IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\d3d8.dll"
Rename /REBOOTOK "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll"
IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
Delete /REBOOTOK "$SYSDIR\d3d9.dll"
Rename /REBOOTOK "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll"
DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
${DisableX64FSRedirection}
!endif ; amd64
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
!endif ; VBOX_WITH_CROGL
Pop $0
FunctionEnd
!macroend
!insertmacro W2K_Uninstall ""
!insertmacro W2K_Uninstall "un."