VBoxGuestAdditionsCommon.nsh revision fca81330c993457cc8047a46eec3d09b8e38da90
4ba2689c1f4e0c8c670fc47307d7b46d9da3a45bTinderbox User; VBoxGuestAdditionsCommon.nsh - Common / shared utility functions.
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; Copyright (C) 2006-2013 Oracle Corporation
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; This file is part of VirtualBox Open Source Edition (OSE), as
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; available from http://www.virtualbox.org. This file is free software;
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; you can redistribute it and/or modify it under the terms of the GNU
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; General Public License (GPL) as published by the Free Software
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; Foundation, in version 2 as it comes in the "COPYING" file of the
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold KrecickiFunction Common_CopyFiles
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki SetOutPath "$INSTDIR"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki SetOverwrite on
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki!ifdef VBOX_WITH_LICENSE_INSTALL_RTF
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki ; Copy license file (if any) into the installation directory
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki FILE "/oname=${LICENSE_FILE_RTF}" "$%VBOX_BRAND_LICENSE_RTF%"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki!ifdef VBOX_SIGN_ADDITIONS
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki!ifndef UNINSTALLER_ONLY
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold KrecickiFunction ExtractFiles
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki ; @todo: Use a define for all the file specs to group the files per module
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki ; and keep the redundancy low
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki StrCpy "$0" "$INSTDIR\$%BUILD_TARGET_ARCH%"
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki SetOutPath "$0"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews!if $%VBOX_WITH_LICENSE_INSTALL_RTF% == "1"
FILE "$%PATH_OUT%\bin\additions\VBoxVideo.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
FILE "$%PATH_OUT%\bin\additions\VBoxDisp.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
FILE "$%PATH_OUT%\bin\additions\d3d8.dll"
FILE "$%PATH_OUT%\bin\additions\d3d9.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
FILE "$%PATH_OUT%\bin\additions\wined3d.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLarrayspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLcrutil.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLerrorspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpackspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLpassthroughspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGLfeedbackspu.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxOGL.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D8.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D9.dll"
FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\wined3d.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.cat"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoWddm.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
FILE "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoW8.cat"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoW8.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxVideoW8.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm.dll"
FILE "$%PATH_OUT%\bin\additions\wined3dwddm.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxDispD3D-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLarrayspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLcrutil-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLerrorspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpackspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLpassthroughspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGLfeedbackspu-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxOGL-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxD3D9wddm-x86.dll"
FILE "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxMouse.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxMouse.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
FILE "$%PATH_OUT%\bin\additions\VBoxMouseNT.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxGuest.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxGuest.inf"
FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
FILE "$%PATH_OUT%\bin\additions\VBoxHook.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe"
FILE "$%PATH_OUT%\bin\additions\VBoxGuestNT.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxService.exe"
FILE "$%PATH_OUT%\bin\additions\VBoxServiceNT.exe"
FILE "$%PATH_OUT%\bin\additions\VBoxSF.sys"
FILE "$%PATH_OUT%\bin\additions\VBoxMRXNP.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxMRXNP-x86.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxGINA.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxCredProv.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
FILE "$%PATH_OUT%\bin\additions\VBoxGuestDrvInst.exe"
FILE "$%PATH_OUT%\bin\additions\RegCleanup.exe"
; For other windows versions (> XP) it may be necessary to change winver.nsh
; Ok we know it is NT. Must be a string like NT X.XX
;; @todo NT <= 3.x ?
ReadRegStr $g_strAddVerRev HKLM "SOFTWARE\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions" "Revision"
Pop $1 ; Got first part (e.g. "1.5")
Pop $g_strAddVerMin ; Extracted second part (e.g. "5" from "1.5")
nsExec::Exec '"$SYSDIR\net.exe" stop VBoxService'
nsExec::Exec '"$SYSDIR\SC.exe" stop VBoxService'
StrCpy $2 "VBoxServiceNT.exe"
StrCpy $2 "VBoxService.exe"
${nsProcess::FindProcess} "VBoxTray.exe" $0
${nsProcess::KillProcess} "VBoxTray.exe" $0
${nsProcess::FindProcess} "VBoxMMR.exe" $0
${nsProcess::KillProcess} "VBoxMMR.exe" $0
${If} ${FileExists} "$g_strSystemDir\shutdown.exe"
${CmdExecute} "$\"$g_strSystemDir\shutdown.exe$\" -a" "true"
${LogVerbose} "Shutting down not supported: Binary $\"$g_strSystemDir\shutdown.exe$\" not found"
; @return Stack: Company name, or "" on error/if not found.
; @param Un/Installer prefix; either "" or "un".
${LogVerbose} "Verification of file $\"${File}$\" successful (Vendor: ${Vendor}, Architecture: ${Architecture})"
${LogVerbose} "Verification of file $\"${File}$\" failed (not Vendor: ${Vendor}, and/or not Architecture: ${Architecture})"
; @param Un/Installer prefix; either "" or "un".
${LogVerbose} "Skipping to copy file $\"${FileSrc}$\" to $\"${FileDest}$\" (not Vendor: ${Vendor}, Architecture: ${Architecture})"
; Macro for installing a library/DLL.
; @param Un/Installer prefix; either "" or "un".
; @param Name of lib/DLL to verify and copy to destination.
; @param Temporary folder used for exchanging the (locked) lib/DLL after a reboot.
; Macro for installing a library/DLL.
; @param Un/Installer prefix; either "" or "un".
; @param Name of lib/DLL to verify and copy to destination.
; @param Temporary folder used for exchanging the (locked) lib/DLL after a reboot.
${LogVerbose} "File $\"${FileSrc}$\" did not pass verification (Vendor: ${Vendor}, Architecture: ${Architecture})"
; Note: Not finding a file (like *d3d8.dll) on Windows Vista/7 is fine;
${VerifyFileEx} "${un}" "$SYSDIR\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$SYSDIR\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$SYSDIR\dllcache\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$SYSDIR\dllcache\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$g_strSysWow64\d3d8.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$g_strSysWow64\d3d9.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\d3d8.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\d3d9.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$SYSDIR\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$SYSDIR\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$SYSDIR\dllcache\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$SYSDIR\dllcache\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
${VerifyFileEx} "${un}" "$g_strSysWow64\msd3d8.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$g_strSysWow64\msd3d9.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d8.dll" "Microsoft Corporation" "x86"
${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d9.dll" "Microsoft Corporation" "x86"