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