1 | ; $Id$
|
---|
2 | ; @file
|
---|
3 | ; VBoxGuestAdditionsVista.nsh - Guest Additions installation for Windows Vista/7.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2012 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 | ${LogVerbose} "Checking for installation requirements for Vista / Windows 7 / Windows 8 ..."
|
---|
23 |
|
---|
24 | ${If} $g_bForceInstall == "true"
|
---|
25 | ${LogVerbose} "Forcing installation, 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, notify user
|
---|
33 | MessageBox MB_ICONSTOP|MB_OKCANCEL $(VBOX_COMPONENT_D3D_INVALID) /SD IDOK IDCANCEL failure
|
---|
34 | ; Offer to open up the VBox online manual on how to fix missing/corrupted D3D files
|
---|
35 | MessageBox MB_ICONQUESTION|MB_YESNO $(VBOX_COMPONENT_D3D_INVALID_MANUAL) /SD IDNO IDYES open_handbook_d3d_invalid
|
---|
36 | ${EndIf}
|
---|
37 | Goto success
|
---|
38 |
|
---|
39 | open_handbook_d3d_invalid:
|
---|
40 |
|
---|
41 | ; @todo Add a language GET parameter (e.g. ?lang=enUS) here as soon as we got the
|
---|
42 | ; handbook online in different languages
|
---|
43 | ; Don't use https here (even if we offer it) -- we only want to display the handbook
|
---|
44 | Call SetAppMode64 ; For shell execution we need to switch to 64-bit mode first
|
---|
45 | ExecShell open "http://www.virtualbox.org/manual/ch12.html#ts_d3d8-d3d9-restore"
|
---|
46 | IfErrors 0 +2
|
---|
47 | MessageBox MB_ICONSTOP|MB_OK $(VBOX_ERROR_OPEN_LINK) /SD IDOK
|
---|
48 | Call SetAppMode32
|
---|
49 | Goto failure
|
---|
50 |
|
---|
51 | failure:
|
---|
52 |
|
---|
53 | Abort "ERROR: Requirements not met! Installation aborted."
|
---|
54 | goto exit
|
---|
55 |
|
---|
56 | success:
|
---|
57 |
|
---|
58 | ; Nothing to do here right now
|
---|
59 | Goto exit
|
---|
60 |
|
---|
61 | exit:
|
---|
62 |
|
---|
63 | Pop $0
|
---|
64 |
|
---|
65 | FunctionEnd
|
---|
66 |
|
---|
67 | Function Vista_Prepare
|
---|
68 |
|
---|
69 | Call VBoxMMR_Uninstall
|
---|
70 |
|
---|
71 | FunctionEnd
|
---|
72 |
|
---|
73 | Function Vista_CopyFiles
|
---|
74 |
|
---|
75 | SetOutPath "$INSTDIR"
|
---|
76 | SetOverwrite on
|
---|
77 |
|
---|
78 | ; The files are for Vista only, they go into the application directory
|
---|
79 |
|
---|
80 | ; VBoxNET drivers are not tested yet - commented out until officially supported and released
|
---|
81 | ;FILE "$%PATH_OUT%\bin\additions\VBoxNET.inf"
|
---|
82 | ;FILE "$%PATH_OUT%\bin\additions\VBoxNET.sys"
|
---|
83 |
|
---|
84 | FunctionEnd
|
---|
85 |
|
---|
86 | Function Vista_InstallFiles
|
---|
87 |
|
---|
88 | ${LogVerbose} "Installing drivers for Vista / Windows 7 / Windows 8 ..."
|
---|
89 |
|
---|
90 | SetOutPath "$INSTDIR"
|
---|
91 | ; Nothing here yet
|
---|
92 |
|
---|
93 | Goto done
|
---|
94 |
|
---|
95 | error:
|
---|
96 |
|
---|
97 | Abort "ERROR: Could not install files! Installation aborted."
|
---|
98 |
|
---|
99 | done:
|
---|
100 |
|
---|
101 | FunctionEnd
|
---|
102 |
|
---|
103 | Function Vista_Main
|
---|
104 |
|
---|
105 | Call Vista_Prepare
|
---|
106 | Call Vista_CopyFiles
|
---|
107 | Call Vista_InstallFiles
|
---|
108 |
|
---|
109 | FunctionEnd
|
---|
110 |
|
---|
111 | !macro Vista_UninstallInstDir un
|
---|
112 | Function ${un}Vista_UninstallInstDir
|
---|
113 |
|
---|
114 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
115 | Delete /REBOOTOK "$INSTDIR\netamd.inf"
|
---|
116 | Delete /REBOOTOK "$INSTDIR\pcntpci5.cat"
|
---|
117 | Delete /REBOOTOK "$INSTDIR\PCNTPCI5.sys"
|
---|
118 | !endif
|
---|
119 |
|
---|
120 | FunctionEnd
|
---|
121 | !macroend
|
---|
122 | !insertmacro Vista_UninstallInstDir ""
|
---|
123 | !insertmacro Vista_UninstallInstDir "un."
|
---|
124 |
|
---|
125 | !macro Vista_Uninstall un
|
---|
126 | Function ${un}Vista_Uninstall
|
---|
127 |
|
---|
128 | ; Remove credential provider
|
---|
129 | ${LogVerbose} "Removing auto-logon support ..."
|
---|
130 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
131 | DeleteRegKey HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
132 | Delete /REBOOTOK "$g_strSystemDir\VBoxCredProv.dll"
|
---|
133 |
|
---|
134 | Call ${un}VBoxMMR_Uninstall
|
---|
135 |
|
---|
136 | FunctionEnd
|
---|
137 | !macroend
|
---|
138 | !insertmacro Vista_Uninstall ""
|
---|
139 | !insertmacro Vista_Uninstall "un."
|
---|
140 |
|
---|
141 | !macro VBoxMMR_Uninstall un
|
---|
142 | Function ${un}VBoxMMR_Uninstall
|
---|
143 |
|
---|
144 | ; Remove VBoxMMR always
|
---|
145 |
|
---|
146 | DetailPrint "Uninstalling VBoxMMR."
|
---|
147 | Call ${un}StopVBoxMMR
|
---|
148 |
|
---|
149 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxMMR"
|
---|
150 |
|
---|
151 | Delete /REBOOTOK "$g_strSystemDir\VBoxMMR.exe"
|
---|
152 |
|
---|
153 | !if $%BUILD_TARGET_ARCH% == "amd64"
|
---|
154 | Delete /REBOOTOK "$g_strSysWow64\VBoxMMRHook.dll"
|
---|
155 | Delete /REBOOTOK "$INSTDIR\VBoxMMR-x86.exe"
|
---|
156 | Delete /REBOOTOK "$INSTDIR\VBoxMMRHook-x86.dll"
|
---|
157 | !else
|
---|
158 | Delete /REBOOTOK "$g_strSystemDir\VBoxMMRHook.dll"
|
---|
159 | Delete /REBOOTOK "$INSTDIR\VBoxMMR.exe"
|
---|
160 | Delete /REBOOTOK "$INSTDIR\VBoxMMRHook.dll"
|
---|
161 | !endif
|
---|
162 |
|
---|
163 | FunctionEnd
|
---|
164 | !macroend
|
---|
165 | !insertmacro VBoxMMR_Uninstall ""
|
---|
166 | !insertmacro VBoxMMR_Uninstall "un."
|
---|