1 | ; $Id: VBoxGuestAdditionsVista.nsh 108772 2025-03-27 15:32:33Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; VBoxGuestAdditionsVista.nsh - Guest Additions installation for Windows Vista/7.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox base platform packages, as
|
---|
10 | ; available from https://www.virtualbox.org.
|
---|
11 | ;
|
---|
12 | ; This program is free software; you can redistribute it and/or
|
---|
13 | ; modify it under the terms of the GNU General Public License
|
---|
14 | ; as published by the Free Software Foundation, in version 3 of the
|
---|
15 | ; License.
|
---|
16 | ;
|
---|
17 | ; This program is distributed in the hope that it will be useful, but
|
---|
18 | ; WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | ; General Public License for more details.
|
---|
21 | ;
|
---|
22 | ; You should have received a copy of the GNU General Public License
|
---|
23 | ; along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | ;
|
---|
25 | ; SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | ;
|
---|
27 |
|
---|
28 |
|
---|
29 | ;;
|
---|
30 | ; Callback function installation preparation for Windows >= Vista guests.
|
---|
31 | ;
|
---|
32 | ; Input:
|
---|
33 | ; None
|
---|
34 | ; Output:
|
---|
35 | ; None
|
---|
36 | ;
|
---|
37 | Function Vista_CallbackPrepare
|
---|
38 |
|
---|
39 | ${LogVerbose} "Preparing for >= Vista ..."
|
---|
40 |
|
---|
41 | ; Try to restore the original Direct3D files in case we're coming from an old(er) Guest Additions
|
---|
42 | ; installation, which formerly replaced those system files with our own stubs.
|
---|
43 | ; This no longer is needed and thus needs to be reverted in any case.
|
---|
44 | Call RestoreFilesDirect3D
|
---|
45 | ; Ignore the result in case we had trouble restoring. The system would be in an inconsistent state anyway.
|
---|
46 | Call VBoxMMR_Uninstall
|
---|
47 |
|
---|
48 | FunctionEnd
|
---|
49 |
|
---|
50 |
|
---|
51 | ;;
|
---|
52 | ; Callback function for extracting files for Windows >= Vista guests.
|
---|
53 | ;
|
---|
54 | ; Input:
|
---|
55 | ; None
|
---|
56 | ; Output:
|
---|
57 | ; None
|
---|
58 | ;
|
---|
59 | Function Vista_CallbackExtractFiles
|
---|
60 |
|
---|
61 | ${LogVerbose} "Extracting for >= Vista ..."
|
---|
62 | ; Nothing to do here yet.
|
---|
63 |
|
---|
64 | FunctionEnd
|
---|
65 |
|
---|
66 |
|
---|
67 | ;;
|
---|
68 | ; Callback function for installation for Windows >= Vista guests.
|
---|
69 | ;
|
---|
70 | ; Input:
|
---|
71 | ; None
|
---|
72 | ; Output:
|
---|
73 | ; None
|
---|
74 | ;
|
---|
75 | Function Vista_CallbackInstall
|
---|
76 |
|
---|
77 | ${LogVerbose} "Installing for >= Vista ..."
|
---|
78 | ; Nothing to do here yet.
|
---|
79 |
|
---|
80 | FunctionEnd
|
---|
81 |
|
---|
82 |
|
---|
83 | !macro Vista_CallbackDeleteFiles un
|
---|
84 | ;;
|
---|
85 | ; Callback function for deleting files for Windows >= Vista guests.
|
---|
86 | ;
|
---|
87 | ; Input:
|
---|
88 | ; None
|
---|
89 | ; Output:
|
---|
90 | ; None
|
---|
91 | ;
|
---|
92 | Function ${un}Vista_CallbackDeleteFiles
|
---|
93 |
|
---|
94 | ${LogVerbose} "Deleting files for >= Vista ..."
|
---|
95 | ; Nothing to do here.
|
---|
96 |
|
---|
97 | FunctionEnd
|
---|
98 | !macroend
|
---|
99 | !insertmacro Vista_CallbackDeleteFiles "un."
|
---|
100 |
|
---|
101 |
|
---|
102 | !macro Vista_CallbackUninstall un
|
---|
103 | ;;
|
---|
104 | ; Callback function for uninstallation for Windows >= Vista guests.
|
---|
105 | ;
|
---|
106 | ; Input:
|
---|
107 | ; None
|
---|
108 | ; Output:
|
---|
109 | ; None
|
---|
110 | ;
|
---|
111 | Function ${un}Vista_CallbackUninstall
|
---|
112 |
|
---|
113 | ${LogVerbose} "Uninstalling for >= Vista ..."
|
---|
114 |
|
---|
115 | ; Remove credential provider
|
---|
116 | ${LogVerbose} "Removing auto-logon support ..."
|
---|
117 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
118 | DeleteRegKey HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
119 | Delete /REBOOTOK "$g_strSystemDir\VBoxCredProv.dll"
|
---|
120 |
|
---|
121 | Call ${un}VBoxMMR_Uninstall
|
---|
122 |
|
---|
123 | FunctionEnd
|
---|
124 | !macroend
|
---|
125 | !ifndef UNINSTALLER_ONLY
|
---|
126 | !insertmacro Vista_CallbackUninstall ""
|
---|
127 | !endif
|
---|
128 | !insertmacro Vista_CallbackUninstall "un."
|
---|
129 |
|
---|
130 |
|
---|
131 | !macro VBoxMMR_Uninstall un
|
---|
132 | ;;
|
---|
133 | ; Function for uninstalling the MMR driver.
|
---|
134 | ;
|
---|
135 | ; Input:
|
---|
136 | ; None
|
---|
137 | ; Output:
|
---|
138 | ; None
|
---|
139 | ;
|
---|
140 | Function ${un}VBoxMMR_Uninstall
|
---|
141 |
|
---|
142 | ; Remove VBoxMMR always
|
---|
143 |
|
---|
144 | DetailPrint "Uninstalling VBoxMMR ..."
|
---|
145 | Call ${un}StopVBoxMMR
|
---|
146 |
|
---|
147 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxMMR"
|
---|
148 |
|
---|
149 | Delete /REBOOTOK "$g_strSystemDir\VBoxMMR.exe"
|
---|
150 |
|
---|
151 | !if $%KBUILD_TARGET_ARCH% == "amd64"
|
---|
152 | Delete /REBOOTOK "$g_strSysWow64\VBoxMMRHook.dll"
|
---|
153 | Delete /REBOOTOK "$INSTDIR\VBoxMMR-x86.exe"
|
---|
154 | Delete /REBOOTOK "$INSTDIR\VBoxMMRHook-x86.dll"
|
---|
155 | !else
|
---|
156 | Delete /REBOOTOK "$g_strSystemDir\VBoxMMRHook.dll"
|
---|
157 | Delete /REBOOTOK "$INSTDIR\VBoxMMR.exe"
|
---|
158 | Delete /REBOOTOK "$INSTDIR\VBoxMMRHook.dll"
|
---|
159 | !endif
|
---|
160 |
|
---|
161 | FunctionEnd
|
---|
162 | !macroend
|
---|
163 | !insertmacro VBoxMMR_Uninstall ""
|
---|
164 | !insertmacro VBoxMMR_Uninstall "un."
|
---|