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 win_ver
|
---|
9 | Var /GLOBAL dev_id
|
---|
10 | Var /GLOBAL dev_desc
|
---|
11 |
|
---|
12 | ; Check for all required parameters
|
---|
13 | StrCmp $g_iScreenX "0" exit
|
---|
14 | StrCmp $g_iScreenY "0" exit
|
---|
15 | StrCmp $g_iScreenBpp "0" exit
|
---|
16 |
|
---|
17 | Call GetWindowsVersion
|
---|
18 | Pop $win_ver ; Now contains Windows version
|
---|
19 |
|
---|
20 | DetailPrint "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..."
|
---|
21 |
|
---|
22 | ; Enumerate all video devices (up to 32 at the moment, use key "MaxObjectNumber" key later)
|
---|
23 | ${For} $i 0 32
|
---|
24 |
|
---|
25 | ReadRegStr $tmp HKLM "HARDWARE\DEVICEMAP\VIDEO" "\Device\Video$i"
|
---|
26 | StrCmp $tmp "" dev_not_found
|
---|
27 |
|
---|
28 | ; Extract path to video settings
|
---|
29 | ; Ex: \Registry\Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
|
---|
30 | ; Or: \Registry\Machine\System\CurrentControlSet\Control\Video\vboxvideo\Device0
|
---|
31 | ; Result: Machine\System\CurrentControlSet\Control\Video\{28B74D2B-F0A9-48E0-8028-D76F6BB1AE65}\0000
|
---|
32 | Push "$tmp" ; String
|
---|
33 | Push "\" ; SubString
|
---|
34 | Push ">" ; SearchDirection
|
---|
35 | Push ">" ; StrInclusionDirection
|
---|
36 | Push "0" ; IncludeSubString
|
---|
37 | Push "2" ; Loops
|
---|
38 | Push "0" ; CaseSensitive
|
---|
39 | Call StrStrAdv
|
---|
40 | Pop $tmppath ; $1 only contains the full path
|
---|
41 | StrCmp $tmppath "" dev_not_found
|
---|
42 |
|
---|
43 | ; Get device description
|
---|
44 | ReadRegStr $dev_desc HKLM "$tmppath" "Device Description"
|
---|
45 | !ifdef _DEBUG
|
---|
46 | DetailPrint "Registry path: $tmppath"
|
---|
47 | DetailPrint "Registry path to device name: $temp"
|
---|
48 | !endif
|
---|
49 | DetailPrint "Detected video device: $dev_desc"
|
---|
50 |
|
---|
51 | ${If} $dev_desc == "VirtualBox Graphics Adapter"
|
---|
52 | DetailPrint "VirtualBox video device found!"
|
---|
53 | Goto dev_found
|
---|
54 | ${EndIf}
|
---|
55 | ${Next}
|
---|
56 | Goto dev_not_found
|
---|
57 |
|
---|
58 | dev_found:
|
---|
59 |
|
---|
60 | ; If we're on Windows 2000, skip the ID detection ...
|
---|
61 | StrCmp $win_ver "2000" change_res
|
---|
62 | Goto dev_found_detect_id
|
---|
63 |
|
---|
64 | dev_found_detect_id:
|
---|
65 |
|
---|
66 | StrCpy $i 0 ; Start at index 0
|
---|
67 | DetailPrint "Detecting device ID ..."
|
---|
68 |
|
---|
69 | dev_found_detect_id_loop:
|
---|
70 |
|
---|
71 | ; Resolve real path to hardware instance "{GUID}"
|
---|
72 | EnumRegKey $dev_id HKLM "SYSTEM\CurrentControlSet\Control\Video" $i
|
---|
73 | StrCmp $dev_id "" dev_not_found ; No more entries? Jump out
|
---|
74 | !ifdef _DEBUG
|
---|
75 | DetailPrint "Got device ID: $dev_id"
|
---|
76 | !endif
|
---|
77 | ReadRegStr $dev_desc HKLM "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" "Device Description" ; Try to read device name
|
---|
78 | ${If} $dev_desc == "VirtualBox Graphics Adapter"
|
---|
79 | DetailPrint "Device ID of $dev_desc: $dev_id"
|
---|
80 | Goto change_res
|
---|
81 | ${EndIf}
|
---|
82 |
|
---|
83 | IntOp $i $i + 1 ; Increment index
|
---|
84 | goto dev_found_detect_id_loop
|
---|
85 |
|
---|
86 | dev_not_found:
|
---|
87 |
|
---|
88 | DetailPrint "No VirtualBox video device (yet) detected! No custom mode set."
|
---|
89 | Goto exit
|
---|
90 |
|
---|
91 | change_res:
|
---|
92 |
|
---|
93 | !ifdef _DEBUG
|
---|
94 | DetailPrint "Device description: $dev_desc"
|
---|
95 | DetailPrint "Device ID: $dev_id"
|
---|
96 | !endif
|
---|
97 |
|
---|
98 | Var /GLOBAL reg_path_device
|
---|
99 | Var /GLOBAL reg_path_monitor
|
---|
100 |
|
---|
101 | DetailPrint "Custom mode set: Platform is '$win_ver'."
|
---|
102 | ${If} $win_ver == "2000"
|
---|
103 | ${OrIf} $win_ver == "Vista"
|
---|
104 | StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0"
|
---|
105 | StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0\Mon00000001"
|
---|
106 | ${ElseIf} $win_ver == "XP"
|
---|
107 | ${OrIf} $win_ver == "7"
|
---|
108 | StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
|
---|
109 | StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
|
---|
110 | ${Else}
|
---|
111 | DetailPrint "Custom mode set: Platform '$win_ver' not supported yet."
|
---|
112 | Goto exit
|
---|
113 | ${EndIf}
|
---|
114 |
|
---|
115 | ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
|
---|
116 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
|
---|
117 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
|
---|
118 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
|
---|
119 |
|
---|
120 | ; ... and tell Windows to use that mode on next start!
|
---|
121 | WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX"
|
---|
122 | WriteRegDWORD HKCC $reg_path_device "DefaultSettings.YResolution" "$g_iScreenY"
|
---|
123 | WriteRegDWORD HKCC $reg_path_device "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
|
---|
124 |
|
---|
125 | WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.XResolution" "$g_iScreenX"
|
---|
126 | WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY"
|
---|
127 | WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp"
|
---|
128 |
|
---|
129 | DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart."
|
---|
130 |
|
---|
131 | exit:
|
---|
132 |
|
---|
133 | FunctionEnd
|
---|
134 |
|
---|
135 | Function W2K_Prepare
|
---|
136 |
|
---|
137 | ; Stop / kill VBoxService
|
---|
138 | Call StopVBoxService
|
---|
139 |
|
---|
140 | ; Stop / kill VBoxTray
|
---|
141 | Call StopVBoxTray
|
---|
142 |
|
---|
143 | ; Delete VBoxService from registry
|
---|
144 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
|
---|
145 |
|
---|
146 | ; Delete old VBoxService.exe from install directory (replaced by VBoxTray.exe)
|
---|
147 | Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
|
---|
148 |
|
---|
149 | FunctionEnd
|
---|
150 |
|
---|
151 | Function W2K_CopyFiles
|
---|
152 |
|
---|
153 | SetOutPath "$INSTDIR"
|
---|
154 |
|
---|
155 | ; Video driver
|
---|
156 | FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
|
---|
157 | FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
|
---|
158 |
|
---|
159 | ; Mouse driver
|
---|
160 | FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
|
---|
161 | FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
|
---|
162 | !ifdef VBOX_SIGN_ADDITIONS
|
---|
163 | FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
|
---|
164 | !endif
|
---|
165 |
|
---|
166 | ; Guest driver
|
---|
167 | FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
|
---|
168 | FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
|
---|
169 | !ifdef VBOX_SIGN_ADDITIONS
|
---|
170 | FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
|
---|
171 | !endif
|
---|
172 |
|
---|
173 | ; Guest driver files
|
---|
174 | FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
|
---|
175 | FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
|
---|
176 | FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
|
---|
177 |
|
---|
178 | ; WHQL fake
|
---|
179 | !ifdef WHQL_FAKE
|
---|
180 | FILE "$%PATH_OUT%\bin\additions\VBoxWHQLFake.exe"
|
---|
181 | !endif
|
---|
182 |
|
---|
183 | SetOutPath $g_strSystemDir
|
---|
184 |
|
---|
185 | ; VBoxService
|
---|
186 | FILE "$%PATH_OUT%\bin\additions\VBoxService.exe" ; Only used by W2K and up (for Shared Folders at the moment)
|
---|
187 |
|
---|
188 | !if $%VBOX_WITH_CROGL% == "1"
|
---|
189 | !if $%VBOXWDDM% == "1"
|
---|
190 | ${If} $g_bInstallWDDM == "true"
|
---|
191 | SetOutPath "$INSTDIR"
|
---|
192 | ; WDDM Video driver
|
---|
193 | FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
|
---|
194 | FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
|
---|
195 | FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
|
---|
196 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
|
---|
197 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
|
---|
198 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
|
---|
199 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
|
---|
200 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
|
---|
201 | FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
|
---|
202 | FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
|
---|
203 | FILE "$%PATH_OUT%\bin\additions\libWine.dll"
|
---|
204 | FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
|
---|
205 | FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
|
---|
206 | SetOutPath $g_strSystemDir
|
---|
207 | Goto doneCr
|
---|
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 | ; Write additional keys required for Windows 7 & XP 64-bit (but for 32-bit stuff)
|
---|
367 | Push $R0
|
---|
368 | Call GetWindowsVersion
|
---|
369 | Pop $R0 ; Windows Version
|
---|
370 | ${If} $R0 == '7'
|
---|
371 | ${OrIf} $R0 == 'XP'
|
---|
372 | WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2
|
---|
373 | WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1
|
---|
374 | WriteRegDWORD HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1
|
---|
375 | WriteRegStr HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Dll" "VBoxOGL.dll"
|
---|
376 | ${EndIf}
|
---|
377 | Pop $R0
|
---|
378 | ${Endif}
|
---|
379 | !endif
|
---|
380 |
|
---|
381 | Goto done
|
---|
382 |
|
---|
383 | error:
|
---|
384 |
|
---|
385 | Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
|
---|
386 |
|
---|
387 | done:
|
---|
388 |
|
---|
389 | FunctionEnd
|
---|
390 |
|
---|
391 | Function W2K_Main
|
---|
392 |
|
---|
393 | SetOutPath "$INSTDIR"
|
---|
394 | SetOverwrite on
|
---|
395 |
|
---|
396 | Call W2K_Prepare
|
---|
397 | Call W2K_CopyFiles
|
---|
398 |
|
---|
399 | !ifdef WHQL_FAKE
|
---|
400 | Call W2K_WHQLFakeOn
|
---|
401 | !endif
|
---|
402 |
|
---|
403 | Call W2K_InstallFiles
|
---|
404 |
|
---|
405 | !ifdef WHQL_FAKE
|
---|
406 | Call W2K_WHQLFakeOff
|
---|
407 | !endif
|
---|
408 |
|
---|
409 | Call W2K_SetVideoResolution
|
---|
410 |
|
---|
411 | FunctionEnd
|
---|
412 |
|
---|
413 | !macro W2K_UninstallInstDir un
|
---|
414 | Function ${un}W2K_UninstallInstDir
|
---|
415 |
|
---|
416 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
|
---|
417 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
|
---|
418 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
|
---|
419 | Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
|
---|
420 |
|
---|
421 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
|
---|
422 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
|
---|
423 | Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
|
---|
424 |
|
---|
425 | Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
|
---|
426 |
|
---|
427 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
|
---|
428 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
|
---|
429 | Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
|
---|
430 |
|
---|
431 | Delete /REBOOTOK "$INSTDIR\VBCoInst.dll"
|
---|
432 | Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
|
---|
433 | Delete /REBOOTOK "$INSTDIR\VBoxService.exe" ; File from an older installation maybe, not present here anymore
|
---|
434 |
|
---|
435 | ; WHQL fake
|
---|
436 | !ifdef WHQL_FAKE
|
---|
437 | Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"
|
---|
438 | !endif
|
---|
439 |
|
---|
440 | ; Log file
|
---|
441 | Delete /REBOOTOK "$INSTDIR\install.log"
|
---|
442 | Delete /REBOOTOK "$INSTDIR\install_ui.log"
|
---|
443 |
|
---|
444 | FunctionEnd
|
---|
445 | !macroend
|
---|
446 | !insertmacro W2K_UninstallInstDir ""
|
---|
447 | !insertmacro W2K_UninstallInstDir "un."
|
---|
448 |
|
---|
449 | !macro W2K_Uninstall un
|
---|
450 | Function ${un}W2K_Uninstall
|
---|
451 |
|
---|
452 | Push $0
|
---|
453 | !if $%VBOXWDDM% == "1"
|
---|
454 | ; First check whether wddm driver is installed
|
---|
455 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /matchdrv "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00" "WDDM"'
|
---|
456 | Pop $0 ; Ret value
|
---|
457 | ${If} $0 == "0"
|
---|
458 | DetailPrint "WDDM Driver is installed"
|
---|
459 | StrCpy $g_bInstallWDDM "true"
|
---|
460 | ${ElseIf} $0 == "4"
|
---|
461 | DetailPrint "Non-WDDM Driver is installed"
|
---|
462 | ${Else}
|
---|
463 | DetailPrint "Error occured"
|
---|
464 | ; @todo Add error handling here!
|
---|
465 | ${Endif}
|
---|
466 | !endif
|
---|
467 |
|
---|
468 | ; Remove VirtualBox graphics adapter & PCI base drivers
|
---|
469 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00"'
|
---|
470 | Pop $0 ; Ret value
|
---|
471 | ; @todo Add error handling here!
|
---|
472 |
|
---|
473 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /u "PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00"'
|
---|
474 | Pop $0 ; Ret value
|
---|
475 | ; @todo Add error handling here!
|
---|
476 |
|
---|
477 | ; @todo restore old drivers
|
---|
478 |
|
---|
479 | ; Remove video driver
|
---|
480 | ${If} $g_bInstallWDDM == "true"
|
---|
481 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideoWddm'
|
---|
482 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys"
|
---|
483 | Delete /REBOOTOK "$g_strSystemDir\VBoxDispD3D.dll"
|
---|
484 | ${Else}
|
---|
485 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxVideo'
|
---|
486 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
|
---|
487 | Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
|
---|
488 | ${Endif}
|
---|
489 |
|
---|
490 | ; Remove mouse driver
|
---|
491 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxMouse'
|
---|
492 | Pop $0 ; Ret value
|
---|
493 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
|
---|
494 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /reg_delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
|
---|
495 | Pop $0 ; Ret value
|
---|
496 | ; @todo Add error handling here!
|
---|
497 |
|
---|
498 | ; Delete the VBoxService service
|
---|
499 | Call ${un}StopVBoxService
|
---|
500 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxService'
|
---|
501 | Pop $0 ; Ret value
|
---|
502 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
|
---|
503 | Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
|
---|
504 |
|
---|
505 | ; GINA
|
---|
506 | Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll"
|
---|
507 | ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
|
---|
508 | ${If} $0 == "VBoxGINA.dll"
|
---|
509 | DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
|
---|
510 | ${EndIf}
|
---|
511 |
|
---|
512 | ; Delete VBoxTray
|
---|
513 | Call ${un}StopVBoxTray
|
---|
514 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray"
|
---|
515 |
|
---|
516 | ; Remove guest driver
|
---|
517 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxGuest'
|
---|
518 | Pop $0 ; Ret value
|
---|
519 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
|
---|
520 | Delete /REBOOTOK "$g_strSystemDir\vbcoinst.dll"
|
---|
521 | Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe"
|
---|
522 | Delete /REBOOTOK "$g_strSystemDir\VBoxHook.dll"
|
---|
523 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove VBoxTray autorun
|
---|
524 | Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe"
|
---|
525 |
|
---|
526 | ; Remove shared folders driver
|
---|
527 | call ${un}RemoveProvider ; Remove Shared Folders network provider from registry
|
---|
528 | ; @todo Add a /delnetprovider to VBoxDrvInst for doing this job!
|
---|
529 | nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" /delsvc VBoxSF'
|
---|
530 | Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
|
---|
531 | Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxSF.sys"
|
---|
532 |
|
---|
533 | !if $%VBOX_WITH_CROGL% == "1"
|
---|
534 |
|
---|
535 | DetailPrint "Removing 3D graphics support ..."
|
---|
536 | !if $%BUILD_TARGET_ARCH% == "x86"
|
---|
537 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLarrayspu.dll"
|
---|
538 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLcrutil.dll"
|
---|
539 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLerrorspu.dll"
|
---|
540 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpackspu.dll"
|
---|
541 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLpassthroughspu.dll"
|
---|
542 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGLfeedbackspu.dll"
|
---|
543 | Delete /REBOOTOK "$g_strSystemDir\VBoxOGL.dll"
|
---|
544 |
|
---|
545 | ; Remove D3D stuff
|
---|
546 | ; @todo add a feature flag to only remove if installed explicitly
|
---|
547 | Delete /REBOOTOK "$g_strSystemDir\libWine.dll"
|
---|
548 | Delete /REBOOTOK "$g_strSystemDir\VBoxD3D8.dll"
|
---|
549 | Delete /REBOOTOK "$g_strSystemDir\VBoxD3D9.dll"
|
---|
550 | Delete /REBOOTOK "$g_strSystemDir\wined3d.dll"
|
---|
551 | ; Update DLL cache
|
---|
552 | IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" 0 +2
|
---|
553 | Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d8.dll"
|
---|
554 | Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll"
|
---|
555 | IfFileExists g_strSystemDir\dllcache\msd3d9.dll" 0 +2
|
---|
556 | Delete /REBOOTOK "$g_strSystemDir\dllcache\d3d9.dll"
|
---|
557 | Rename /REBOOTOK "$g_strSystemDir\dllcache\msd3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll"
|
---|
558 | ; Restore original DX DLLs
|
---|
559 | IfFileExists "$g_strSystemDir\msd3d8.dll" 0 +2
|
---|
560 | Delete /REBOOTOK "$g_strSystemDir\d3d8.dll"
|
---|
561 | Rename /REBOOTOK "$g_strSystemDir\msd3d8.dll" "$g_strSystemDir\d3d8.dll"
|
---|
562 | IfFileExists "$g_strSystemDir\msd3d9.dll" 0 +2
|
---|
563 | Delete /REBOOTOK "$g_strSystemDir\d3d9.dll"
|
---|
564 | Rename /REBOOTOK "$g_strSystemDir\msd3d9.dll" "$g_strSystemDir\d3d9.dll"
|
---|
565 |
|
---|
566 | !else ; amd64
|
---|
567 |
|
---|
568 | ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node
|
---|
569 | ${EnableX64FSRedirection}
|
---|
570 | Delete /REBOOTOK "$SYSDIR\VBoxOGLarrayspu.dll"
|
---|
571 | Delete /REBOOTOK "$SYSDIR\VBoxOGLcrutil.dll"
|
---|
572 | Delete /REBOOTOK "$SYSDIR\VBoxOGLerrorspu.dll"
|
---|
573 | Delete /REBOOTOK "$SYSDIR\VBoxOGLpackspu.dll"
|
---|
574 | Delete /REBOOTOK "$SYSDIR\VBoxOGLpassthroughspu.dll"
|
---|
575 | Delete /REBOOTOK "$SYSDIR\VBoxOGLfeedbackspu.dll"
|
---|
576 | Delete /REBOOTOK "$SYSDIR\VBoxOGL.dll"
|
---|
577 |
|
---|
578 | ; Remove D3D stuff
|
---|
579 | ; @todo add a feature flag to only remove if installed explicitly
|
---|
580 | Delete /REBOOTOK "$SYSDIR\libWine.dll"
|
---|
581 | Delete /REBOOTOK "$SYSDIR\VBoxD3D8.dll"
|
---|
582 | Delete /REBOOTOK "$SYSDIR\VBoxD3D9.dll"
|
---|
583 | Delete /REBOOTOK "$SYSDIR\wined3d.dll"
|
---|
584 | ; Update DLL cache
|
---|
585 | IfFileExists "$SYSDIR\dllcache\msd3d8.dll" 0 +2
|
---|
586 | Delete /REBOOTOK "$SYSDIR\dllcache\d3d8.dll"
|
---|
587 | Rename /REBOOTOK "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll"
|
---|
588 | IfFileExists "$SYSDIR\dllcache\msd3d9.dll" 0 +2
|
---|
589 | Delete /REBOOTOK "$SYSDIR\dllcache\d3d9.dll"
|
---|
590 | Rename /REBOOTOK "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll"
|
---|
591 | ; Restore original DX DLLs
|
---|
592 | IfFileExists "$SYSDIR\msd3d8.dll" 0 +2
|
---|
593 | Delete /REBOOTOK "$SYSDIR\d3d8.dll"
|
---|
594 | Rename /REBOOTOK "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll"
|
---|
595 | IfFileExists "$SYSDIR\msd3d9.dll" 0 +2
|
---|
596 | Delete /REBOOTOK "$SYSDIR\d3d9.dll"
|
---|
597 | Rename /REBOOTOK "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll"
|
---|
598 | DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
|
---|
599 | ${DisableX64FSRedirection}
|
---|
600 | !endif ; amd64
|
---|
601 |
|
---|
602 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL"
|
---|
603 |
|
---|
604 | !endif ; VBOX_WITH_CROGL
|
---|
605 |
|
---|
606 | Pop $0
|
---|
607 |
|
---|
608 | FunctionEnd
|
---|
609 | !macroend
|
---|
610 | !insertmacro W2K_Uninstall ""
|
---|
611 | !insertmacro W2K_Uninstall "un."
|
---|
612 |
|
---|