VBoxGuestAdditions.nsi revision 36dd9dabf3f64468206cb74145b51245cf7fde54
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync; VBoxGuestAdditions.nsi - Main file for Windows Guest Additions installation.
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync; Copyright (C) 2011 Oracle Corporation
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.
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!if $%BUILD_TYPE% == "debug"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !define _DEBUG ; Turn this on to get extra output
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!ifdef _DEBUG
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Scratch directory for plugin tests
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !addincludedir .\PluginTest
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !addplugindir .\PluginTest
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync; Defines for special functions
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define WHQL_FAKE ; Enables faking of non WHQL signed / approved drivers
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Needs the VBoxWHQLFake.exe in the additions output directory!
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define WFP_FILE_EXCEPTION ; Enables setting a temporary file exception for WFP proctected files
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define VENDOR_ROOT_KEY "SOFTWARE\$%VBOX_VENDOR_SHORT%"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync; Product defines
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define PRODUCT_NAME "$%VBOX_PRODUCT% Guest Additions"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define PRODUCT_DESC "$%VBOX_PRODUCT% Guest Additions"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define PRODUCT_VERSION "$%VBOX_VERSION_MAJOR%.$%VBOX_VERSION_MINOR%.$%VBOX_VERSION_BUILD%.0"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!define PRODUCT_PUBLISHER "$%VBOX_VENDOR%"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_COPYRIGHT "(C) $%VBOX_C_YEAR% $%VBOX_VENDOR%"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_OUTPUT "VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_WEB_SITE "http://www.virtualbox.org"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_INSTALL_KEY "${VENDOR_ROOT_KEY}\VirtualBox Guest Additions"
cc260ed3418d1fd2771d0395f818f76808b60238vboxsync!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_UNINST_ROOT_KEY "HKLM"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define LICENSE_FILE_RTF "license.rtf"
94c538a65fbdfa1ea06f4fe0a65599c1ab0fed58vboxsync; Needed for InstallLib macro: Install libraries in every case
94c538a65fbdfa1ea06f4fe0a65599c1ab0fed58vboxsync!define LIBRARY_IGNORE_VERSION
94c538a65fbdfa1ea06f4fe0a65599c1ab0fed58vboxsyncVIProductVersion "${PRODUCT_VERSION}"
d5d45608052fd506e4114bf112df6efae7fcd8a7vboxsyncVIAddVersionKey "FileVersion" "$%VBOX_VERSION_STRING%"
d5d45608052fd506e4114bf112df6efae7fcd8a7vboxsyncVIAddVersionKey "ProductName" "${PRODUCT_NAME}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "CompanyName" "${PRODUCT_PUBLISHER}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "FileDescription" "${PRODUCT_DESC}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "LegalCopyright" "${PRODUCT_COPYRIGHT}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "InternalName" "${PRODUCT_OUTPUT}"
78a072e1b56619e3230735ae073668311232ec94vboxsync; This registry key will hold the mouse driver path before install (NT4 only)
78a072e1b56619e3230735ae073668311232ec94vboxsync!define ORG_MOUSE_PATH "MousePath"
78a072e1b56619e3230735ae073668311232ec94vboxsync; If we have our guest install helper DLL, add the
78a072e1b56619e3230735ae073668311232ec94vboxsync; plugin path so that NSIS can find it when compiling the installer
78a072e1b56619e3230735ae073668311232ec94vboxsync; Note: NSIS plugins *always* have to be compiled in 32-bit!
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsync !addplugindir "$%PATH_TARGET_X86%\VBoxGuestInstallHelper"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro GetParameters
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync !insertmacro GetOptions
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync !insertmacro WordFind
2d86fd6bcfe35a4bb83bb8a4fe68090693cdce95vboxsync !insertmacro StrFilter
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 "dumplog.nsh" ; Dump log to file function
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync; Set Modern UI (MUI) as default
78a072e1b56619e3230735ae073668311232ec94vboxsync!define USE_MUI
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef USE_MUI
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Use modern UI, version 2
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; MUI Settings
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync !define MUI_WELCOMEFINISHPAGE_BITMAP "$%VBOX_BRAND_WIN_ADD_INST_DLGBMP%"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_ABORTWARNING
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync !define MUI_WELCOMEPAGE_TITLE_3LINES "Welcome to the ${PRODUCT_NAME} Additions Setup"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; API defines
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define SM_CLEANBOOT 67
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_ICON "$%VBOX_NSIS_ICON_FILE%"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_UNICON "$%VBOX_NSIS_ICON_FILE%"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !else ; 64-bit
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_ICON "$%VBOX_WINDOWS_ADDITIONS_ICON_FILE%"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_UNICON "$%VBOX_WINDOWS_ADDITIONS_ICON_FILE%"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; Welcome page
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_PAGE_WELCOME
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync!ifdef VBOX_WITH_LICENSE_DISPLAY
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; License page
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_PAGE_LICENSE "$(VBOX_LICENSE)"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_LICENSEPAGE_RADIOBUTTONS
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; Directory page
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_PAGE_DIRECTORY
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; Components Page
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_PAGE_COMPONENTS
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; Instfiles page
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_PAGE_INSTFILES
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !ifndef _DEBUG
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !define MUI_FINISHPAGE_TITLE_3LINES ; Have a bit more vertical space for text
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_PAGE_FINISH ; Only show in release mode - useful information for debugging!
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; Uninstaller pages
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync !insertmacro MUI_UNPAGE_INSTFILES
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; Define languages we will use
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync !insertmacro MUI_LANGUAGE "English"
223a6730e81629b0bf552ccc31f119a998cc8e27vboxsync !insertmacro MUI_LANGUAGE "French"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync !insertmacro MUI_LANGUAGE "German"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync ; Set branding text which appears on the horizontal line at the bottom
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync!ifdef _DEBUG
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING% (r$%VBOX_SVN_REV%) - Debug Build"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING%"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync!ifdef VBOX_WITH_LICENSE_DISPLAY
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync ; Set license language
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync LicenseLangString VBOX_LICENSE ${LANG_ENGLISH} "$%VBOX_BRAND_LICENSE_RTF%"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync ; If license files not available (OSE / PUEL) build, then use the English one as default
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync !ifdef VBOX_BRAND_fr_FR_LICENSE_RTF
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_fr_FR_LICENSE_RTF%"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_LICENSE_RTF%"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync !ifdef VBOX_BRAND_de_DE_LICENSE_RTF
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_de_DE_LICENSE_RTF%"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_LICENSE_RTF%"
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync !insertmacro MUI_RESERVEFILE_LANGDLL
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync!else ; !USE_MUI
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync!ifdef VBOX_WITH_LICENSE_DISPLAY
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync Page license
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync Page components
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync Page directory
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync Page instfiles
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync; Language files
6804e4c1c12ab612ad6257a4922309c476c204e5vboxsync!include "Languages\English.nsh"
223a6730e81629b0bf552ccc31f119a998cc8e27vboxsync!include "Languages\French.nsh"
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync!include "Languages\German.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync; Variables and output files
78a072e1b56619e3230735ae073668311232ec94vboxsyncName "${PRODUCT_NAME} $%VBOX_VERSION_STRING%"
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync !echo "Uninstaller only!"
78a072e1b56619e3230735ae073668311232ec94vboxsync OutFile "$%PATH_TARGET%\VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%-uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync OutFile "VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif ; UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync; 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"
78a072e1b56619e3230735ae073668311232ec94vboxsyncInstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
78a072e1b56619e3230735ae073668311232ec94vboxsyncShowInstDetails show
78a072e1b56619e3230735ae073668311232ec94vboxsyncShowUnInstDetails show
78a072e1b56619e3230735ae073668311232ec94vboxsyncRequestExecutionLevel highest
78a072e1b56619e3230735ae073668311232ec94vboxsync; Internal parameters
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_iSystemMode ; Current system mode (0 = Normal boot, 1 = Fail-safe boot, 2 = Fail-safe with network boot)
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strSystemDir ; Windows system directory
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strCurUser ; Current user using the system
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strAddVerMaj ; Installed Guest Additions: Major version
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strAddVerMin ; Installed Guest Additions: Minor version
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strAddVerBuild ; Installed Guest Additions: Build number
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strAddVerRev ; Installed Guest Additions: SVN revision
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_strWinVersion ; Current Windows version we're running on
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bLogEnable ; Do logging when installing? "true" or "false"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bWithWDDM ; Install the WDDM driver instead of the XPDM one
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bCapWDDM ; Capability: Is the guest able to handle/use our WDDM driver?
78a072e1b56619e3230735ae073668311232ec94vboxsync; Command line parameters - these can be set/modified
78a072e1b56619e3230735ae073668311232ec94vboxsync; on the command line
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bFakeWHQL ; Cmd line: Fake Windows to install non WHQL certificated drivers (only for W2K and XP currently!!) ("/unsig_drv")
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bForceInstall ; Cmd line: Force installation on unknown Windows OS version
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bUninstall ; Cmd line: Just uninstall any previous Guest Additions and exit
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bRebootOnExit ; Cmd line: Auto-Reboot on successful installation. Good for unattended installations ("/reboot")
1637773d6c473e4ab75812805ef00226f3a397c0vboxsyncVar g_iScreenBpp ; Cmd line: Screen depth ("/depth=X")
1637773d6c473e4ab75812805ef00226f3a397c0vboxsyncVar g_iScreenX ; Cmd line: Screen resolution X ("/resx=X")
1637773d6c473e4ab75812805ef00226f3a397c0vboxsyncVar g_iScreenY ; Cmd line: Screen resolution Y ("/resy=Y")
1637773d6c473e4ab75812805ef00226f3a397c0vboxsyncVar g_iSfOrder ; Cmd line: Order of Shared Folders network provider (0=first, 1=second, ...)
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bIgnoreUnknownOpts ; Cmd line: Ignore unknown options (don't display the help)
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bNoVBoxServiceExit ; Cmd line: Do not quit VBoxService before updating - install on next reboot
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bNoVBoxTrayExit ; Cmd line: Do not quit VBoxTray before updating - install on next reboot
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bNoVideoDrv ; Cmd line: Do not install the VBoxVideo driver
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bNoGuestDrv ; Cmd line: Do not install the VBoxGuest driver
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bNoMouseDrv ; Cmd line: Do not install the VBoxMouse driver
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bWithAutoLogon ; Cmd line: Install VBoxGINA / VBoxCredProv for auto logon support
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bWithD3D ; Cmd line: Install Direct3D support
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_bOnlyExtract ; Cmd line: Only extract all files, do *not* install them. Only valid with param "/D" (target directory)
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsyncVar g_bPostInstallStatus ; Cmd line: Post the overall installation status to some external program (VBoxTray)
78a072e1b56619e3230735ae073668311232ec94vboxsync; Platform parts of this installer
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit only
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsUninstall.nsh" ; Product uninstallation
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "VBoxGuestAdditionsUninstallOld.nsh" ; Uninstallation of deprecated versions which must be removed first
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction HandleCommandLine
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Push $0 ; Command line (without process name)
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Push $1 ; Number of parameters
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Push $2 ; Current parameter index
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Push $3 ; Current parameter pair (name=value)
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Push $4 ; Current parameter name
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync Push $5 ; Current parameter value (if present)
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCpy $1 "0" ; Init param counter
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCpy $2 "1" ; Init current param counter
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${GetParameters} $0 ; Extract command line
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $0 == "" ; If no parameters at all exit
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Enable for debugging
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ;MessageBox MB_OK "CmdLine: $0"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${WordFind} $0 " " "#" $1 ; Get number of parameters in cmd line
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${If} $0 == $1 ; If result matches the input then
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync StrCpy $1 "1" ; no delimiter was found. Correct to 1 word total
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${While} $2 <= $1 ; Loop through all params
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${WordFind} $0 " " "+$2" $3 ; Get current name=value pair
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${WordFind} $3 "=" "+1" $4 ; Get current param name
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ${WordFind} $3 "=" "+2" $5 ; Get current param value
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${StrFilter} $4 "-" "" "" $4 ; Transfer param name to lowercase
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ; Enable for debugging
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ;MessageBox MB_OK "#$2 of #$1, param='$3', name=$4, val=$5"
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Switch} $4
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/d' ; NSIS: /D=<instdir> switch, skip
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/depth'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'depth'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync StrCpy $g_iScreenBpp $5
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/extract'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bOnlyExtract "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/force'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync StrCpy $g_bForceInstall "true"
fbc860f415bc1aa9082e93bf5ff1c6b8b9ddf20dvboxsync ${Case} '/help'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/H'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/h'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/?'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/ignore_unknownopts' ; Not officially documented
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync StrCpy $g_bIgnoreUnknownOpts "true"
fbc860f415bc1aa9082e93bf5ff1c6b8b9ddf20dvboxsync ${Case} '/l'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/log'
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/logging'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bLogEnable "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/ncrc' ; NSIS: /NCRC switch, skip
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${Case} '/no_vboxservice_exit' ; Not officially documented
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync StrCpy $g_bNoVBoxServiceExit "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_vboxtray_exit' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVBoxTrayExit "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_videodrv' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVideoDrv "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_guestdrv' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoGuestDrv "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_mousedrv' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoMouseDrv "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; This switch tells our installer that it
78a072e1b56619e3230735ae073668311232ec94vboxsync ; - should not quit VBoxTray during the update, because ...
78a072e1b56619e3230735ae073668311232ec94vboxsync ; - ... it should show the overall installation status
78a072e1b56619e3230735ae073668311232ec94vboxsync ; using VBoxTray's balloon message feature (since VBox 4.0)
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/post_installstatus' ; Not officially documented
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVBoxTrayExit "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bPostInstallStatus "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/reboot'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bRebootOnExit "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/s' ; NSIS: /S switch, skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/sforder'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'sforder'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iSfOrder $5
78a072e1b56619e3230735ae073668311232ec94vboxsync !ifdef WHQL_FAKE
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/unsig_drv'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bFakeWHQL "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/uninstall'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bUninstall "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/with_autologon'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithAutoLogon "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync !if $%VBOX_WITH_CROGL% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/with_d3d'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/with_direct3d'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithD3D "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/xres'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'xres'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenX $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/yres'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'yres'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenY $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Default} ; Unknown parameter, print usage message
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Prevent popping up usage message on (yet) unknown parameters
78a072e1b56619e3230735ae073668311232ec94vboxsync ; in silent mode, just skip
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync IfSilent 0 +2
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${EndSwitch}
78a072e1b56619e3230735ae073668311232ec94vboxsync IntOp $2 $2 + 1
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndWhile}
78a072e1b56619e3230735ae073668311232ec94vboxsync ; If we were told to ignore unknown (invalid) options, just return to
78a072e1b56619e3230735ae073668311232ec94vboxsync ; the parsing loop ...
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_bIgnoreUnknownOpts == "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto next_param
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 \
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync Options:$\r$\n \
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync /depth=BPP$\tSets the guest's display color depth (bits per pixel)$\r$\n \
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync /extract$\t$\tOnly extract installation files$\r$\n \
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync /force$\t$\tForce installation on unknown/undetected Windows versions$\r$\n \
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync /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 \
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 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 Note: Order of options and installer parameters are mandatory." /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync ; No stack restore needed, we're about to quit
78a072e1b56619e3230735ae073668311232ec94vboxsync IfSilent 0 +2
78a072e1b56619e3230735ae073668311232ec94vboxsync LogText "Installer is in silent mode!"
78a072e1b56619e3230735ae073668311232ec94vboxsync LogText "Property: XRes: $g_iScreenX"
78a072e1b56619e3230735ae073668311232ec94vboxsync LogText "Property: YRes: $g_iScreenY"
78a072e1b56619e3230735ae073668311232ec94vboxsync LogText "Property: BPP: $g_iScreenBpp"
78a072e1b56619e3230735ae073668311232ec94vboxsync LogText "Property: Logging enabled: $g_bLogEnable"
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction CheckForOldGuestAdditions
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for old "Sun VirtualBox Guest Additions"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; - before rebranding to Oracle
78a072e1b56619e3230735ae073668311232ec94vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync StrCmp $0 "" sun_xvm_check ; If string is empty, Sun additions are probably not installed (anymore)
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_uninstall:
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync Call Uninstall_Sun
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync Goto success
2a7322928382e52db8e320d19df4f03dee16b3edvboxsyncsun_xvm_check:
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ; Check for old "Sun xVM VirtualBox Guest Additions"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ; - before getting rid of the "xVM" namespace
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync StrCmp $0 "" innotek_check ; If string is empty, Sun xVM additions are probably not installed (anymore)
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_xvm_uninstall
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
2a7322928382e52db8e320d19df4f03dee16b3edvboxsyncsun_xvm_uninstall:
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync Call Uninstall_SunXVM
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync Goto success
2a7322928382e52db8e320d19df4f03dee16b3edvboxsyncinnotek_check:
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ; Check for old "innotek" Guest Additions" before rebranding to "Sun"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync StrCmp $0 "" exit ; If string is empty, innotek Guest Additions are probably not installed (anymore)
2a7322928382e52db8e320d19df4f03dee16b3edvboxsync MessageBox MB_YESNO $(VBOX_INNOTEK_FOUND) /SD IDYES IDYES innotek_uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_INNOTEK_ABORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsyncinnotek_uninstall:
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_Innotek
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto success
59bb2da0ef97dc8c9d0821ac921728f515623ac5vboxsync ; Nothing to do here yet
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsyncFunction CheckForInstalledComponents
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync DetailPrint "Checking for installed components ..."
36dd9dabf3f64468206cb74145b51245cf7fde54vboxsync Call SetAppMode64
fca81330c993457cc8047a46eec3d09b8e38da90vboxsync ; VBoxGINA already installed? So we need to update the installed version as well,
67927207a2d6bb545eb655ef14cdb090b1957120vboxsync ; regardless whether the user used "/with_autologon" or not
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync ${If} $0 == "VBoxGINA.dll"
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync DetailPrint "Found already installed auto-logon support ..."
e3197fda68ad1e45cc3004f5b58a326a5270aa8fvboxsync StrCpy $g_bWithAutoLogon "true"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsyncFunction Common_CopyFiles
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync SetOutPath "$INSTDIR"
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync SetOverwrite on
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync!ifdef VBOX_WITH_LICENSE_INSTALL_RTF
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync ; Copy license file (if any) into the installation directory
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync FILE "/oname=${LICENSE_FILE_RTF}" "$%VBOX_BRAND_LICENSE_RTF%"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync!ifdef VBOX_SIGN_ADDITIONS
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsync; Main Files
f06e830c9fdbc3d9e89867d4429404c5446bc513vboxsyncSection $(VBOX_COMPONENT_MAIN) SEC01
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync SectionIn RO ; Section cannot be unselected (read-only)
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync Push "${PRODUCT_NAME} update started, please wait ..."
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync Push 0 ; Message type = info
3f6d4775faa373634b2f3fc2a90fc517733f6fd6vboxsync Call WriteLogVBoxTray
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync SetOutPath "$INSTDIR"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync SetOverwrite on
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call SetAppMode64
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync StrCpy $g_strSystemDir "$SYSDIR"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync Call EnableLog
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync ${If} $g_strAddVerMaj != ""
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "No previous version of ${PRODUCT_NAME} detected."
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "Detected OS: Windows $g_strWinVersion (64-bit)"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "Detected OS: Windows $g_strWinVersion (32-bit)"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "System Directory: $g_strSystemDir"
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync!ifdef _DEBUG
40fa6228bd9ab763bc67b51fe6290802e954eb8cvboxsync DetailPrint "Debug!"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Which OS are we using?
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "XP" w2k ; Windows XP
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "7" vista ; Windows 7
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCmp $g_strWinVersion "8" vista ; Windows 8
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${If} $g_bForceInstall == "true"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Goto vista ; Assume newer OS than we know of ...
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Goto notsupported
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncnt4: ; Windows NT4
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call GetServicePack
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Pop $R0 ; Major version
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Pop $R1 ; Minor version
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; At least Service Pack 6 installed?
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${If} $R0 <> "6"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync MessageBox MB_YESNO $(VBOX_NT4_NO_SP6) /SD IDYES IDYES +2
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Copy some common files ...
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call Common_CopyFiles
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call NT4_Main
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync goto success
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncvista: ; Windows Vista / Windows 7
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Copy some common files ...
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call Common_CopyFiles
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call W2K_Main ; First install stuff from Windows 2000 / XP
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call Vista_Main ; ... and some specific stuff for Vista / Windows 7
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync goto success
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncw2k: ; Windows 2000 and XP ...
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Copy some common files ...
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call Common_CopyFiles
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call W2K_Main
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync goto success
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncnotsupported:
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Write a registry key with version and installation path for later lookup
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Version" "$%VBOX_VERSION_STRING_RAW%"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "VersionExt" "$%VBOX_VERSION_STRING%"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Revision" "$%VBOX_SVN_REV%"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "InstallDir" "$INSTDIR"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Set the reboot flag to tell the finish page that is should
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; default to the "reboot now" entry
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync SetRebootFlag true
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call WriteLogUI
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync; Auto-logon support (section is hidden at the moment -- only can be enabled via command line switch)
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncSection /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call SetAppMode64
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call GetWindowsVersion
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Pop $R0 ; Windows Version
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync DetailPrint "Installing auto-logon support ..."
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Another GINA already is installed? Check if this is ours, otherwise let the user decide (unless it's a silent setup)
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; whether to replace it with the VirtualBox one or not
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${If} $0 != ""
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${If} $0 != "VBoxGINA.dll"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1 $(VBOX_COMPONENT_AUTOLOGON_WARN_3RDPARTY) /SD IDYES IDYES install
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Do we need VBoxCredProv or VBoxGINA?
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${If} $R0 == 'Vista' ; Use VBoxCredProv on newer Windows OSes (>= Vista)
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${OrIf} $R0 == '7'
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxCredProv.dll" "$g_strSystemDir\VBoxCredProv.dll" "$INSTDIR"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (default) key
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (Default) key
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "" "VBoxCredProv.dll" ; adding to (Default) key
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "ThreadingModel" "Apartment"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${Else} ; Use VBoxGINA on older Windows OSes (< Vista)
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxGINA.dll" "$g_strSystemDir\VBoxGINA.dll" "$INSTDIR"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" "VBoxGINA.dll"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ; Nothing to do here right now
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync; Prepares the access rights for replacing a WRP protected file
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncFunction PrepareWRPFile
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync IfFileExists "$g_strSystemDir\takeown.exe" 0 +2
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync nsExec::ExecToLog '"$g_strSystemDir\takeown.exe" /F "$0"'
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync AccessControl::SetFileOwner "$0" "(S-1-5-32-545)"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync DetailPrint "Setting file owner for '$0': $1"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync DetailPrint "Setting access rights for '$0': $1"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync !ifdef WFP_FILE_EXCEPTION
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync VBoxGuestInstallHelper::DisableWFP "$0"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Pop $1 ; Get return value (ignored for now)
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync DetailPrint "Setting WFP exception for '$0': $1"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync; Direct3D support
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!if $%VBOX_WITH_CROGL% == "1"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncSection /o $(VBOX_COMPONENT_D3D) SEC03
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync!if $%VBOX_WITH_WDDM% == "1"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ${If} $g_bWithWDDM == "true"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; All D3D components are installed with WDDM driver package, nothing to be done here
144b558460813c947bcc0845c183df352b251f35vboxsync SetOverwrite on
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync ${If} $g_strSystemDir == ''
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync StrCpy $g_strSystemDir "$SYSDIR"
144b558460813c947bcc0845c183df352b251f35vboxsync SetOutPath $g_strSystemDir
144b558460813c947bcc0845c183df352b251f35vboxsync DetailPrint "Installing Direct3D support ..."
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync !if $%BUILD_TARGET_ARCH% == "x86"
144b558460813c947bcc0845c183df352b251f35vboxsync FILE "$%PATH_OUT%\bin\additions\libWine.dll"
144b558460813c947bcc0845c183df352b251f35vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
144b558460813c947bcc0845c183df352b251f35vboxsync FILE "$%PATH_OUT%\bin\additions\wined3d.dll"
144b558460813c947bcc0845c183df352b251f35vboxsync ; Update DLL cache
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync SetOutPath "$g_strSystemDir\dllcache"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" +1
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d8.dll" "$g_strSystemDir\dllcache\msd3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync IfFileExists "$g_strSystemDir\dllcache\msd3d9.dll" +1
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSystemDir\dllcache\d3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSystemDir\dllcache\d3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; If exchange above failed, do it on reboot
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Save original DLLs (only if msd3d*.dll does not exist) ...
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync SetOutPath $g_strSystemDir
60a6d709c252770b3830c85deac9c493625e3f52vboxsync IfFileExists "$g_strSystemDir\msd3d8.dll" +1
60a6d709c252770b3830c85deac9c493625e3f52vboxsync CopyFiles /SILENT "$g_strSystemDir\d3d8.dll" "$g_strSystemDir\msd3d8.dll"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync IfFileExists "$g_strSystemDir\msd3d9.dll" +1
60a6d709c252770b3830c85deac9c493625e3f52vboxsync CopyFiles /SILENT "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSystemDir\d3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$g_strSystemDir\d3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; If exchange above failed, do it on reboot
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !if $%BUILD_TARGET_ARCH% == "amd64"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Wow64 node (32-bit sub system)
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${EnableX64FSRedirection}
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SetOutPath $SYSDIR
60a6d709c252770b3830c85deac9c493625e3f52vboxsync DetailPrint "Installing Direct3D support (Wow64) ..."
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\libWine.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\wined3d.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Update DLL cache
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SetOutPath "$SYSDIR\dllcache"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync IfFileExists "$SYSDIR\dllcache\msd3d8.dll" +1
60a6d709c252770b3830c85deac9c493625e3f52vboxsync CopyFiles /SILENT "$SYSDIR\dllcache\d3d8.dll" "$SYSDIR\dllcache\msd3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync IfFileExists "$SYSDIR\dllcache\msd3d9.dll" +1
60a6d709c252770b3830c85deac9c493625e3f52vboxsync CopyFiles /SILENT "$SYSDIR\dllcache\d3d9.dll" "$SYSDIR\dllcache\msd3d9.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$SYSDIR\dllcache\d3d8.dll"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Push "$SYSDIR\dllcache\d3d9.dll"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync Call PrepareWRPFile
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Exchange DLLs
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\dllcache\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\dllcache\d3d9.dll" "$TEMP"
b0cec57d51e48736a3303366c728c3f025e8e81bvboxsync ; If exchange above failed, do it on reboot
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\dllcache\d3d8.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\dllcache\d3d9.dll" "$TEMP"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Save original DLLs (only if msd3d*.dll does not exist) ...
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SetOutPath $SYSDIR
60a6d709c252770b3830c85deac9c493625e3f52vboxsync IfFileExists "$SYSDIR\dllcache\msd3d8.dll" +1
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync CopyFiles /SILENT "$SYSDIR\d3d8.dll" "$SYSDIR\msd3d8.dll"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync IfFileExists "$SYSDIR\dllcache\msd3d9.dll" +1
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync CopyFiles /SILENT "$SYSDIR\d3d9.dll" "$SYSDIR\msd3d9.dll"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Push "$SYSDIR\d3d8.dll"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call PrepareWRPFile
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Push "$SYSDIR\d3d9.dll"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync Call PrepareWRPFile
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Exchange DLLs
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\d3d8.dll" "$TEMP"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\d3d9.dll" "$TEMP"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; If exchange above failed, do it on reboot
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\d3d8.dll" "$TEMP"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\d3d9.dll" "$TEMP"
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync ${DisableX64FSRedirection}
59489fdd1d01841db09e7a0188ad86e1a8f91843vboxsync !endif ; amd64
3af289fb9126c91f28ede0dcb3429da0de12b94evboxsync!ifndef WFP_FILE_EXCEPTION
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_WFP_WARN_REPLACE) /SD IDOK
59489fdd1d01841db09e7a0188ad86e1a8f91843vboxsync!endif ; VBOX_WITH_CROGL
60a6d709c252770b3830c85deac9c493625e3f52vboxsync!ifdef USE_MUI
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ;Assign language strings to sections
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(VBOX_COMPONENT_MAIN_DESC)
59489fdd1d01841db09e7a0188ad86e1a8f91843vboxsync !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(VBOX_COMPONENT_AUTOLOGON_DESC)
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !if $%VBOX_WITH_CROGL% == "1"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(VBOX_COMPONENT_D3D_DESC)
60a6d709c252770b3830c85deac9c493625e3f52vboxsync !insertmacro MUI_FUNCTION_DESCRIPTION_END
60a6d709c252770b3830c85deac9c493625e3f52vboxsync!endif ; USE_MUI
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncSection -Content
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncSection -StartMenu
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" "" "$INSTDIR\iexplore.ico"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninst.exe"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync; This section is called after all the files are in place
60a6d709c252770b3830c85deac9c493625e3f52vboxsyncSection -Post
60a6d709c252770b3830c85deac9c493625e3f52vboxsync!ifdef _DEBUG
60a6d709c252770b3830c85deac9c493625e3f52vboxsync DetailPrint "Doing post install ..."
60a6d709c252770b3830c85deac9c493625e3f52vboxsync!ifdef EXTERNAL_UNINSTALLER
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SetOutPath "$INSTDIR"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync FILE "$%PATH_TARGET%\uninst.exe"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteUninstaller "$INSTDIR\uninst.exe"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Write uninstaller in "Add / Remove programs"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
59489fdd1d01841db09e7a0188ad86e1a8f91843vboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Tune TcpWindowSize for a better network throughput
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" "TcpWindowSize" 64240
59489fdd1d01841db09e7a0188ad86e1a8f91843vboxsync DetailPrint "Installation completed."
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync; !!! NOTE: This function *has* to be right under the last section; otherwise it does
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync; *not* get called! Don't ask me why ... !!!
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncFunction .onSelChange
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Handle selection of D3D component
60a6d709c252770b3830c85deac9c493625e3f52vboxsync SectionGetFlags ${SEC03} $0
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} $0 == ${SF_SELECTED}
59489fdd1d01841db09e7a0188ad86e1a8f91843vboxsync!if $%VBOX_WITH_WDDM% == "1"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; If we're able to use the WDDM driver just use it instead of the replaced
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; D3D components below
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} $g_bCapWDDM == "true"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Temporary solution: Since WDDM is marked as experimental yet we notify the user
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; that WDDM (Aero) support is available but not recommended for production use. He now
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; can opt-in for installing WDDM or still go for the old (XPDM) way -- safe mode still required!
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync MessageBox MB_ICONQUESTION|MB_YESNO $(VBOX_COMPONENT_D3D_OR_WDDM) /SD IDNO IDYES d3d_install
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Display an uncoditional hint about needed VRAM sizes
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; Note: We also could use the PCI configuration space (WMI: Win32_SystemSlot Class) for querying
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; the current VRAM size, but let's keep it simple for now
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_HINT_VRAM) /SD IDOK
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync StrCpy $g_bWithWDDM "true"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsyncd3d_install:
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} $g_bForceInstall != "true"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ; Do not install on < XP
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${If} $g_strWinVersion == "NT4"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${OrIf} $g_strWinVersion == "2000"
60a6d709c252770b3830c85deac9c493625e3f52vboxsync ${OrIf} $g_strWinVersion == ""
60a6d709c252770b3830c85deac9c493625e3f52vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_NOT_SUPPORTED) /SD IDOK
60a6d709c252770b3830c85deac9c493625e3f52vboxsync Goto d3d_disable
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; If force flag is set skip the safe mode check
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ${If} $g_bForceInstall != "true"
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ; If we're not in safe mode, print a warning and don't install D3D support
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ${If} $g_iSystemMode == '0'
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_NO_SM) /SD IDOK
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync Goto d3d_disable
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync ${Else} ; D3D unselected again
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync StrCpy $g_bWithWDDM "false"
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsyncd3d_disable:
22ecc39cb2e9aeb958d702b60fd677e8df0cdc70vboxsync IntOp $0 $0 & ${SECTION_OFF} ; Unselect section again
5142b6456c5cec38e0ee291e235201d4ac73f10bvboxsync SectionSetFlags ${SEC03} $0
; If UNINSTALLER_ONLY is defined, we're only interested in uninst.exe
WriteUninstaller "$%PATH_TARGET%\uninst.exe"
Function un.onUninstSuccess
Function un.onInit
Call un.SetAppMode64
Call un.GetWindowsVer
Call un.EnableLog
Call un.SetAppMode64
Call un.Uninstall
Call un.UninstallInstDir