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