VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh@ 35365

最後變更 在這個檔案從35365是 35365,由 vboxsync 提交於 14 年 前

adds installer/win: wine d3d 64bit for xpdm

  • 屬性 svn:eol-style 設為 native
檔案大小: 13.0 KB
 
1
2!ifndef UNINSTALLER_ONLY
3Function ExtractFiles
4
5 ; @todo: Use a define for all the file specs to group the files per module
6 ; and keep the redundancy low
7
8 Push $0
9 StrCpy "$0" "$INSTDIR\$%BUILD_TARGET_ARCH%"
10
11!ifdef VBOX_WITH_LICENSE_INSTALL_RTF
12 FILE "/oname=$0\${LICENSE_FILE_RTF}" "$%VBOX_BRAND_LICENSE_RTF%"
13!endif
14
15 ; Video driver
16 SetOutPath "$0\VBoxVideo"
17 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
18 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
19!ifdef VBOX_SIGN_ADDITIONS
20 FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
21!endif
22 FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
23
24!if $%VBOX_WITH_CROGL% == "1"
25 ; crOpenGL
26 FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
27 FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
28 FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
29 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
30 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
31 FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
32 FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
33
34 SetOutPath "$0\VBoxVideo\OpenGL"
35 FILE "$%PATH_OUT%\bin\additions\d3d8.dll"
36 FILE "$%PATH_OUT%\bin\additions\d3d9.dll"
37 !if $%BUILD_TARGET_ARCH% == "x86"
38 ; libWine is used for 32bit d3d only
39 ; @todo: remove it for 32bit as well
40 FILE "$%PATH_OUT%\bin\additions\libWine.dll"
41 !endif
42 FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
43 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
44 FILE "$%PATH_OUT%\bin\additions\wined3d.dll"
45
46 !if $%BUILD_TARGET_ARCH% == "amd64"
47 ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target
48 SetOutPath "$0\VBoxVideo\OpenGL\SysWow64"
49 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll"
50 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll"
51 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\libWine.dll"
52 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll"
53 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll"
54 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll"
55 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll"
56 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll"
57 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll"
58 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll"
59 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D8.dll"
60 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D9.dll"
61 FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\wined3d.dll"
62 !endif
63!endif
64
65!if $%VBOX_WITH_WDDM% == "1"
66 ; WDDM Video driver
67 SetOutPath "$0\VBoxVideoWddm"
68
69 !ifdef VBOX_SIGN_ADDITIONS
70 FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.cat"
71 !endif
72 FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
73 FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
74 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
75
76 !if $%VBOX_WITH_CROGL% == "1"
77 FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
78 FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
79 FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
80 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
81 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
82 FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
83 FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
84
85 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
86 FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
87 !endif ; $%VBOX_WITH_CROGL% == "1"
88
89 !if $%BUILD_TARGET_ARCH% == "amd64"
90 FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
91
92 !if $%VBOX_WITH_CROGL% == "1"
93 FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu-x86.dll"
94 FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil-x86.dll"
95 FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu-x86.dll"
96 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu-x86.dll"
97 FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu-x86.dll"
98 FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu-x86.dll"
99 FILE "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
100
101 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
102 FILE "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
103 !endif ; $%VBOX_WITH_CROGL% == "1"
104 !endif ; $%BUILD_TARGET_ARCH% == "amd64"
105!endif ; $%VBOX_WITH_WDDM% == "1"
106
107 ; Mouse driver
108 SetOutPath "$0\VBoxMouse"
109 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
110 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
111!ifdef VBOX_SIGN_ADDITIONS
112 FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
113!endif
114
115!if $%BUILD_TARGET_ARCH% == "x86"
116 SetOutPath "$0\VBoxMouse\NT4"
117 FILE "$%PATH_OUT%\bin\additions\VBoxMouseNT.sys"
118!endif
119
120 ; Guest driver
121 SetOutPath "$0\VBoxGuest"
122 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
123 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
124!ifdef VBOX_SIGN_ADDITIONS
125 FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
126!endif
127 FILE "$%PATH_OUT%\bin\additions\VBCoInst.dll"
128 FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
129 FILE "$%PATH_OUT%\bin\additions\VBoxHook.dll"
130 FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe"
131
132!if $%BUILD_TARGET_ARCH% == "x86"
133 SetOutPath "$0\VBoxGuest\NT4"
134 FILE "$%PATH_OUT%\bin\additions\VBoxGuestNT.sys"
135!endif
136
137 ; VBoxService
138 SetOutPath "$0\Bin"
139 FILE "$%PATH_OUT%\bin\additions\VBoxService.exe"
140!if $%BUILD_TARGET_ARCH% == "x86"
141 FILE "$%PATH_OUT%\bin\additions\VBoxServiceNT.exe"
142!endif
143
144 ; Shared Folders
145 SetOutPath "$0\VBoxSF"
146 FILE "$%PATH_OUT%\bin\additions\VBoxSF.sys"
147 FILE "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll"
148
149 ; Auto-Logon
150 SetOutPath "$0\AutoLogon"
151 FILE "$%PATH_OUT%\bin\additions\VBoxGINA.dll"
152 FILE "$%PATH_OUT%\bin\additions\VBoxCredProv.dll"
153
154 ; Misc tools
155 SetOutPath "$0\Tools"
156 FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
157
158!if $%BUILD_TARGET_ARCH% == "x86"
159 SetOutPath "$0\Tools\NT4"
160 FILE "$%PATH_OUT%\bin\additions\VBoxGuestDrvInst.exe"
161 FILE "$%PATH_OUT%\bin\additions\RegCleanup.exe"
162!endif
163
164 Pop $0
165
166FunctionEnd
167!endif ; UNINSTALLER_ONLY
168
169!macro EnableLog un
170Function ${un}EnableLog
171
172!ifdef _DEBUG
173 Goto log
174!endif
175
176 StrCmp $g_bLogEnable "true" log
177 Goto exit
178
179log:
180
181 LogSet on
182 LogText "Start logging."
183
184exit:
185
186FunctionEnd
187!macroend
188!insertmacro EnableLog ""
189!insertmacro EnableLog "un."
190
191!macro WriteLogUI un
192Function ${un}WriteLogUI
193
194 IfSilent exit
195
196!ifdef _DEBUG
197 Goto log
198!endif
199
200 StrCmp $g_bLogEnable "true" log
201 Goto exit
202
203log:
204
205 ; Dump log to see what happened
206 StrCpy $0 "$INSTDIR\${un}install_ui.log"
207 Push $0
208 Call ${un}DumpLog
209
210exit:
211
212FunctionEnd
213!macroend
214!insertmacro WriteLogUI ""
215!insertmacro WriteLogUI "un."
216
217!macro WriteLogVBoxTray un
218Function ${un}WriteLogVBoxTray
219
220 ; Pop function parameters off the stack
221 ; in reverse order
222 Exch $1 ; Message type (0=Info, 1=Warning, 2=Error)
223 Exch
224 Exch $0 ; Body string
225
226 ; @todo Add more paramters here!
227!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
228 ${If} $g_bPostInstallStatus == "true"
229 ; Parameters:
230 ; - String: Description / Body
231 ; - String: Title / Name of application
232 ; - Integer: Type of message: 0 (Info), 1 (Warning), 2 (Error)
233 ; - Integer: Time (in msec) to show the notification
234 VBoxGuestInstallHelper::VBoxTrayShowBallonMsg "$0" "VirtualBox Guest Additions Setup" $1 5000
235 Pop $0 ; Get return value (ignored for now)
236 ${EndIf}
237!endif
238 Pop $0
239 Pop $1
240
241FunctionEnd
242!macroend
243!insertmacro WriteLogVBoxTray ""
244!insertmacro WriteLogVBoxTray "un."
245
246!macro CheckArchitecture un
247Function ${un}CheckArchitecture
248
249 Push $0
250
251 System::Call "kernel32::GetCurrentProcess() i .s"
252 System::Call "kernel32::IsWow64Process(i s, *i .r0)"
253 ; R0 now contains 1 if we're a 64-bit process, or 0 if not
254
255!if $%BUILD_TARGET_ARCH% == "amd64"
256 IntCmp $0 0 wrong_platform
257!else ; 32-bit
258 IntCmp $0 1 wrong_platform
259!endif
260
261 Push 0
262 Goto exit
263
264wrong_platform:
265
266 Push 1
267 Goto exit
268
269exit:
270
271FunctionEnd
272!macroend
273!insertmacro CheckArchitecture ""
274!insertmacro CheckArchitecture "un."
275
276!macro GetWindowsVer un
277Function ${un}GetWindowsVer
278
279 ; Check if we are running on w2k or above
280 ; For other windows versions (>XP) it may be necessary to change winver.nsh
281 Call ${un}GetWindowsVersion
282 Pop $R3 ; Windows Version
283
284 Push $R3 ; The windows version string
285 Push "NT" ; String to search for. Win 2k family returns no string containing 'NT'
286 Call ${un}StrStr
287 Pop $R0
288 StrCmp $R0 '' nt5plus ; Not NT 3.XX or 4.XX
289
290 ; Ok we know it is NT. Must be a string like NT X.XX
291 Push $R3 ; The windows version string
292 Push "4." ; String to search for
293 Call ${un}StrStr
294 Pop $R0
295 StrCmp $R0 "" nt5plus nt4 ; If empty -> not NT 4
296
297nt5plus: ; Windows 2000+ (XP, Vista, ...)
298
299 StrCpy $g_strWinVersion $R3
300 goto exit
301
302nt4: ; NT 4.0
303
304 StrCpy $g_strWinVersion "NT4"
305 goto exit
306
307exit:
308
309FunctionEnd
310!macroend
311!insertmacro GetWindowsVer ""
312!insertmacro GetWindowsVer "un."
313
314!macro GetAdditionsVersion un
315Function ${un}GetAdditionsVersion
316
317 Push $0
318 Push $1
319
320 ; Get additions version
321 ReadRegStr $0 HKLM "SOFTWARE\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions" "Version"
322
323 ; Get revision
324 ReadRegStr $g_strAddVerRev HKLM "SOFTWARE\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions" "Revision"
325
326 ; Extract major version
327 Push "$0" ; String
328 Push "." ; SubString
329 Push ">" ; SearchDirection
330 Push "<" ; StrInclusionDirection
331 Push "0" ; IncludeSubString
332 Push "0" ; Loops
333 Push "0" ; CaseSensitive
334 Call ${un}StrStrAdv
335 Pop $g_strAddVerMaj
336
337 ; Extract minor version
338 Push "$0" ; String
339 Push "." ; SubString
340 Push ">" ; SearchDirection
341 Push ">" ; StrInclusionDirection
342 Push "0" ; IncludeSubString
343 Push "0" ; Loops
344 Push "0" ; CaseSensitive
345 Call ${un}StrStrAdv
346 Pop $1 ; Got first part (e.g. "1.5")
347
348 Push "$1" ; String
349 Push "." ; SubString
350 Push ">" ; SearchDirection
351 Push "<" ; StrInclusionDirection
352 Push "0" ; IncludeSubString
353 Push "0" ; Loops
354 Push "0" ; CaseSensitive
355 Call ${un}StrStrAdv
356 Pop $g_strAddVerMin ; Extracted second part (e.g. "5" from "1.5")
357
358 ; Extract build number
359 Push "$0" ; String
360 Push "." ; SubString
361 Push "<" ; SearchDirection
362 Push ">" ; StrInclusionDirection
363 Push "0" ; IncludeSubString
364 Push "0" ; Loops
365 Push "0" ; CaseSensitive
366 Call ${un}StrStrAdv
367 Pop $g_strAddVerBuild
368
369exit:
370
371 Pop $1
372 Pop $0
373
374FunctionEnd
375!macroend
376!insertmacro GetAdditionsVersion ""
377!insertmacro GetAdditionsVersion "un."
378
379!macro StopVBoxService un
380Function ${un}StopVBoxService
381
382 Push $0 ; Temp results
383 Push $1
384 Push $2 ; Image name of VBoxService
385 Push $3 ; Safety counter
386
387 StrCpy $3 "0" ; Init counter
388 DetailPrint "Stopping VBoxService ..."
389
390svc_stop:
391
392 LogText "Stopping VBoxService (as service) ..."
393 ${If} $g_strWinVersion == "NT4"
394 nsExec::Exec '"$SYSDIR\net.exe" stop VBoxService'
395 ${Else}
396 nsExec::Exec '"$SYSDIR\SC.exe" stop VBoxService'
397 ${EndIf}
398 Sleep "1000" ; Wait a bit
399
400exe_stop:
401
402!ifdef _DEBUG
403 DetailPrint "Stopping VBoxService (as exe) ..."
404!endif
405
406exe_stop_loop:
407
408 IntCmp $3 10 exit ; Only try this loop 10 times max
409 IntOp $3 $3 + 1 ; Increment
410
411 LogText "Try: $3"
412
413 ${If} $g_strWinVersion == "NT4"
414 StrCpy $2 "VBoxServiceNT.exe"
415 ${Else}
416 StrCpy $2 "VBoxService.exe"
417 ${EndIf}
418
419 ${nsProcess::FindProcess} $2 $0
420 StrCmp $0 0 0 exit
421
422 ${nsProcess::KillProcess} $2 $0
423 Sleep "1000" ; Wait a bit
424 Goto exe_stop_loop
425
426exit:
427
428 DetailPrint "Stopping VBoxService done."
429
430 Pop $3
431 Pop $2
432 Pop $1
433 Pop $0
434
435FunctionEnd
436!macroend
437!insertmacro StopVBoxService ""
438!insertmacro StopVBoxService "un."
439
440!macro StopVBoxTray un
441Function ${un}StopVBoxTray
442
443 Push $0 ; Temp results
444 Push $1 ; Safety counter
445
446 StrCpy $1 "0" ; Init counter
447 DetailPrint "Stopping VBoxTray ..."
448
449exe_stop:
450
451 IntCmp $1 10 exit ; Only try this loop 10 times max
452 IntOp $1 $1 + 1 ; Increment
453
454 ${nsProcess::FindProcess} "VBoxTray.exe" $0
455 StrCmp $0 0 0 exit
456
457 ${nsProcess::KillProcess} "VBoxTray.exe" $0
458 Sleep "1000" ; Wait a bit
459 Goto exe_stop
460
461exit:
462
463 DetailPrint "Stopping VBoxTray done."
464
465 Pop $1
466 Pop $0
467
468FunctionEnd
469!macroend
470!insertmacro StopVBoxTray ""
471!insertmacro StopVBoxTray "un."
472
473!macro WriteRegBinR ROOT KEY NAME VALUE
474 WriteRegBin "${ROOT}" "${KEY}" "${NAME}" "${VALUE}"
475!macroend
476
477!macro AbortShutdown un
478Function ${un}AbortShutdown
479
480 Push $0
481
482 ; Try to abort the shutdown
483 nsExec::ExecToLog '"$g_strSystemDir\shutdown.exe" -a' $0
484
485 Pop $0
486
487FunctionEnd
488!macroend
489!insertmacro AbortShutdown ""
490!insertmacro AbortShutdown "un."
491
492!macro CheckForWDDMCapability un
493Function ${un}CheckForWDDMCapability
494
495!if $%VBOX_WITH_WDDM% == "1"
496 ; If we're on a 32-bit Windows Vista / 7 we can use the WDDM driver
497 ${If} $g_strWinVersion == "Vista"
498 ${OrIf} $g_strWinVersion == "7"
499 StrCpy $g_bCapWDDM "true"
500 ${EndIf}
501!endif
502
503FunctionEnd
504!macroend
505!insertmacro CheckForWDDMCapability ""
506!insertmacro CheckForWDDMCapability "un."
507
508!macro CheckForCapabilities un
509Function ${un}CheckForCapabilities
510
511 Push $0
512
513 ; Retrieve system mode and store result in
514 System::Call 'user32::GetSystemMetrics(i ${SM_CLEANBOOT}) i .r0'
515 StrCpy $g_iSystemMode $0
516
517 ; Check whether this OS is capable of handling WDDM drivers
518 Call ${un}CheckForWDDMCapability
519
520 Pop $0
521
522FunctionEnd
523!macroend
524!insertmacro CheckForCapabilities ""
525!insertmacro CheckForCapabilities "un."
526
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette