1 | ; $Id: VBoxGuestAdditionsVista.nsh 82968 2020-02-04 10:35:17Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; VBoxGuestAdditionsVista.nsh - Guest Additions installation for Windows Vista/7.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2020 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 | ; Nothing to do here right now.
|
---|
25 |
|
---|
26 | Pop $0
|
---|
27 |
|
---|
28 | FunctionEnd
|
---|
29 |
|
---|
30 | Function Vista_Prepare
|
---|
31 |
|
---|
32 | ; Try to restore the original Direct3D files in case we're coming from an old(er) Guest Additions
|
---|
33 | ; installation, which formerly replaced those system files with our own stubs.
|
---|
34 | ; This no longer is needed and thus needs to be reverted in any case.
|
---|
35 | Call RestoreFilesDirect3D
|
---|
36 | ; Ignore the result in case we had trouble restoring. The system would be in an inconsistent state anyway.
|
---|
37 |
|
---|
38 | Call VBoxMMR_Uninstall
|
---|
39 |
|
---|
40 | FunctionEnd
|
---|
41 |
|
---|
42 | Function Vista_CopyFiles
|
---|
43 |
|
---|
44 | SetOutPath "$INSTDIR"
|
---|
45 | SetOverwrite on
|
---|
46 |
|
---|
47 | ; The files are for Vista only, they go into the application directory
|
---|
48 |
|
---|
49 | ; VBoxNET drivers are not tested yet - commented out until officially supported and released
|
---|
50 | ;FILE "$%PATH_OUT%\bin\additions\VBoxNET.inf"
|
---|
51 | ;FILE "$%PATH_OUT%\bin\additions\VBoxNET.sys"
|
---|
52 |
|
---|
53 | FunctionEnd
|
---|
54 |
|
---|
55 | Function Vista_InstallFiles
|
---|
56 |
|
---|
57 | ${LogVerbose} "Installing drivers for Vista / Windows 7 / Windows 8 ..."
|
---|
58 |
|
---|
59 | SetOutPath "$INSTDIR"
|
---|
60 | ; Nothing here yet
|
---|
61 |
|
---|
62 | Goto done
|
---|
63 |
|
---|
64 | error:
|
---|
65 |
|
---|
66 | Abort "ERROR: Could not install files! Installation aborted."
|
---|
67 |
|
---|
68 | done:
|
---|
69 |
|
---|
70 | FunctionEnd
|
---|
71 |
|
---|
72 | Function Vista_Main
|
---|
73 |
|
---|
74 | Call Vista_Prepare
|
---|
75 | Call Vista_CopyFiles
|
---|
76 | Call Vista_InstallFiles
|
---|
77 |
|
---|
78 | FunctionEnd
|
---|
79 |
|
---|
80 | !macro Vista_UninstallInstDir un
|
---|
81 | Function ${un}Vista_UninstallInstDir
|
---|
82 |
|
---|
83 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
84 | Delete /REBOOTOK "$INSTDIR\netamd.inf"
|
---|
85 | Delete /REBOOTOK "$INSTDIR\pcntpci5.cat"
|
---|
86 | Delete /REBOOTOK "$INSTDIR\PCNTPCI5.sys"
|
---|
87 | !endif
|
---|
88 |
|
---|
89 | FunctionEnd
|
---|
90 | !macroend
|
---|
91 | !insertmacro Vista_UninstallInstDir ""
|
---|
92 | !insertmacro Vista_UninstallInstDir "un."
|
---|
93 |
|
---|
94 | !macro Vista_Uninstall un
|
---|
95 | Function ${un}Vista_Uninstall
|
---|
96 |
|
---|
97 | ; Remove credential provider
|
---|
98 | ${LogVerbose} "Removing auto-logon support ..."
|
---|
99 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
100 | DeleteRegKey HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
|
---|
101 | Delete /REBOOTOK "$g_strSystemDir\VBoxCredProv.dll"
|
---|
102 |
|
---|
103 | Call ${un}VBoxMMR_Uninstall
|
---|
104 |
|
---|
105 | FunctionEnd
|
---|
106 | !macroend
|
---|
107 | !insertmacro Vista_Uninstall ""
|
---|
108 | !insertmacro Vista_Uninstall "un."
|
---|
109 |
|
---|
110 | !macro VBoxMMR_Uninstall un
|
---|
111 | Function ${un}VBoxMMR_Uninstall
|
---|
112 |
|
---|
113 | ; Remove VBoxMMR always
|
---|
114 |
|
---|
115 | DetailPrint "Uninstalling VBoxMMR."
|
---|
116 | Call ${un}StopVBoxMMR
|
---|
117 |
|
---|
118 | DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxMMR"
|
---|
119 |
|
---|
120 | Delete /REBOOTOK "$g_strSystemDir\VBoxMMR.exe"
|
---|
121 |
|
---|
122 | !if $%BUILD_TARGET_ARCH% == "amd64"
|
---|
123 | Delete /REBOOTOK "$g_strSysWow64\VBoxMMRHook.dll"
|
---|
124 | Delete /REBOOTOK "$INSTDIR\VBoxMMR-x86.exe"
|
---|
125 | Delete /REBOOTOK "$INSTDIR\VBoxMMRHook-x86.dll"
|
---|
126 | !else
|
---|
127 | Delete /REBOOTOK "$g_strSystemDir\VBoxMMRHook.dll"
|
---|
128 | Delete /REBOOTOK "$INSTDIR\VBoxMMR.exe"
|
---|
129 | Delete /REBOOTOK "$INSTDIR\VBoxMMRHook.dll"
|
---|
130 | !endif
|
---|
131 |
|
---|
132 | FunctionEnd
|
---|
133 | !macroend
|
---|
134 | !insertmacro VBoxMMR_Uninstall ""
|
---|
135 | !insertmacro VBoxMMR_Uninstall "un."
|
---|