VBoxGuestAdditions.nsi revision 8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; $Id$
b711a01730152421a900e5f4e237cfb848c9c4fdvboxsync; @file
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; VBoxGuestAdditions.nsi - Main file for Windows Guest Additions installation.
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync;
2f14f4556ae74ad40719bc9690534693abb71868vboxsync
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync;
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync; Copyright (C) 2012-2013 Oracle Corporation
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync;
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; available from http://www.virtualbox.org. This file is free software;
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; you can redistribute it and/or modify it under the terms of the GNU
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; General Public License (GPL) as published by the Free Software
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TYPE% == "debug"
78a072e1b56619e3230735ae073668311232ec94vboxsync !define _DEBUG ; Turn this on to get extra output
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync!ifdef _DEBUG
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync ; Scratch directory for plugin tests
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync !addincludedir .\PluginTest
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync !addplugindir .\PluginTest
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync!endif
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Defines for special functions
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync!define WHQL_FAKE ; Enables faking of non WHQL signed / approved drivers
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync ; Needs the VBoxWHQLFake.exe in the additions output directory!
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync!define WFP_FILE_EXCEPTION ; Enables setting a temporary file exception for WFP proctected files
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define VENDOR_ROOT_KEY "SOFTWARE\$%VBOX_VENDOR_SHORT%"
78a072e1b56619e3230735ae073668311232ec94vboxsync
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync; Product defines
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_NAME "$%VBOX_PRODUCT% Guest Additions"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_DESC "$%VBOX_PRODUCT% Guest Additions"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_VERSION "$%VBOX_VERSION_MAJOR%.$%VBOX_VERSION_MINOR%.$%VBOX_VERSION_BUILD%.0"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_PUBLISHER "$%VBOX_VENDOR%"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_COPYRIGHT "(C) $%VBOX_C_YEAR% $%VBOX_VENDOR%"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_OUTPUT "VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%.exe"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_WEB_SITE "http://www.virtualbox.org"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_INSTALL_KEY "${VENDOR_ROOT_KEY}\VirtualBox Guest Additions"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_UNINST_ROOT_KEY "HKLM"
78a072e1b56619e3230735ae073668311232ec94vboxsync
d5d45608052fd506e4114bf112df6efae7fcd8a7vboxsync!define LICENSE_FILE_RTF "license.rtf"
9be72bf71509dd721ffa1df70ead200abf30afd8vboxsync
e7184fff6d89903aed623860629a05047960ac2dvboxsync; Needed for InstallLib macro: Install libraries in every case
e7184fff6d89903aed623860629a05047960ac2dvboxsync!define LIBRARY_IGNORE_VERSION
e7184fff6d89903aed623860629a05047960ac2dvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIProductVersion "${PRODUCT_VERSION}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "FileVersion" "$%VBOX_VERSION_STRING%"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "ProductName" "${PRODUCT_NAME}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "CompanyName" "${PRODUCT_PUBLISHER}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "FileDescription" "${PRODUCT_DESC}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "LegalCopyright" "${PRODUCT_COPYRIGHT}"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVIAddVersionKey "InternalName" "${PRODUCT_OUTPUT}"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; This registry key will hold the mouse driver path before install (NT4 only)
78a072e1b56619e3230735ae073668311232ec94vboxsync!define ORG_MOUSE_PATH "MousePath"
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; If we have our guest install helper DLL, add the
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; plugin path so that NSIS can find it when compiling the installer
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; Note: NSIS plugins *always* have to be compiled in 32-bit!
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync !addplugindir "$%PATH_TARGET_X86%\VBoxGuestInstallHelper"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!endif
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "LogicLib.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "FileFunc.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro GetParameters
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro GetOptions
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "WordFunc.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro WordFind
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro StrFilter
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "nsProcess.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Library.nsh"
c7c6718a3ec95ca32bf4f2e5311b871e95c3b195vboxsync!include "Sections.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "strstr.nsh" ; Function "strstr"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "servicepack.nsh" ; Function "GetServicePack"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "winver.nsh" ; Function for determining Windows version
78a072e1b56619e3230735ae073668311232ec94vboxsync!define REPLACEDLL_NOREGISTER ; Replace in use DLL function
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "ReplaceDLL.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "dumplog.nsh" ; Dump log to file function
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync !include "x64.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync; Set Modern UI (MUI) as default
08c4185261c17943cff6cc94522579696eeeb478vboxsync!define USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync!ifdef USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Use modern UI, version 2
08c4185261c17943cff6cc94522579696eeeb478vboxsync !include "MUI2.nsh"
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; MUI Settings
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_WELCOMEFINISHPAGE_BITMAP "$%VBOX_BRAND_WIN_ADD_INST_DLGBMP%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_ABORTWARNING
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_WELCOMEPAGE_TITLE_3LINES "Welcome to the ${PRODUCT_NAME} Additions Setup"
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; API defines
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define SM_CLEANBOOT 67
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Icons
08c4185261c17943cff6cc94522579696eeeb478vboxsync !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_ICON "$%VBOX_NSIS_ICON_FILE%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_UNICON "$%VBOX_NSIS_ICON_FILE%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !else ; 64-bit
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_ICON "$%VBOX_WINDOWS_ADDITIONS_ICON_FILE%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_UNICON "$%VBOX_WINDOWS_ADDITIONS_ICON_FILE%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Welcome page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_WELCOME
9726c89eba6e777f3eb4d57f65ca6171a2241d29vboxsync!ifdef VBOX_WITH_LICENSE_DISPLAY
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; License page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_LICENSE "$(VBOX_LICENSE)"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_LICENSEPAGE_RADIOBUTTONS
da31d917654e0b617e7a9bf8b0cf786136edf8e8vboxsync!endif
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Directory page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_DIRECTORY
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Components Page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_COMPONENTS
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Instfiles page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_INSTFILES
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync !ifndef _DEBUG
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_FINISHPAGE_TITLE_3LINES ; Have a bit more vertical space for text
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_FINISH ; Only show in release mode - useful information for debugging!
08c4185261c17943cff6cc94522579696eeeb478vboxsync !endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Uninstaller pages
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_UNPAGE_INSTFILES
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Define languages we will use
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_LANGUAGE "English"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_LANGUAGE "French"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_LANGUAGE "German"
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Set branding text which appears on the horizontal line at the bottom
a6ab77f04b22f0de7691f50dfdee8196024ce26dvboxsync!ifdef _DEBUG
034b3d77b1a08b77b1fa9bfd7489997421713f15vboxsync BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING% (r$%VBOX_SVN_REV%) - Debug Build"
a6ab77f04b22f0de7691f50dfdee8196024ce26dvboxsync!else
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING%"
a6ab77f04b22f0de7691f50dfdee8196024ce26dvboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
9726c89eba6e777f3eb4d57f65ca6171a2241d29vboxsync!ifdef VBOX_WITH_LICENSE_DISPLAY
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Set license language
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_ENGLISH} "$%VBOX_BRAND_LICENSE_RTF%"
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; If license files not available (OSE / PUEL) build, then use the English one as default
08c4185261c17943cff6cc94522579696eeeb478vboxsync !ifdef VBOX_BRAND_fr_FR_LICENSE_RTF
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_fr_FR_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !else
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !endif
08c4185261c17943cff6cc94522579696eeeb478vboxsync !ifdef VBOX_BRAND_de_DE_LICENSE_RTF
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_de_DE_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !else
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !endif
da31d917654e0b617e7a9bf8b0cf786136edf8e8vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_RESERVEFILE_LANGDLL
08c4185261c17943cff6cc94522579696eeeb478vboxsync!else ; !USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync XPStyle on
9726c89eba6e777f3eb4d57f65ca6171a2241d29vboxsync!ifdef VBOX_WITH_LICENSE_DISPLAY
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page license
da31d917654e0b617e7a9bf8b0cf786136edf8e8vboxsync!endif
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page components
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page directory
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page instfiles
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Language files
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Languages\English.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Languages\French.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Languages\German.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Variables and output files
78a072e1b56619e3230735ae073668311232ec94vboxsyncName "${PRODUCT_NAME} $%VBOX_VERSION_STRING%"
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef UNINSTALLER_ONLY
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync !echo "Uninstaller only!"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync OutFile "$%PATH_TARGET%\VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%-uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync!else
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync OutFile "VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%.exe"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!endif ; UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; Define default installation directory
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
78a072e1b56619e3230735ae073668311232ec94vboxsync InstallDir "$PROGRAMFILES32\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions"
78a072e1b56619e3230735ae073668311232ec94vboxsync!else ; 64-bit
78a072e1b56619e3230735ae073668311232ec94vboxsync InstallDir "$PROGRAMFILES64\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncInstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
78a072e1b56619e3230735ae073668311232ec94vboxsyncShowInstDetails show
78a072e1b56619e3230735ae073668311232ec94vboxsyncShowUnInstDetails show
78a072e1b56619e3230735ae073668311232ec94vboxsyncRequestExecutionLevel highest
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; Internal parameters
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_iSystemMode ; Current system mode (0 = Normal boot, 1 = Fail-safe boot, 2 = Fail-safe with network boot)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strSystemDir ; Windows system directory
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncVar g_strSysWow64 ; The SysWow64 directory on 64-bit systems
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strCurUser ; Current user using the system
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strAddVerMaj ; Installed Guest Additions: Major version
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strAddVerMin ; Installed Guest Additions: Minor version
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strAddVerBuild ; Installed Guest Additions: Build number
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strAddVerRev ; Installed Guest Additions: SVN revision
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_strWinVersion ; Current Windows version we're running on
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bLogEnable ; Do logging when installing? "true" or "false"
84ac4fe6468b328aadfe9994176e00504338a47avboxsyncVar g_bWithWDDM ; Install the WDDM driver instead of the XPDM one
60a6d709c252770b3830c85deac9c493625e3f52vboxsyncVar g_bCapDllCache ; Capability: Does the (Windows) guest have have a DLL cache which needs to be taken care of?
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bCapWDDM ; Capability: Is the guest able to handle/use our WDDM driver?
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; Command line parameters - these can be set/modified
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; on the command line
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bFakeWHQL ; Cmd line: Fake Windows to install non WHQL certificated drivers (only for W2K and XP currently!!) ("/unsig_drv")
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bForceInstall ; Cmd line: Force installation on unknown Windows OS version
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bUninstall ; Cmd line: Just uninstall any previous Guest Additions and exit
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bRebootOnExit ; Cmd line: Auto-Reboot on successful installation. Good for unattended installations ("/reboot")
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_iScreenBpp ; Cmd line: Screen depth ("/depth=X")
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_iScreenX ; Cmd line: Screen resolution X ("/resx=X")
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_iScreenY ; Cmd line: Screen resolution Y ("/resy=Y")
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_iSfOrder ; Cmd line: Order of Shared Folders network provider (0=first, 1=second, ...)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bIgnoreUnknownOpts ; Cmd line: Ignore unknown options (don't display the help)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bNoVBoxServiceExit ; Cmd line: Do not quit VBoxService before updating - install on next reboot
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bNoVBoxTrayExit ; Cmd line: Do not quit VBoxTray before updating - install on next reboot
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bNoVideoDrv ; Cmd line: Do not install the VBoxVideo driver
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bNoGuestDrv ; Cmd line: Do not install the VBoxGuest driver
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bNoMouseDrv ; Cmd line: Do not install the VBoxMouse driver
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bWithAutoLogon ; Cmd line: Install VBoxGINA / VBoxCredProv for auto logon support
2a7322928382e52db8e320d19df4f03dee16b3edvboxsyncVar g_bWithVBoxMMR ; Cmd line: Install VBoxMMR for media redirection support
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bWithD3D ; Cmd line: Install Direct3D support
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bOnlyExtract ; Cmd line: Only extract all files, do *not* install them. Only valid with param "/D" (target directory)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsyncVar g_bPostInstallStatus ; Cmd line: Post the overall installation status to some external program (VBoxTray)
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Platform parts of this installer
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync!include "VBoxGuestAdditionsLog.nsh"
59bb2da0ef97dc8c9d0821ac921728f515623ac5vboxsync!include "VBoxGuestAdditionsExternal.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsCommon.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit only
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync !include "VBoxGuestAdditionsNT4.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsW2KXP.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsVista.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsUninstall.nsh" ; Product uninstallation
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsUninstallOld.nsh" ; Uninstallation of deprecated versions which must be removed first
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction HandleCommandLine
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $0 ; Command line (without process name)
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $1 ; Number of parameters
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $2 ; Current parameter index
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $3 ; Current parameter pair (name=value)
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $4 ; Current parameter name
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $5 ; Current parameter value (if present)
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $1 "0" ; Init param counter
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $2 "1" ; Init current param counter
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${GetParameters} $0 ; Extract command line
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $0 == "" ; If no parameters at all exit
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto exit
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Enable for debugging
78a072e1b56619e3230735ae073668311232ec94vboxsync ;MessageBox MB_OK "CmdLine: $0"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${WordFind} $0 " " "#" $1 ; Get number of parameters in cmd line
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $0 == $1 ; If result matches the input then
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync StrCpy $1 "1" ; no delimiter was found. Correct to 1 word total
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${While} $2 <= $1 ; Loop through all params
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${WordFind} $0 " " "+$2" $3 ; Get current name=value pair
78a072e1b56619e3230735ae073668311232ec94vboxsync ${WordFind} $3 "=" "+1" $4 ; Get current param name
78a072e1b56619e3230735ae073668311232ec94vboxsync ${WordFind} $3 "=" "+2" $5 ; Get current param value
78a072e1b56619e3230735ae073668311232ec94vboxsync
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync ${StrFilter} $4 "-" "" "" $4 ; Transfer param name to lowercase
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Enable for debugging
78a072e1b56619e3230735ae073668311232ec94vboxsync ;MessageBox MB_OK "#$2 of #$1, param='$3', name=$4, val=$5"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Switch} $4
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/d' ; NSIS: /D=<instdir> switch, skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/depth'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'depth'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenBpp $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/extract'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bOnlyExtract "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${Case} '/force'
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCpy $g_bForceInstall "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${Break}
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/help'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/H'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/h'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/?'
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto usage
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync ${Case} '/ignore_unknownopts' ; Not officially documented
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync StrCpy $g_bIgnoreUnknownOpts "true"
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync ${Break}
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/l'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/log'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/logging'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bLogEnable "true"
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/ncrc' ; NSIS: /NCRC switch, skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Case} '/no_vboxservice_exit' ; Not officially documented
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync StrCpy $g_bNoVBoxServiceExit "true"
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Break}
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync
156101683587682f6d63b4af322f611d90b77fcevboxsync ${Case} '/no_vboxtray_exit' ; Not officially documented
156101683587682f6d63b4af322f611d90b77fcevboxsync StrCpy $g_bNoVBoxTrayExit "true"
156101683587682f6d63b4af322f611d90b77fcevboxsync ${Break}
156101683587682f6d63b4af322f611d90b77fcevboxsync
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Case} '/no_videodrv' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVideoDrv "true"
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Case} '/no_guestdrv' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoGuestDrv "true"
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Case} '/no_mousedrv' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoMouseDrv "true"
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; This switch tells our installer that it
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; - should not quit VBoxTray during the update, because ...
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; - ... it should show the overall installation status
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; using VBoxTray's balloon message feature (since VBox 4.0)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ${Case} '/post_installstatus' ; Not officially documented
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync StrCpy $g_bNoVBoxTrayExit "true"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync StrCpy $g_bPostInstallStatus "true"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ${Break}
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!endif
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/reboot'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bRebootOnExit "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/s' ; NSIS: /S switch, skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/sforder'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'sforder'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iSfOrder $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync !ifdef WHQL_FAKE
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/unsig_drv'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bFakeWHQL "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync !endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/uninstall'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bUninstall "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/with_autologon'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithAutoLogon "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync!if $%VBOX_WITH_MMR% == "1"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ${Case} '/with_vboxmmr'
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync StrCpy $g_bWithVBoxMMR "true"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ${Break}
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync!endif
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync !if $%VBOX_WITH_CROGL% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/with_d3d'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/with_direct3d'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithD3D "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync !endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/xres'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'xres'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenX $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/yres'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'yres'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenY $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${Default} ; Unknown parameter, print usage message
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ; Prevent popping up usage message on (yet) unknown parameters
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ; in silent mode, just skip
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync IfSilent +1 +2
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync goto usage
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Break}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndSwitch}
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsyncnext_param:
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync IntOp $2 $2 + 1
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndWhile}
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto exit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncusage:
78a072e1b56619e3230735ae073668311232ec94vboxsync
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync ; If we were told to ignore unknown (invalid) options, just return to
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync ; the parsing loop ...
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync ${If} $g_bIgnoreUnknownOpts == "true"
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync Goto next_param
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_OK "${PRODUCT_NAME} Installer$\r$\n$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync Usage: VBoxWindowsAdditions-$%BUILD_TARGET_ARCH% [OPTIONS] [/l] [/S] [/D=<PATH>]$\r$\n$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync Options:$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /depth=BPP$\tSets the guest's display color depth (bits per pixel)$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /extract$\t$\tOnly extract installation files$\r$\n \
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync /force$\t$\tForce installation on unknown/undetected Windows versions$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /uninstall$\t$\tJust uninstalls the Guest Additions and exits$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /with_autologon$\tInstalls auto-logon support$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /with_d3d$\tInstalls D3D support$\r$\n \
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync /with_vboxmmr$\tInstalls multimedia redirection support$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /xres=X$\t$\tSets the guest's display resolution (width in pixels)$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /yres=Y$\t$\tSets the guest's display resolution (height in pixels)$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync $\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync Installer parameters:$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /l$\t$\tEnables logging$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /S$\t$\tSilent install$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync /D=<PATH>$\tSets the default install path$\r$\n \
78a072e1b56619e3230735ae073668311232ec94vboxsync $\r$\n \
40d48df41519667fa639cfe552c097210b9685acvboxsync Note: Order of options and installer parameters are mandatory." /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; No stack restore needed, we're about to quit
78a072e1b56619e3230735ae073668311232ec94vboxsync Quit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncdone:
78a072e1b56619e3230735ae073668311232ec94vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync!ifdef _DEBUG
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Property: XRes: $g_iScreenX"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Property: YRes: $g_iScreenY"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Property: BPP: $g_iScreenBpp"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Property: Logging enabled: $g_bLogEnable"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync!endif
b357ffdbc9fd30f5187620831737367bb1830fefvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $5
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $4
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $3
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $2
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $0
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction CheckForOldGuestAdditions
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $0
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $1
78a072e1b56619e3230735ae073668311232ec94vboxsync Push $2
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncbegin:
78a072e1b56619e3230735ae073668311232ec94vboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${LogVerbose} "Checking for old Guest Additions ..."
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_check:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for old "Sun VirtualBox Guest Additions"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; - before rebranding to Oracle
78a072e1b56619e3230735ae073668311232ec94vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCmp $0 "" sun_xvm_check ; If string is empty, Sun additions are probably not installed (anymore)
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $2
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $0
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync Quit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_uninstall:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_Sun
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto success
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_xvm_check:
78a072e1b56619e3230735ae073668311232ec94vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Check for old "Sun xVM VirtualBox Guest Additions"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; - before getting rid of the "xVM" namespace
78a072e1b56619e3230735ae073668311232ec94vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCmp $0 "" innotek_check ; If string is empty, Sun xVM additions are probably not installed (anymore)
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_xvm_uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $2
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $0
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync Quit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_xvm_uninstall:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_SunXVM
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto success
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncinnotek_check:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for old "innotek" Guest Additions" before rebranding to "Sun"
78a072e1b56619e3230735ae073668311232ec94vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCmp $0 "" exit ; If string is empty, innotek Guest Additions are probably not installed (anymore)
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_INNOTEK_FOUND) /SD IDYES IDYES innotek_uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $2
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $0
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_INNOTEK_ABORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync Quit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncinnotek_uninstall:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_Innotek
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto success
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncsuccess:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Nothing to do here yet
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $2
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $0
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsyncFunction CheckForInstalledComponents
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Push $0
0fd573f0c3cdeafdc08b5bf60275bc6b619942cbvboxsync Push $1
78a072e1b56619e3230735ae073668311232ec94vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Checking for installed components ..."
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync StrCpy $1 ""
b357ffdbc9fd30f5187620831737367bb1830fefvboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call SetAppMode64
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync ; VBoxGINA already installed? So we need to update the installed version as well,
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync ; regardless whether the user used "/with_autologon" or not
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync ${If} $0 == "VBoxGINA.dll"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync StrCpy $1 "GINA"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${Else}
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" ""
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${If} $0 == "VBoxCredProv"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync StrCpy $1 "Credential Provider"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${EndIf}
319e4aeb44409b63822d495e4edb4cda8e1b158evboxsync ${EndIf}
0fd573f0c3cdeafdc08b5bf60275bc6b619942cbvboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync!ifdef _DEBUG
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Auto-logon module: $0"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync!endif
b357ffdbc9fd30f5187620831737367bb1830fefvboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${IfNot} $1 == ""
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Auto-logon support ($1) was installed previously"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync StrCpy $g_bWithAutoLogon "true" ; Force update
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${Else}
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Auto-logon support was not installed previously"
319e4aeb44409b63822d495e4edb4cda8e1b158evboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ; Check for installed MMR support and enable updating
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ; those modules if needed
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${If} ${FileExists} "$g_strSystemDir\VBoxMMR.exe"
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${AndIf} ${FileExists} "$g_strSysWow64\VBoxMMRHook.dll"
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync!else
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${AndIf} ${FileExists} "$g_strSystemDir\VBoxMMRHook.dll"
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync!endif
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${LogVerbose} "MultiMedia Redirection support (MMR) was installed previously"
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync StrCpy $g_bWithVBoxMMR "true" ; Force update
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${Else}
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${LogVerbose} "MultiMedia Redirection support (MMR) support was not installed previously"
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync ${EndIf}
8c9f8fda080b7e99f35ef4d2ab8ec632ad2a4068vboxsync
0fd573f0c3cdeafdc08b5bf60275bc6b619942cbvboxsync Pop $1
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Pop $0
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Main Files
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection $(VBOX_COMPONENT_MAIN) SEC01
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync SectionIn RO ; Section cannot be unselected (read-only)
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${If} $g_bPostInstallStatus == "true"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogToVBoxTray} "0" "${PRODUCT_NAME} update started, please wait ..."
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${EndIf}
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync IfSilent +1 +2
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync StrCpy $g_bLogEnable "true" ; Force logging in silent mode
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${LogEnable} "$g_bLogEnable"
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync IfSilent +1 +2 ; NSIS will expand ${LogVerbose} before doing relative jumps!
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync LogText "Installer runs in silent mode"
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOverwrite on
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call SetAppMode64
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strSystemDir "$SYSDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_strAddVerMaj != ""
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Else}
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${LogVerbose} "No previous version of ${PRODUCT_NAME} detected"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
eb563d667bee4ab4ac0ba8be38d68f911f1d53eavboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Detected OS: Windows $g_strWinVersion (64-bit)"
eb563d667bee4ab4ac0ba8be38d68f911f1d53eavboxsync!else
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Detected OS: Windows $g_strWinVersion (32-bit)"
eb563d667bee4ab4ac0ba8be38d68f911f1d53eavboxsync!endif
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "System Directory: $g_strSystemDir"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef _DEBUG
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installer runs in debug mode"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ;
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Here starts the main dispatcher (based on guest OS)
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ;
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; Which OS are we using?
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "XP" w2k ; Windows XP
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "7" vista ; Windows 7
36dd9dabf3f64468206cb74145b51245cf7fde54vboxsync StrCmp $g_strWinVersion "8" vista ; Windows 8
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${If} $g_bForceInstall == "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Goto vista ; Assume newer OS than we know of ...
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto notsupported
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsyncnt4: ; Windows NT4
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetServicePack
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $R0 ; Major version
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $R1 ; Minor version
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; At least Service Pack 6 installed?
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $R0 <> "6"
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_NT4_NO_SP6) /SD IDYES IDYES +2
78a072e1b56619e3230735ae073668311232ec94vboxsync Quit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Copy some common files ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync Call NT4_Main
78a072e1b56619e3230735ae073668311232ec94vboxsync goto success
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncw2k: ; Windows 2000 and XP ...
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Copy some common files ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync Call W2K_Main
78a072e1b56619e3230735ae073668311232ec94vboxsync goto success
78a072e1b56619e3230735ae073668311232ec94vboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncvista: ; Windows Vista / Windows 7 / Windows 8
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Check requirments; this function can abort the installation if necessary!
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync Call Vista_CheckForRequirements
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Copy some common files ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync Call W2K_Main ; First install stuff from Windows 2000 / XP
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync Call Vista_Main ; ... and some specific stuff for Vista / Windows 7
78a072e1b56619e3230735ae073668311232ec94vboxsync goto success
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncnotsupported:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync goto exit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncsuccess:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Write a registry key with version and installation path for later lookup
85668909c68b5d0e67c89d6042535b41c4bffeccvboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Version" "$%VBOX_VERSION_STRING_RAW%"
85668909c68b5d0e67c89d6042535b41c4bffeccvboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "VersionExt" "$%VBOX_VERSION_STRING%"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Revision" "$%VBOX_SVN_REV%"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "InstallDir" "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync
034b3d77b1a08b77b1fa9bfd7489997421713f15vboxsync ; Set the reboot flag to tell the finish page that is should
034b3d77b1a08b77b1fa9bfd7489997421713f15vboxsync ; default to the "reboot now" entry
034b3d77b1a08b77b1fa9bfd7489997421713f15vboxsync SetRebootFlag true
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Auto-logon support (section is hidden at the moment -- only can be enabled via command line switch)
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call SetAppMode64
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetWindowsVersion
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $R0 ; Windows Version
78a072e1b56619e3230735ae073668311232ec94vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installing auto-logon support ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Another GINA already is installed? Check if this is ours, otherwise let the user decide (unless it's a silent setup)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; whether to replace it with the VirtualBox one or not
78a072e1b56619e3230735ae073668311232ec94vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $0 != ""
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $0 != "VBoxGINA.dll"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Found another already installed GINA module: $0"
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1 $(VBOX_COMPONENT_AUTOLOGON_WARN_3RDPARTY) /SD IDYES IDYES install
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Skipping GINA installation, keeping: $0"
223d0cc6ed8bf5767cb97c734684460b8eae31a8vboxsync goto skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncinstall:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Do we need VBoxCredProv or VBoxGINA?
37320c09d54b322461eb9833e3528aee029431e7vboxsync ${If} $R0 == 'Vista' ; Windows Vista.
37320c09d54b322461eb9833e3528aee029431e7vboxsync ${OrIf} $R0 == '7' ; Windows 7.
37320c09d54b322461eb9833e3528aee029431e7vboxsync ${OrIf} $R0 == '8' ; Windows 8.
37320c09d54b322461eb9833e3528aee029431e7vboxsync ; Use VBoxCredProv on Vista and up.
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installing VirtualBox credential provider ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxCredProv.dll" "$g_strSystemDir\VBoxCredProv.dll" "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (default) key
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (Default) key
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "" "VBoxCredProv.dll" ; adding to (Default) key
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "ThreadingModel" "Apartment"
223d0cc6ed8bf5767cb97c734684460b8eae31a8vboxsync ${Else} ; Use VBoxGINA on older Windows OSes (< Vista)
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installing VirtualBox GINA ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxGINA.dll" "$g_strSystemDir\VBoxGINA.dll" "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" "VBoxGINA.dll"
be603ce3cb13b5ee7f4c3d85ea27ff41ac294535vboxsync ; Add Windows notification package callbacks for VBoxGINA
be603ce3cb13b5ee7f4c3d85ea27ff41ac294535vboxsync WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" "DLLName" "VBoxGINA.dll"
be603ce3cb13b5ee7f4c3d85ea27ff41ac294535vboxsync WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" "Impersonate" 0
be603ce3cb13b5ee7f4c3d85ea27ff41ac294535vboxsync WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" "StopScreenSaver" "WnpScreenSaverStop"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
223d0cc6ed8bf5767cb97c734684460b8eae31a8vboxsyncskip:
223d0cc6ed8bf5767cb97c734684460b8eae31a8vboxsync
223d0cc6ed8bf5767cb97c734684460b8eae31a8vboxsync ; Nothing to do here right now
223d0cc6ed8bf5767cb97c734684460b8eae31a8vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
7a731cb139828206e59b084166bebe09e1e4d7c2vboxsync; Prepares the access rights for replacing
7a731cb139828206e59b084166bebe09e1e4d7c2vboxsync; a WRP (Windows Resource Protection) protected file
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $0
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${IfNot} ${FileExists} "$0"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "WRP: File $0 does not exist, skipping"
7a731cb139828206e59b084166bebe09e1e4d7c2vboxsync Return
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${EndIf}
7a731cb139828206e59b084166bebe09e1e4d7c2vboxsync
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${If} ${FileExists} "$g_strSystemDir\takeown.exe"
59bb2da0ef97dc8c9d0821ac921728f515623ac5vboxsync ${CmdExecute} "$\"$g_strSystemDir\takeown.exe$\" /F $\"$0$\"" "true"
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${Else}
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "WRP: Warning: takeown.exe not found, skipping"
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${EndIf}
7a731cb139828206e59b084166bebe09e1e4d7c2vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync AccessControl::SetFileOwner "$0" "(S-1-5-32-545)"
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "WRP: Setting file owner for $0 returned: $1"
7a731cb139828206e59b084166bebe09e1e4d7c2vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess"
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $1
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "WRP: Setting access rights for $0 returned: $1"
78a072e1b56619e3230735ae073668311232ec94vboxsync
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync !ifdef WFP_FILE_EXCEPTION
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync VBoxGuestInstallHelper::DisableWFP "$0"
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync Pop $1 ; Get return value (ignored for now)
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "WRP: Setting WFP exception for $0 returned: $1"
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync !endif
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync!endif
04fb270f7378e5e38964b7da92abc2146c96e93avboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; Direct3D support
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection /o $(VBOX_COMPONENT_D3D) SEC03
78a072e1b56619e3230735ae073668311232ec94vboxsync
e068057c82b010bc7cc663e8f57ac3ef1890a33cvboxsync!if $%VBOX_WITH_WDDM% == "1"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync ${If} $g_bWithWDDM == "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; All D3D components are installed with WDDM driver package, nothing to be done here
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsync Return
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsync ${EndIf}
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOverwrite on
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_strSystemDir == ''
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strSystemDir "$SYSDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync SetOutPath $g_strSystemDir
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installing Direct3D support ..."
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync FILE "$%PATH_OUT%\bin\additions\wined3d.dll"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
6208fac57be110a1d341a36c75b362907b82d280vboxsync ;
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync ; Update DLL cache
6208fac57be110a1d341a36c75b362907b82d280vboxsync ;
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} $g_bCapDllCache == "true"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} ${FileExists} "$g_strSystemDir\dllcache"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SetOutPath "$g_strSystemDir\dllcache"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSystemDir\dllcache\d3d8.dll" "$g_strSystemDir\dllcache\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSystemDir\dllcache\d3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSystemDir\dllcache\d3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${Else}
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "DLL cache does not exist, skipping"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${EndIf}
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${EndIf}
0fd573f0c3cdeafdc08b5bf60275bc6b619942cbvboxsync
6208fac57be110a1d341a36c75b362907b82d280vboxsync ;
2859546be945ab432d6b26306e233d969b1149bavboxsync ; Save original DLLs (only if msd3d*.dll does not exist) ...
6208fac57be110a1d341a36c75b362907b82d280vboxsync ;
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync SetOutPath $g_strSystemDir
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSystemDir\d3d8.dll" "$g_strSystemDir\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync Push "$g_strSystemDir\d3d8.dll"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync Call PrepareWRPFile
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync Push "$g_strSystemDir\d3d9.dll"
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync Call PrepareWRPFile
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync
6208fac57be110a1d341a36c75b362907b82d280vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ; Only 64-bit installer:
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ; Also copy 32-bit DLLs on 64-bit Windows in SysWOW64 node
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync SetOutPath $g_strSysWow64
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installing Direct3D support for 32-bit applications (SysWOW64: $g_strSysWow64) ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\wined3d.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ;
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Update DLL cache
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ;
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} $g_bCapDllCache == "true"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} ${FileExists} "$g_strSysWow64\dllcache"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SetOutPath "$g_strSysWow64\dllcache"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSysWow64\dllcache\d3d8.dll" "$g_strSysWow64\dllcache\msd3d8.dll" "Microsoft Corporation" "x86"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll" "$g_strSysWow64\dllcache\msd3d9.dll" "Microsoft Corporation" "x86"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSysWow64\dllcache\d3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSysWow64\dllcache\d3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${Else}
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "DLL cache does not exist, skipping"
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${EndIf}
6208fac57be110a1d341a36c75b362907b82d280vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ;
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ; Update original DLLs
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync ;
7f885f0672b805f94731e4b10ca8bdfaa2ba0e74vboxsync
2859546be945ab432d6b26306e233d969b1149bavboxsync ; Save original DLLs (only if msd3d*.dll does not exist) ...
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSysWow64\d3d8.dll" "$g_strSysWow64\msd3d8.dll" "Microsoft Corporation" "x86"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${CopyFileEx} "" "$g_strSysWow64\d3d9.dll" "$g_strSysWow64\msd3d9.dll" "Microsoft Corporation" "x86"
78a072e1b56619e3230735ae073668311232ec94vboxsync
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Push "$g_strSysWow64\d3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Push "$g_strSysWow64\d3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync
6208fac57be110a1d341a36c75b362907b82d280vboxsync!endif ; amd64
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto done
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncerror:
78a072e1b56619e3230735ae073668311232ec94vboxsync ; @todo
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto exit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncdone:
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync!ifndef WFP_FILE_EXCEPTION
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_WFP_WARN_REPLACE) /SD IDOK
b0c4bd49112a99f00ef48b7a8eae6fb310a62bdavboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto exit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync!ifdef USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync ;Assign language strings to sections
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(VBOX_COMPONENT_MAIN_DESC)
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(VBOX_COMPONENT_AUTOLOGON_DESC)
08c4185261c17943cff6cc94522579696eeeb478vboxsync !if $%VBOX_WITH_CROGL% == "1"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(VBOX_COMPONENT_D3D_DESC)
08c4185261c17943cff6cc94522579696eeeb478vboxsync !endif
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_FUNCTION_DESCRIPTION_END
08c4185261c17943cff6cc94522579696eeeb478vboxsync!endif ; USE_MUI
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection -Content
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection -StartMenu
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
78a072e1b56619e3230735ae073668311232ec94vboxsync CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" "" "$INSTDIR\iexplore.ico"
78a072e1b56619e3230735ae073668311232ec94vboxsync CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; This section is called after all the files are in place
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection -Post
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef _DEBUG
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Doing post install ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef EXTERNAL_UNINSTALLER
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_TARGET%\uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync!else
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteUninstaller "$INSTDIR\uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Write uninstaller in "Add / Remove programs"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Tune TcpWindowSize for a better network throughput
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" "TcpWindowSize" 64240
78a072e1b56619e3230735ae073668311232ec94vboxsync
0c3fa0ccafe7a55e721a116c26a607bd3dee0b6evboxsync ; Add Sun Ray client info keys
5ca25c53abdd6b94190e21a09e31269894fc01c5vboxsync ; Note: We only need 32-bit keys (HKLM\Software / HKLM\Software\Wow6432Node)
5ca25c53abdd6b94190e21a09e31269894fc01c5vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
5ca25c53abdd6b94190e21a09e31269894fc01c5vboxsync WriteRegStr HKLM "SOFTWARE\Wow6432Node\Oracle\Sun Ray\ClientInfoAgent\ReconnectActions" "" ""
5ca25c53abdd6b94190e21a09e31269894fc01c5vboxsync WriteRegStr HKLM "SOFTWARE\Wow6432Node\Oracle\Sun Ray\ClientInfoAgent\DisconnectActions" "" ""
5ca25c53abdd6b94190e21a09e31269894fc01c5vboxsync!else
0c3fa0ccafe7a55e721a116c26a607bd3dee0b6evboxsync WriteRegStr HKLM "SOFTWARE\Oracle\Sun Ray\ClientInfoAgent\ReconnectActions" "" ""
0c3fa0ccafe7a55e721a116c26a607bd3dee0b6evboxsync WriteRegStr HKLM "SOFTWARE\Oracle\Sun Ray\ClientInfoAgent\DisconnectActions" "" ""
5ca25c53abdd6b94190e21a09e31269894fc01c5vboxsync!endif
0c3fa0ccafe7a55e721a116c26a607bd3dee0b6evboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Installation completed."
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync; !!! NOTE: This function *has* to be right under the last section; otherwise it does
08c4185261c17943cff6cc94522579696eeeb478vboxsync; *not* get called! Don't ask me why ... !!!
08c4185261c17943cff6cc94522579696eeeb478vboxsyncFunction .onSelChange
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync Push $0
08c4185261c17943cff6cc94522579696eeeb478vboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; Handle selection of D3D component
08c4185261c17943cff6cc94522579696eeeb478vboxsync SectionGetFlags ${SEC03} $0
08c4185261c17943cff6cc94522579696eeeb478vboxsync ${If} $0 == ${SF_SELECTED}
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync StrCpy $g_bWithD3D "true"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync
b9efdf4f2f5a547f76dc2e254656d83cab80ce73vboxsync!if $%VBOX_WITH_WDDM% == "1"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync ; If we're able to use the WDDM driver just use it instead of the replaced
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync ; D3D components below
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync ${If} $g_bCapWDDM == "true"
84ac4fe6468b328aadfe9994176e00504338a47avboxsync ;
84ac4fe6468b328aadfe9994176e00504338a47avboxsync ; Temporary solution: Since WDDM is marked as experimental yet we notify the user
84ac4fe6468b328aadfe9994176e00504338a47avboxsync ; that WDDM (Aero) support is available but not recommended for production use. He now
84ac4fe6468b328aadfe9994176e00504338a47avboxsync ; can opt-in for installing WDDM or still go for the old (XPDM) way -- safe mode still required!
84ac4fe6468b328aadfe9994176e00504338a47avboxsync ;
84ac4fe6468b328aadfe9994176e00504338a47avboxsync MessageBox MB_ICONQUESTION|MB_YESNO $(VBOX_COMPONENT_D3D_OR_WDDM) /SD IDNO IDYES d3d_install
b711a01730152421a900e5f4e237cfb848c9c4fdvboxsync ; Display an unconditional hint about needed VRAM sizes
10b0a25d6ecfb29654983229f431be0a5cfbff77vboxsync ; Note: We also could use the PCI configuration space (WMI: Win32_SystemSlot Class) for querying
10b0a25d6ecfb29654983229f431be0a5cfbff77vboxsync ; the current VRAM size, but let's keep it simple for now
10b0a25d6ecfb29654983229f431be0a5cfbff77vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_HINT_VRAM) /SD IDOK
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync StrCpy $g_bWithWDDM "true"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync Goto exit
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${EndIf}
84ac4fe6468b328aadfe9994176e00504338a47avboxsync
84ac4fe6468b328aadfe9994176e00504338a47avboxsyncd3d_install:
84ac4fe6468b328aadfe9994176e00504338a47avboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!endif ; $%VBOX_WITH_WDDM% == "1"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${If} $g_bForceInstall != "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; Do not install on < XP
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${If} $g_strWinVersion == "NT4"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${OrIf} $g_strWinVersion == "2000"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${OrIf} $g_strWinVersion == ""
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_NOT_SUPPORTED) /SD IDOK
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Goto d3d_disable
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsync ${EndIf}
08c4185261c17943cff6cc94522579696eeeb478vboxsync ${EndIf}
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync ; If force flag is set skip the safe mode check
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync ${If} $g_bForceInstall != "true"
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync ; If we're not in safe mode, print a warning and don't install D3D support
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync ${If} $g_iSystemMode == '0'
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_NO_SM) /SD IDOK
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync Goto d3d_disable
b9c1c047d827938b96c8c148c855cbe7f304e5f7vboxsync ${EndIf}
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${EndIf}
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync
e1273e247f21b61fae280d2aa95a7f4a0850bb46vboxsync ${Else} ; D3D unselected again
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync ${If} $g_strWinVersion != "8" ; On Windows 8 WDDM is mandatory
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync StrCpy $g_bWithWDDM "false"
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync ${EndIf}
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync ${EndIf}
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Goto exit
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncd3d_disable:
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync StrCpy $g_bWithD3D "false"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync IntOp $0 $0 & ${SECTION_OFF} ; Unselect section again
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync SectionSetFlags ${SEC03} $0
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Goto exit
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncexit:
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync Pop $0
08c4185261c17943cff6cc94522579696eeeb478vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsyncFunctionEnd
08c4185261c17943cff6cc94522579696eeeb478vboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync; This function is called when a critical error occurred, caused by
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync; the Abort command
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction .onInstFailed
78a072e1b56619e3230735ae073668311232ec94vboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${LogVerbose} "$(VBOX_ERROR_INST_FAILED)"
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_ERROR_INST_FAILED) /SD IDOK
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${If} $g_bPostInstallStatus == "true"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogToVBoxTray} "2" "Error while installing ${PRODUCT_NAME}!"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${EndIf}
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ; Set overall exit code
78a072e1b56619e3230735ae073668311232ec94vboxsync SetErrorLevel 1
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; This function is called when installation was successful!
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction .onInstSuccess
78a072e1b56619e3230735ae073668311232ec94vboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${LogVerbose} "${PRODUCT_NAME} successfully installed"
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${If} $g_bPostInstallStatus == "true"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogToVBoxTray} "0" "${PRODUCT_NAME} successfully updated!"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync SetErrorLevel 0
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; This function is called at the very beginning of installer execution
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction .onInit
78a072e1b56619e3230735ae073668311232ec94vboxsync
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync Push $0
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Init values
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iSystemMode "0"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCpy $g_strCurUser "<None>"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerMaj "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerMin "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerBuild "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerRev "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync
ae072e31d733f2a7c9cb1b2b4c4901b66197aadavboxsync StrCpy $g_bIgnoreUnknownOpts "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bLogEnable "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bFakeWHQL "false"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCpy $g_bForceInstall "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bUninstall "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bRebootOnExit "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenX "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenY "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenBpp "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iSfOrder "0"
34aa2e97a2a6d7c3c0a5be5121edfd51a31281acvboxsync StrCpy $g_bNoVBoxServiceExit "false"
156101683587682f6d63b4af322f611d90b77fcevboxsync StrCpy $g_bNoVBoxTrayExit "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVideoDrv "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoGuestDrv "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoMouseDrv "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithAutoLogon "false"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync StrCpy $g_bWithVBoxMMR "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithD3D "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bOnlyExtract "false"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync StrCpy $g_bWithWDDM "false"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync StrCpy $g_bCapDllCache "false"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync StrCpy $g_bCapWDDM "false"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync StrCpy $g_bPostInstallStatus "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; We need a special directory set to SysWOW64 because some
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; shell operations don't support file redirection (yet)
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCpy $g_strSysWow64 "$WINDIR\SysWOW64"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync SetErrorLevel 0
78a072e1b56619e3230735ae073668311232ec94vboxsync ClearErrors
78a072e1b56619e3230735ae073668311232ec94vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync!ifdef UNINSTALLER_ONLY
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ;
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; If UNINSTALLER_ONLY is defined, we're only interested in uninst.exe
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; so we can sign it
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ;
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Note that the Quit causes the exit status to be 2 instead of 0
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ;
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync WriteUninstaller "$%PATH_TARGET%\uninst.exe"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Quit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync!else
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Handle command line
78a072e1b56619e3230735ae073668311232ec94vboxsync Call HandleCommandLine
78a072e1b56619e3230735ae073668311232ec94vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Check if there's already another instance of the installer is running -
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; important for preventing NT4 to spawn the installer twice
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync System::Call 'kernel32::CreateMutexA(i 0, i 0, t "VBoxGuestInstaller") ?e'
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Pop $0
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $0 != 0
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Quit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Retrieve Windows version and store result in $g_strWinVersion
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync Call GetWindowsVersionEx
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync Pop $g_strWinVersion
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync
e00eab7d3ce02ece76f3928b4f1c84bb0368e377vboxsync ; Retrieve capabilities
e00eab7d3ce02ece76f3928b4f1c84bb0368e377vboxsync Call CheckForCapabilities
e00eab7d3ce02ece76f3928b4f1c84bb0368e377vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Get user Name
78a072e1b56619e3230735ae073668311232ec94vboxsync AccessControl::GetCurrentUserName
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $g_strCurUser
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${LogVerbose} "Current user: $g_strCurUser"
78a072e1b56619e3230735ae073668311232ec94vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Only extract files? This action can be called even from non-Admin users
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; and non-compatible architectures
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $g_bOnlyExtract == "true"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Call ExtractFiles
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync MessageBox MB_OK|MB_ICONINFORMATION $(VBOX_EXTRACTION_COMPLETE) /SD IDOK
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Quit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Check for correct architecture
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Call CheckArchitecture
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Pop $0
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $0 <> 0 ; Wrong architecture? Tell the world
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_AMD64) /SD IDOK
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync!else
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_X86) /SD IDOK
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync!endif
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync Abort "$(VBOX_NOTICE_ARCH_AMD64)"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Has the user who calls us admin rights?
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync UserInfo::GetAccountType
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Pop $0
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $0 != "Admin"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync MessageBox MB_ICONSTOP $(VBOX_NOADMIN) /SD IDOK
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Abort
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Only uninstall?
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $g_bUninstall == "true"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Call Uninstall_Innotek
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Call Uninstall
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_UNINST_SUCCESS) /SD IDOK
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Quit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call CheckForInstalledComponents
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Set section bits
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_bWithAutoLogon == "true" ; Auto-logon support
c7c6718a3ec95ca32bf4f2e5311b871e95c3b195vboxsync !insertmacro SelectSection ${SEC02}
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%VBOX_WITH_CROGL% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_bWithD3D == "true" ; D3D support
c7c6718a3ec95ca32bf4f2e5311b871e95c3b195vboxsync !insertmacro SelectSection ${SEC03}
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync ; On Windows 8 we always select the 3D section and
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync ; disable it so that it cannot be deselected again
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync ${If} $g_strWinVersion == "8"
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync IntOp $0 ${SF_SELECTED} | ${SF_RO}
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync SectionSetFlags ${SEC03} $0
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
08c4185261c17943cff6cc94522579696eeeb478vboxsync!ifdef USE_MUI
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Display language selection dialog (will be hidden in silent mode!)
78a072e1b56619e3230735ae073668311232ec94vboxsync !ifdef VBOX_INSTALLER_ADD_LANGUAGES
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro MUI_LANGDLL_DISPLAY
78a072e1b56619e3230735ae073668311232ec94vboxsync !endif
08c4185261c17943cff6cc94522579696eeeb478vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call SetAppMode64
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for old additions
78a072e1b56619e3230735ae073668311232ec94vboxsync Call CheckForOldGuestAdditions
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetAdditionsVersion
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Due to some bug in NSIS the license page won't be displayed if we're in
78a072e1b56619e3230735ae073668311232ec94vboxsync ; 64-bit registry view, so as a workaround switch back to 32-bit (Wow6432Node)
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; mode for now
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call SetAppMode32
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif ; UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync Pop $0
142b664dbe3b1246e0156eb657a1c858d92fdd0dvboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; The uninstaller is built separately when doing code signing
78a072e1b56619e3230735ae073668311232ec94vboxsync; For some reason NSIS still finds the Uninstall section even
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync; when EXTERNAL_UNINSTALLER is defined. This causes a silly warning
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifndef EXTERNAL_UNINSTALLER
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction un.onUninstSuccess
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync HideWindow
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_UNINST_SUCCESS) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction un.onInit
78a072e1b56619e3230735ae073668311232ec94vboxsync
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Has the user who calls us admin rights?
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync UserInfo::GetAccountType
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Pop $0
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $0 != "Admin"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync MessageBox MB_ICONSTOP $(VBOX_NOADMIN) /SD IDOK
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Abort
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${EndIf}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(VBOX_UNINST_CONFIRM) /SD IDYES IDYES proceed
78a072e1b56619e3230735ae073668311232ec94vboxsync Quit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncproceed:
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call un.SetAppMode64
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; Set system directory
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strSystemDir "$SYSDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync
7eff7a99cc12167a92df5ca1498fbbfeec3d0010vboxsync ; We need a special directory set to SysWOW64 because some
7eff7a99cc12167a92df5ca1498fbbfeec3d0010vboxsync ; shell operations don't support file redirection (yet)
7eff7a99cc12167a92df5ca1498fbbfeec3d0010vboxsync StrCpy $g_strSysWow64 "$WINDIR\SysWOW64"
7eff7a99cc12167a92df5ca1498fbbfeec3d0010vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Retrieve Windows version we're running on and store it in $g_strWinVersion
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync Call un.GetWindowsVersionEx
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync Pop $g_strWinVersion
78a072e1b56619e3230735ae073668311232ec94vboxsync
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync ; Retrieve capabilities
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync Call un.CheckForCapabilities
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunctionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection Uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef _DEBUG
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogEnable} "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call un.SetAppMode64
78a072e1b56619e3230735ae073668311232ec94vboxsync
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync ; Call the uninstall main function
78a072e1b56619e3230735ae073668311232ec94vboxsync Call un.Uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync ; ... and remove the local install directory
78a072e1b56619e3230735ae073668311232ec94vboxsync Call un.UninstallInstDir
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifndef _DEBUG
78a072e1b56619e3230735ae073668311232ec94vboxsync SetAutoClose true
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(VBOX_REBOOT_REQUIRED) /SD IDNO IDYES restart
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $g_bRebootOnExit "true" restart
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto exit
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncrestart:
78a072e1b56619e3230735ae073668311232ec94vboxsync
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ${LogVerbose} "Rebooting ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync Reboot
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit:
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncSectionEnd
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; !EXTERNAL_UNINSTALLER
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;Direct the output to our bin dir
78a072e1b56619e3230735ae073668311232ec94vboxsync!cd "$%PATH_OUT%\bin\additions"