1 | ; $Id: $
|
---|
2 | ;; @file
|
---|
3 | ; VBoxGuestAdditionsVista.nsh - Guest Additions installation for Windows Vista/7.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2011 Oracle Corporation
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
11 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | ; General Public License (GPL) as published by the Free Software
|
---|
13 | ; Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | ;
|
---|
17 |
|
---|
18 | Function Vista_CheckForRequirements
|
---|
19 |
|
---|
20 | Push $0
|
---|
21 |
|
---|
22 | DetailPrint "Checking for installation requirements for Vista / Windows 7 / Windows 8 ..."
|
---|
23 |
|
---|
24 | ${If} $g_bForceInstall == "true"
|
---|
25 | DetailPrint "Forcing installatoin, checking requirements skipped"
|
---|
26 | goto success
|
---|
27 | ${EndIf}
|
---|
28 |
|
---|
29 | ; Validate D3D files, regardless whether D3D support is selected or not
|
---|
30 | Call ValidateD3DFiles
|
---|
31 | Pop $0
|
---|
32 | ${If} $0 == "1" ; D3D files are invalid
|
---|
33 | ${If} $g_bWithWDDM == "true"
|
---|
34 | MessageBox MB_ICONSTOP|MB_OK $(VBOX_COMPONENT_D3D_INVALID_WDDM) /SD IDOK
|
---|
35 | goto failure
|
---|
36 | ${Else}
|
---|
37 | MessageBox MB_ICONSTOP|MB_OKCANCEL $(VBOX_COMPONENT_D3D_INVALID_XPDM) /SD IDCANCEL IDCANCEL failure
|
---|
38 | ${EndIf}
|
---|
39 | ${EndIf}
|
---|
40 |
|
---|
41 | Goto success
|
---|
42 |
|
---|
43 | failure:
|
---|
44 |
|
---|
45 | Abort "ERROR: Requirements not met! Installation aborted."
|
---|
46 | goto exit
|
---|
47 |
|
---|
48 | success:
|
---|
49 |
|
---|
50 | ; Nothing to do here right now
|
---|
51 | Goto exit
|
---|
52 |
|
---|
53 | exit:
|
---|
54 |
|
---|
55 | Pop $0
|
---|
56 |
|
---|
57 | FunctionEnd
|
---|
58 |
|
---|
59 | Function Vista_CopyFiles
|
---|
60 |
|
---|
61 | SetOutPath "$INSTDIR"
|
---|
62 | SetOverwrite on
|
---|
63 |
|
---|
64 | ; The files are for Vista only, they go into the application directory
|
---|
65 |
|
---|
66 | ; VBoxNET drivers are not tested yet - commented out until officially supported and released
|
---|
67 | ;FILE "$%PATH_OUT%\bin\additions\VBoxNET.inf"
|
---|
68 | ;FILE "$%PATH_OUT%\bin\additions\VBoxNET.sys"
|
---|
69 |
|
---|
70 |
|
---|
71 | FunctionEnd
|
---|
72 |
|
---|
73 | Function Vista_InstallFiles
|
---|
74 |
|
---|
75 | DetailPrint "Installing drivers for Vista / Windows 7 / Windows 8 ..."
|
---|
76 |
|
---|
77 | SetOutPath "$INSTDIR"
|
---|
78 | ; Nothing here yet
|
---|
79 | Goto done
|
---|
80 |
|
---|
81 | error:
|
---|
82 |
|
---|
83 | Abort "ERROR: Could not install files! Installation aborted."
|
---|
84 |
|
---|
85 | done:
|
---|
86 |
|
---|
87 | FunctionEnd
|
---|
88 |
|
---|
89 | Function Vista_Main
|
---|
90 |
|
---|
91 | Call Vista_CopyFiles
|
---|
92 | Call Vista_InstallFiles
|
---|
93 |
|
---|
94 | FunctionEnd
|
---|
95 |
|
---|
96 | !macro Vista_UninstallInstDir un
|
---|
97 | Function ${un}Vista_UninstallInstDir
|
---|
98 |
|
---|
99 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
100 | Delete /REBOOTOK "$INSTDIR\netamd.inf"
|
---|
101 | Delete /REBOOTOK "$INSTDIR\pcntpci5.cat"
|
---|
102 | Delete /REBOOTOK "$INSTDIR\PCNTPCI5.sys"
|
---|
103 | !endif
|
---|
104 |
|
---|
105 | FunctionEnd
|
---|
106 | !macroend
|
---|
107 | !insertmacro Vista_UninstallInstDir ""
|
---|
108 | !insertmacro Vista_UninstallInstDir "un."
|
---|
109 |
|
---|
110 | !macro Vista_Uninstall un
|
---|
111 | Function ${un}Vista_Uninstall
|
---|
112 |
|
---|
113 | ; Remove credential provider
|
---|
114 | DetailPrint "Removing auto-logon support ..."
|
---|
115 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
116 | DeleteRegKey HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
117 | Delete /REBOOTOK "$g_strSystemDir\VBoxCredProv.dll"
|
---|
118 |
|
---|
119 | FunctionEnd
|
---|
120 | !macroend
|
---|
121 | !insertmacro Vista_Uninstall ""
|
---|
122 | !insertmacro Vista_Uninstall "un."
|
---|