1 |
|
---|
2 | Function 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 |
|
---|
54 | dev_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 |
|
---|
62 | dev_found_detect_id:
|
---|
63 |
|
---|
64 | StrCpy $i 0 ; Start at index 0
|
---|
65 | DetailPrint "Detecting device ID ..."
|
---|
66 |
|
---|
67 | dev_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 |
|
---|
84 | dev_not_found:
|
---|
85 |
|
---|
86 | DetailPrint "No VirtualBox video device (yet) detected! No custom mode set."
|
---|
87 | Goto exit
|
---|
88 |
|
---|
89 | change_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 |
|
---|
129 | exit:
|
---|
130 |
|
---|
131 | FunctionEnd
|
---|
132 |
|
---|
133 | Function W2K_Prepare
|
---|
134 |
|
---|
135 | ; Stop / kill VBoxService
|
---|
136 | Call StopVBoxService
|
---|
137 |
|
---|
138 | ; Stop / kill VBoxTray
|
---|
139 | Call StopVBoxTray
|
---|
140 |
|
---|
141 | ; Delete VBoxService from registry
|
---|
142 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
|
---|
143 |
|
---|
144 | ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
|
---|
145 | Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
|
---|
146 |
|
---|
147 | FunctionEnd
|
---|
148 |
|
---|
149 | Function W2K_CopyFiles
|
---|
150 |
|
---|
151 | SetOutPath "$INSTDIR"
|
---|
152 |
|
---|
153 | ; Video driver
|
---|
154 | FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
|
---|
155 | FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
|
---|
156 |
|
---|
157 | ; Mouse driver
|
---|
158 | FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
|
---|
159 | FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
|
---|
160 | !ifdef VBOX_SIGN_ADDITIONS
|
---|
161 | FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
|
---|
162 | !endif
|
---|
163 |
|
---|
164 | ; Guest driver
|
---|
165 | FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
|
---|
166 | FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
|
---|
167 | !ifdef VBOX_SIGN_ADDITIONS
|
---|
168 | FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
|
---|
169 | !endif
|
---|
170 |
|
---|
171 | ; Guest driver files
|
---|
172 | FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
|
---|
173 | FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
|
---|
174 | FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
|
---|
175 |
|
---|
176 | ; WHQL fake
|
---|
177 | !ifdef WHQL_FAKE
|
---|
178 | FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
|
---|
179 | !endif
|
---|
180 |
|
---|
181 | SetOutPath $g_strSystemDir
|
---|
182 |
|
---|
183 | ; VBoxService
|
---|
184 | FILE "$%PATH_OUT%\bin\additions\VBoxService.exe" ; Only used by W2K and up (for Shared Folders at the moment)
|
---|
185 |
|
---|
186 | !if $%VBOX_WITH_CROGL% == "1"
|
---|
187 | !if $%VBOXWDDM% == "1"
|
---|
188 | !if $%BUILD_TARGET_ARCH% == "x86"
|
---|
189 | ${If} $g_bInstallWDDM == "true"
|
---|
190 | SetOutPath "$INSTDIR"
|
---|
191 | ; WDDM Video driver
|
---|
192 | FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
|
---|
193 | FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
|
---|
194 | FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
|
---|
195 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
|
---|
196 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
|
---|
197 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
|
---|
198 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
|
---|
199 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
|
---|
200 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
|
---|
201 | FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
|
---|
202 | FILE "$%PATH_OUT%\bin\additions\libWine.dll"
|
---|
203 | FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
|
---|
204 | FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
|
---|
205 | SetOutPath $g_strSystemDir
|
---|
206 | Goto doneCr
|
---|
207 | ${EndIf}
|
---|
208 | !endif
|
---|
209 | !endif
|
---|
210 | ; crOpenGL
|
---|
211 | SetOutPath $g_strSystemDir
|
---|
212 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
|
---|
213 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
|
---|
214 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
|
---|
215 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
|
---|
216 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
|
---|
217 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
|
---|
218 | FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
|
---|
219 |
|
---|
220 | !if $%BUILD_TARGET_ARCH% == "amd64"
|
---|
221 | ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
|
---|
222 | ; Wow64 node (32-bit sub system).
|
---|
223 | ${EnableX64FSRedirection}
|
---|
224 | SetOutPath $SYSDIR
|
---|
225 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll"
|
---|
226 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll"
|
---|
227 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll"
|
---|
228 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll"
|
---|
229 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll"
|
---|
230 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll"
|
---|
231 | FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll"
|
---|
232 | ${DisableX64FSRedirection}
|
---|
233 | !endif
|
---|
234 |
|
---|
235 | doneCr:
|
---|
236 |
|
---|
237 | !endif ; VBOX_WITH_CROGL
|
---|
238 |
|
---|
239 | FunctionEnd
|
---|
240 |
|
---|
241 | !ifdef WHQL_FAKE
|
---|
242 |
|
---|
243 | Function W2K_WHQLFakeOn
|
---|
244 |
|
---|
245 | StrCmp $g_bFakeWHQL "true" do
|
---|
246 | Goto exit
|
---|
247 |
|
---|
248 | do:
|
---|
249 |
|
---|
250 | DetailPrint "Turning off WHQL protection..."
|
---|
251 | nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"'
|
---|
252 |
|
---|
253 | exit:
|
---|
254 |
|
---|
255 | FunctionEnd
|
---|
256 |
|
---|
257 | Function W2K_WHQLFakeOff
|
---|
258 |
|
---|
259 | StrCmp $g_bFakeWHQL "true" do
|
---|
260 | Goto exit
|
---|
261 |
|
---|
262 | do:
|
---|
263 |
|
---|
264 | DetailPrint "Turning back on WHQL protection..."
|
---|
265 | nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"'
|
---|
266 |
|
---|
267 | exit:
|
---|
268 |
|
---|
269 | FunctionEnd
|
---|
270 |
|
---|
271 | !endif
|
---|
272 |
|
---|
273 | Function W2K_InstallFiles
|
---|
274 |
|
---|
275 | ; The Shared Folder IFS goes to the system directory
|
---|
276 | FILE /oname=$g_strSystemDir\drivers\VBoxSF.sys "$%PATH_OUT%\bin\additions\VBoxSF.sys"
|
---|
277 | !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll" "$g_strSystemDir\VBoxMRXNP.dll" "$INSTDIR"
|
---|
278 | AccessControl::GrantOnFile "$g_strSystemDir\VBoxMRXNP.dll" "(BU)" "GenericRead"
|
---|
279 |
|
---|
280 | ; The VBoxTray hook DLL also goes to the system directory; it might be locked
|
---|
281 | !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR"
|
---|
282 | AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead"
|
---|
283 |
|
---|
284 | DetailPrint "Installing Drivers..."
|
---|
285 |
|
---|
286 | drv_video:
|
---|
287 |
|
---|
288 | StrCmp $g_bNoVideoDrv "true" drv_guest
|
---|
289 | SetOutPath "$INSTDIR"
|
---|
290 | DetailPrint "Installing video driver ..."
|
---|
291 | ${If} $g_bInstallWDDM == "true"
|
---|
292 | DetailPrint "WDDM Driver being installed ..."
|
---|
293 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideoWddm.inf" "Display"'
|
---|
294 | ${Else}
|
---|
295 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxVideo.inf" "Display"'
|
---|
296 | ${EndIf}
|
---|
297 | Pop $0 ; Ret value
|
---|
298 | LogText "Video driver result: $0"
|
---|
299 | IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
|
---|
300 |
|
---|
301 | drv_guest:
|
---|
302 |
|
---|
303 | StrCmp $g_bNoGuestDrv "true" drv_mouse
|
---|
304 | DetailPrint "Installing guest driver ..."
|
---|
305 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /i "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00" "$INSTDIR\VBoxGuest.inf" "Media"'
|
---|
306 | Pop $0 ; Ret value
|
---|
307 | LogText "Guest driver result: $0"
|
---|
308 | IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
|
---|
309 |
|
---|
310 | drv_mouse:
|
---|
311 |
|
---|
312 | StrCmp $g_bNoMouseDrv "true" vbox_service
|
---|
313 | DetailPrint "Installing mouse filter ..."
|
---|
314 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /inf "$INSTDIR\VBoxMouse.inf"'
|
---|
315 | Pop $0 ; Ret value
|
---|
316 | LogText "Mouse driver returned: $0"
|
---|
317 | IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
|
---|
318 |
|
---|
319 | vbox_service:
|
---|
320 |
|
---|
321 | DetailPrint "Installing VirtualBox service ..."
|
---|
322 |
|
---|
323 | ; Create the VBoxService service
|
---|
324 | ; No need to stop/remove the service here! Do this only on uninstallation!
|
---|
325 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /createsvc "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxService.exe" "Base"'
|
---|
326 | Pop $0 ; Ret value
|
---|
327 | LogText "VBoxService returned: $0"
|
---|
328 |
|
---|
329 | ; Set service description
|
---|
330 | WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
|
---|
331 |
|
---|
332 | sf:
|
---|
333 |
|
---|
334 | DetailPrint "Installing Shared Folders service ..."
|
---|
335 |
|
---|
336 | ; Create the Shared Folders service ...
|
---|
337 | ; No need to stop/remove the service here! Do this only on uninstallation!
|
---|
338 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /createsvc "VBoxSF" "VirtualBox Shared Folders" 2 1 "system32\drivers\VBoxSF.sys" "NetworkProvider"'
|
---|
339 |
|
---|
340 | ; ... and the link to the network provider
|
---|
341 | WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr"
|
---|
342 | WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "Name" "VirtualBox Shared Folders"
|
---|
343 | WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll"
|
---|
344 |
|
---|
345 | ; Add default network providers (if not present or corrupted)
|
---|
346 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider WebClient'
|
---|
347 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider LanmanWorkstation'
|
---|
348 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider RDPNP'
|
---|
349 |
|
---|
350 | ; Add the shared folders network provider
|
---|
351 | DetailPrint "Adding network provider (Order = $g_iSfOrder) ..."
|
---|
352 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /addnetprovider VBoxSF $g_iSfOrder'
|
---|
353 | Pop $0 ; Ret value
|
---|
354 | IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
|
---|
355 |
|
---|
356 | !if $%VBOX_WITH_CROGL% == "1"
|
---|
357 | cropengl:
|
---|
358 | ${If} $g_bInstallWDDM == "true"
|
---|
359 | ${Else}
|
---|
360 | DetailPrint "Installing 3D OpenGL support ..."
|
---|
361 | WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
|
---|
362 | WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
|
---|
363 | WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
|
---|
364 | WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
|
---|
365 |
|
---|
366 | !if $%BUILD_TARGET_ARCH% == "amd64"
|
---|
367 | ; Write additional keys required for Windows XP, Vista and 7 64-bit (but for 32-bit stuff)
|
---|
368 | ${If} $g_strWinVersion == '7'
|
---|
369 | ${OrIf} $g_strWinVersion == 'Vista'
|
---|
370 | ${OrIf} $g_strWinVersion == 'XP'
|
---|
371 | WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
|
---|
372 | WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
|
---|
373 | WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
|
---|
374 | WriteRegStr HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
|
---|
375 | ${EndIf}
|
---|
376 | !endif
|
---|
377 | ${Endif}
|
---|
378 | !endif
|
---|
379 |
|
---|
380 | Goto done
|
---|
381 |
|
---|
382 | error:
|
---|
383 |
|
---|
384 | Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
|
---|
385 |
|
---|
386 | done:
|
---|
387 |
|
---|
388 | FunctionEnd
|
---|
389 |
|
---|
390 | Function W2K_Main
|
---|
391 |
|
---|
392 | SetOutPath "$INSTDIR"
|
---|
393 | SetOverwrite on
|
---|
394 |
|
---|
395 | Call W2K_Prepare
|
---|
396 | Call W2K_CopyFiles
|
---|
397 |
|
---|
398 | !ifdef WHQL_FAKE
|
---|
399 | Call W2K_WHQLFakeOn
|
---|
400 | !endif
|
---|
401 |
|
---|
402 | Call W2K_InstallFiles
|
---|
403 |
|
---|
404 | !ifdef WHQL_FAKE
|
---|
405 | Call W2K_WHQLFakeOff
|
---|
406 | !endif
|
---|
407 |
|
---|
408 | Call W2K_SetVideoResolution
|
---|
409 |
|
---|
410 | FunctionEnd
|
---|
411 |
|
---|
412 | !macro W2K_UninstallInstDir un
|
---|
413 | Function ${un}W2K_UninstallInstDir
|
---|
414 |
|
---|
415 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
|
---|
416 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
|
---|
417 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
|
---|
418 | Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
|
---|
419 |
|
---|
420 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
|
---|
421 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
|
---|
422 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
|
---|
423 |
|
---|
424 | Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
|
---|
425 |
|
---|
426 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
|
---|
427 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
|
---|
428 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
|
---|
429 |
|
---|
430 | Delete /REBOOTOK "$INSTDIR\VBCoInst.dll"
|
---|
431 | Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
|
---|
432 | Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; File from an older installation maybe, not present here anymore
|
---|
433 |
|
---|
434 | ; WHQL fake
|
---|
435 | !ifdef WHQL_FAKE
|
---|
436 | Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
|
---|
437 | !endif
|
---|
438 |
|
---|
439 | ; Log file
|
---|
440 | Delete /REBOOTOK "$INSTDIR\install.log"
|
---|
441 | Delete /REBOOTOK "$INSTDIR\install_ui.log"
|
---|
442 |
|
---|
443 | FunctionEnd
|
---|
444 | !macroend
|
---|
445 | !insertmacro W2K_UninstallInstDir ""
|
---|
446 | !insertmacro W2K_UninstallInstDir "un."
|
---|
447 |
|
---|
448 | !macro W2K_Uninstall un
|
---|
449 | Function ${un}W2K_Uninstall
|
---|
450 |
|
---|
451 | Push $0
|
---|
452 | !if $%VBOXWDDM% == "1"
|
---|
453 | ; First check whether WDDM driver is installed
|
---|
454 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /matchdrv "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "WDDM"'
|
---|
455 | Pop $0 ; Ret value
|
---|
456 | ${If} $0 == "0"
|
---|
457 | DetailPrint "WDDM Driver is installed"
|
---|
458 | StrCpy $g_bInstallWDDM "true"
|
---|
459 | ${ElseIf} $0 == "4"
|
---|
460 | DetailPrint "Non-WDDM Driver is installed"
|
---|
461 | ${Else}
|
---|
462 | DetailPrint "Error occured"
|
---|
463 | ; @todo Add error handling here!
|
---|
464 | ${Endif}
|
---|
465 | !endif
|
---|
466 |
|
---|
467 | ; Remove VirtualBox graphics adapter & PCI base drivers
|
---|
468 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00"'
|
---|
469 | Pop $0 ; Ret value
|
---|
470 | ; @todo Add error handling here!
|
---|
471 |
|
---|
472 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00"'
|
---|
473 | Pop $0 ; Ret value
|
---|
474 | ; @todo Add error handling here!
|
---|
475 |
|
---|
476 | ; @todo restore old drivers
|
---|
477 |
|
---|
478 | ; Remove video driver
|
---|
479 | ${If} $g_bInstallWDDM == "true"
|
---|
480 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideoWddm'
|
---|
481 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
|
---|
482 | Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
|
---|
483 | ${Else}
|
---|
484 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideo'
|
---|
485 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
|
---|
486 | Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
|
---|
487 | ${Endif}
|
---|
488 |
|
---|
489 | ; Remove mouse driver
|
---|
490 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxMouse'
|
---|
491 | Pop $0 ; Ret value
|
---|
492 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
|
---|
493 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /reg_delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
|
---|
494 | Pop $0 ; Ret value
|
---|
495 | ; @todo Add error handling here!
|
---|
496 |
|
---|
497 | ; Delete the VBoxService service
|
---|
498 | Call ${un}StopVBoxService
|
---|
499 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxService'
|
---|
500 | Pop $0 ; Ret value
|
---|
501 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
|
---|
502 | Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
|
---|
503 |
|
---|
504 | ; GINA
|
---|
505 | Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
|
---|
506 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
|
---|
507 | ${If} $0 == "VBoxGINA.dll"
|
---|
508 | DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
|
---|
509 | ${EndIf}
|
---|
510 |
|
---|
511 | ; Delete VBoxTray
|
---|
512 | Call ${un}StopVBoxTray
|
---|
513 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
|
---|
514 |
|
---|
515 | ; Remove guest driver
|
---|
516 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxGuest'
|
---|
517 | Pop $0 ; Ret value
|
---|
518 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
|
---|
519 | Delete /REBOOTOK "$g_strSystemDir\vbcoinst.dll"
|
---|
520 | Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
|
---|
521 | Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
|
---|
522 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
|
---|
523 | Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
|
---|
524 |
|
---|
525 | ; Remove shared folders driver
|
---|
526 | call ${un}RemoveProvider ; Remove Shared Folders network provider from registry
|
---|
527 | ; @todo Add a /delnetprovider to VBoxDrvInst for doing this job!
|
---|
528 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxSF'
|
---|
529 | Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
|
---|
530 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
|
---|
531 |
|
---|
532 | !if $%VBOX_WITH_CROGL% == "1"
|
---|
533 |
|
---|
534 | DetailPrint "Removing 3D graphics support ..."
|
---|
535 | !if $%BUILD_TARGET_ARCH% == "x86"
|
---|
536 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
|
---|
537 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
|
---|
538 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
|
---|
539 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
|
---|
540 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
|
---|
541 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
|
---|
542 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
|
---|
543 |
|
---|
544 | ; Remove D3D stuff
|
---|
545 | ; @todo add a feature flag to only remove if installed explicitly
|
---|
546 | Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
|
---|
547 | Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
|
---|
548 | Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
|
---|
549 | Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
|
---|
550 | ; Update DLL cache
|
---|
551 | IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
|
---|
552 | Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
|
---|
553 | Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
|
---|
554 | IfFileExists g_strSystemDir\dllcache\msd3d9.dll" 0 +2
|
---|
555 | Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
|
---|
556 | Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
|
---|
557 | ; Restore original DX DLLs
|
---|
558 | IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
|
---|
559 | Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
|
---|
560 | Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
|
---|
561 | IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
|
---|
562 | Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
|
---|
563 | Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
|
---|
564 |
|
---|
565 | !else ; amd64
|
---|
566 |
|
---|
567 | ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
|
---|
568 | ${EnableX64FSRedirection}
|
---|
569 | Delete /REBOOTOK "$SYSDIR\VBoxOGLarrayspu.dll"
|
---|
570 | Delete /REBOOTOK "$SYSDIR\VBoxOGLcrutil.dll"
|
---|
571 | Delete /REBOOTOK "$SYSDIR\VBoxOGLerrorspu.dll"
|
---|
572 | Delete /REBOOTOK "$SYSDIR\VBoxOGLpackspu.dll"
|
---|
573 | Delete /REBOOTOK "$SYSDIR\VBoxOGLpassthroughspu.dll"
|
---|
574 | Delete /REBOOTOK "$SYSDIR\VBoxOGLfeedbackspu.dll"
|
---|
575 | Delete /REBOOTOK "$SYSDIR\VBoxOGL.dll"
|
---|
576 |
|
---|
577 | ; Remove D3D stuff
|
---|
578 | ; @todo add a feature flag to only remove if installed explicitly
|
---|
579 | Delete /REBOOTOK "$SYSDIR\libWine.dll"
|
---|
580 | Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
|
---|
581 | Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
|
---|
582 | Delete /REBOOTOK "$SYSDIR\wined3d.dll"
|
---|
583 | ; Update DLL cache
|
---|
584 | IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
|
---|
585 | Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
|
---|
586 | Rename /REBOOTOK "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll"
|
---|
587 | IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
|
---|
588 | Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
|
---|
589 | Rename /REBOOTOK "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll"
|
---|
590 | ; Restore original DX DLLs
|
---|
591 | IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
|
---|
592 | Delete /REBOOTOK "$SYSDIR\d3d8.dll"
|
---|
593 | Rename /REBOOTOK "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll"
|
---|
594 | IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
|
---|
595 | Delete /REBOOTOK "$SYSDIR\d3d9.dll"
|
---|
596 | Rename /REBOOTOK "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll"
|
---|
597 | DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
|
---|
598 | ${DisableX64FSRedirection}
|
---|
599 | !endif ; amd64
|
---|
600 |
|
---|
601 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
|
---|
602 |
|
---|
603 | !endif ; VBOX_WITH_CROGL
|
---|
604 |
|
---|
605 | Pop $0
|
---|
606 |
|
---|
607 | FunctionEnd
|
---|
608 | !macroend
|
---|
609 | !insertmacro W2K_Uninstall ""
|
---|
610 | !insertmacro W2K_Uninstall "un."
|
---|
611 |
|
---|