VBoxGuestAdditionsVista.nsh revision b711a01730152421a900e5f4e237cfb848c9c4fd
af062818b47340eef15700d2f0211576ba3506eevboxsync; $Id$
af062818b47340eef15700d2f0211576ba3506eevboxsync; @file
af062818b47340eef15700d2f0211576ba3506eevboxsync; VBoxGuestAdditionsVista.nsh - Guest Additions installation for Windows Vista/7.
af062818b47340eef15700d2f0211576ba3506eevboxsync;
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync;
af062818b47340eef15700d2f0211576ba3506eevboxsync; Copyright (C) 2006-2012 Oracle Corporation
af062818b47340eef15700d2f0211576ba3506eevboxsync;
af062818b47340eef15700d2f0211576ba3506eevboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
af062818b47340eef15700d2f0211576ba3506eevboxsync; available from http://www.virtualbox.org. This file is free software;
af062818b47340eef15700d2f0211576ba3506eevboxsync; you can redistribute it and/or modify it under the terms of the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync; General Public License (GPL) as published by the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
af062818b47340eef15700d2f0211576ba3506eevboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
af062818b47340eef15700d2f0211576ba3506eevboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
af062818b47340eef15700d2f0211576ba3506eevboxsync;
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncFunction Vista_CheckForRequirements
af062818b47340eef15700d2f0211576ba3506eevboxsync
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync Push $0
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync DetailPrint "Checking for installation requirements for Vista / Windows 7 / Windows 8 ..."
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync ${If} $g_bForceInstall == "true"
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync DetailPrint "Forcing installatoin, checking requirements skipped"
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync goto success
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync ${EndIf}
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync ; Validate D3D files, regardless whether D3D support is selected or not
af062818b47340eef15700d2f0211576ba3506eevboxsync Call ValidateD3DFiles
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync Pop $0
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync ${If} $0 == "1" ; D3D files are invalid, notify user
af062818b47340eef15700d2f0211576ba3506eevboxsync MessageBox MB_ICONSTOP|MB_OKCANCEL $(VBOX_COMPONENT_D3D_INVALID) /SD IDOK IDCANCEL failure
af062818b47340eef15700d2f0211576ba3506eevboxsync ${EndIf}
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync Goto success
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncfailure:
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync Abort "ERROR: Requirements not met! Installation aborted."
af062818b47340eef15700d2f0211576ba3506eevboxsync goto exit
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsyncsuccess:
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync ; Nothing to do here right now
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync Goto exit
af062818b47340eef15700d2f0211576ba3506eevboxsync
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsyncexit:
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync Pop $0
af062818b47340eef15700d2f0211576ba3506eevboxsync
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsyncFunctionEnd
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncFunction Vista_CopyFiles
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync SetOutPath "$INSTDIR"
af062818b47340eef15700d2f0211576ba3506eevboxsync SetOverwrite on
; The files are for Vista only, they go into the application directory
; VBoxNET drivers are not tested yet - commented out until officially supported and released
;FILE "$%PATH_OUT%\bin\additions\VBoxNET.inf"
;FILE "$%PATH_OUT%\bin\additions\VBoxNET.sys"
FunctionEnd
Function Vista_InstallFiles
DetailPrint "Installing drivers for Vista / Windows 7 / Windows 8 ..."
SetOutPath "$INSTDIR"
; Nothing here yet
Goto done
error:
Abort "ERROR: Could not install files! Installation aborted."
done:
FunctionEnd
Function Vista_Main
Call Vista_CopyFiles
Call Vista_InstallFiles
FunctionEnd
!macro Vista_UninstallInstDir un
Function ${un}Vista_UninstallInstDir
!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
Delete /REBOOTOK "$INSTDIR\netamd.inf"
Delete /REBOOTOK "$INSTDIR\pcntpci5.cat"
Delete /REBOOTOK "$INSTDIR\PCNTPCI5.sys"
!endif
FunctionEnd
!macroend
!insertmacro Vista_UninstallInstDir ""
!insertmacro Vista_UninstallInstDir "un."
!macro Vista_Uninstall un
Function ${un}Vista_Uninstall
; Remove credential provider
DetailPrint "Removing auto-logon support ..."
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
DeleteRegKey HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}"
Delete /REBOOTOK "$g_strSystemDir\VBoxCredProv.dll"
FunctionEnd
!macroend
!insertmacro Vista_Uninstall ""
!insertmacro Vista_Uninstall "un."