VBoxGuestAdditions.nsi revision ca7f7f38dae7697e6b3046bf4d80dfc98eb59210
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TYPE% == "debug"
78a072e1b56619e3230735ae073668311232ec94vboxsync !define _DEBUG ; Turn this on to get extra output
78a072e1b56619e3230735ae073668311232ec94vboxsync; Defines for special functions
78a072e1b56619e3230735ae073668311232ec94vboxsync!define WHQL_FAKE ; Turns on the faking of non WHQL signed / approved drivers.
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Needs the VBoxWHQLFake.exe in the additions output directory!
78a072e1b56619e3230735ae073668311232ec94vboxsync!define VENDOR_ROOT_KEY "SOFTWARE\$%VBOX_VENDOR_SHORT%"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_NAME "$%VBOX_PRODUCT% Guest Additions"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_DESC "$%VBOX_PRODUCT% Guest Additions"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_VERSION "$%VBOX_VERSION_MAJOR%.$%VBOX_VERSION_MINOR%.$%VBOX_VERSION_BUILD%.0"
78a072e1b56619e3230735ae073668311232ec94vboxsync!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"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
78a072e1b56619e3230735ae073668311232ec94vboxsync!define PRODUCT_UNINST_ROOT_KEY "HKLM"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIProductVersion "${PRODUCT_VERSION}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "FileVersion" "$%VBOX_VERSION_STRING%"
78a072e1b56619e3230735ae073668311232ec94vboxsyncVIAddVersionKey "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 !insertmacro GetParameters
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro GetOptions
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro WordFind
78a072e1b56619e3230735ae073668311232ec94vboxsync !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"
08c4185261c17943cff6cc94522579696eeeb478vboxsync; Set Modern UI (MUI) as default
08c4185261c17943cff6cc94522579696eeeb478vboxsync!define USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync!ifdef USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Use modern UI, version 2
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 ; API defines
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define SM_CLEANBOOT 67
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 ; Welcome page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_WELCOME
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; License page
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_PAGE_LICENSE "$(VBOX_LICENSE)"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !define MUI_LICENSEPAGE_RADIOBUTTONS
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 !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 ; Uninstaller pages
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_UNPAGE_INSTFILES
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Define languages we will use
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_LANGUAGE "English"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_LANGUAGE "French"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_LANGUAGE "German"
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Set branding text which appears on the horizontal line at the bottom
a6ab77f04b22f0de7691f50dfdee8196024ce26dvboxsync!ifdef _DEBUG
a6ab77f04b22f0de7691f50dfdee8196024ce26dvboxsync BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING% ($%VBOX_SVN_REV%) - Debug Build"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; Set license language
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_ENGLISH} "$%VBOX_BRAND_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync ; 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 LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !ifdef VBOX_BRAND_de_DE_LICENSE_RTF
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_de_DE_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_LICENSE_RTF%"
08c4185261c17943cff6cc94522579696eeeb478vboxsync !insertmacro MUI_RESERVEFILE_LANGDLL
08c4185261c17943cff6cc94522579696eeeb478vboxsync!else ; !USE_MUI
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page license
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page components
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page directory
08c4185261c17943cff6cc94522579696eeeb478vboxsync Page instfiles
78a072e1b56619e3230735ae073668311232ec94vboxsync; Language files
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Languages\English.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Languages\French.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync!include "Languages\German.nsh"
78a072e1b56619e3230735ae073668311232ec94vboxsync; Variables and output files
78a072e1b56619e3230735ae073668311232ec94vboxsyncName "${PRODUCT_NAME} $%VBOX_VERSION_STRING%"
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync!echo "Uninstaller only!"
78a072e1b56619e3230735ae073668311232ec94vboxsyncOutFile "$%PATH_TARGET%\VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%-uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsyncOutFile "VBoxWindowsAdditions-$%BUILD_TARGET_ARCH%.exe"
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
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_bFakeWHQL ; Cmd line: Fake Windows to install non WHQL certificated drivers (only for W2K and XP currently!!) ("/unsig_drv")
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncVar 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")
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_iScreenBpp ; Cmd line: Screen depth ("/depth=X")
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_iScreenX ; Cmd line: Screen resolution X ("/resx=X")
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_iScreenY ; Cmd line: Screen resolution Y ("/resy=Y")
78a072e1b56619e3230735ae073668311232ec94vboxsyncVar g_iSfOrder ; Cmd line: Order of Shared Folders network provider (0=first, 1=second, ...)
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)
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsyncVar g_bInstallWDDM ; WDDM mode
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
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 StrCpy $1 "0" ; Init param counter
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $2 "1" ; Init current param counter
78a072e1b56619e3230735ae073668311232ec94vboxsync ${GetParameters} $0 ; Extract command line
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $0 == "" ; If no parameters at all exit
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Enable for debugging
78a072e1b56619e3230735ae073668311232ec94vboxsync ;MessageBox MB_OK "CmdLine: $0"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${WordFind} $0 " " "#" $1 ; Get number of parameters in cmd line
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $0 == $1 ; If result matches the input then
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $1 "1" ; no delimeter was found. Correct to 1 word total.
78a072e1b56619e3230735ae073668311232ec94vboxsync ${While} $2 <= $1 ; Loop through all params
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 ${StrFilter} $4 "-" "" "" $4 ; Transfor param name to lowercase
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Enable for debugging
78a072e1b56619e3230735ae073668311232ec94vboxsync ;MessageBox MB_OK "#$2 of #$1, param='$3', name=$4, val=$5"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Switch} $4
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/d' ; NSIS: /D=<instdir> switch, skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/depth'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} 'depth'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iScreenBpp $5
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/extract'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bOnlyExtract "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${Case} '/force'
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCpy $g_bForceInstall "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/help'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/H'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/h'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/?'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/l'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/log'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/logging'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bLogEnable "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/ncrc' ; NSIS: /NCRC switch, skip
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_videodrv'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVideoDrv "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_guestdrv'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoGuestDrv "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${Case} '/no_mousedrv'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoMouseDrv "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
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${Default} ; Unknown parameter, print usage message
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndSwitch}
78a072e1b56619e3230735ae073668311232ec94vboxsync IntOp $2 $2 + 1
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EndWhile}
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 \
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."
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 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
78a072e1b56619e3230735ae073668311232ec94vboxsync 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:
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_Sun
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto success
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_xvm_check:
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for old "innotek" Guest Additions" before rebranding to "Sun"
78a072e1b56619e3230735ae073668311232ec94vboxsync ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $0 "" innotek_check ; If string is empty, Sun xVM additions are probably not installed (anymore).
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_xvm_uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsyncsun_xvm_uninstall:
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_SunXVM
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto success
78a072e1b56619e3230735ae073668311232ec94vboxsyncinnotek_check:
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"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $0 "" exit ; If string is empty, Guest Additions are probably not installed (anymore).
78a072e1b56619e3230735ae073668311232ec94vboxsync 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
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Nothing to do here yet
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction CheckArchitecture
78a072e1b56619e3230735ae073668311232ec94vboxsync System::Call "kernel32::GetCurrentProcess() i .s"
78a072e1b56619e3230735ae073668311232ec94vboxsync System::Call "kernel32::IsWow64Process(i s, *i .r0)"
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Running on 64bit: $0"
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64" ; 64-bit
78a072e1b56619e3230735ae073668311232ec94vboxsync IntCmp $0 0 not_32bit_platform
78a072e1b56619e3230735ae073668311232ec94vboxsync!else ; 32-bit
78a072e1b56619e3230735ae073668311232ec94vboxsync IntCmp $0 1 not_64bit_platform
78a072e1b56619e3230735ae073668311232ec94vboxsyncnot_32bit_platform:
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_AMD64) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsyncnot_64bit_platform:
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_X86) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction PrepareForUpdate
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $g_strAddVerMaj "1" v1 ; Handle major version "v1.x"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $g_strAddVerMaj "2" v2 ; Handle major version "v2.x"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $g_strAddVerMaj "3" v3 ; Handle major version "v3.x"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strAddVerMin "5" v1_5 ; Handle minor version "v1.5.x"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strAddVerMin "6" v1_6 ; Handle minor version "v1.6.x"
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOverwrite on
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef VBOX_SIGN_ADDITIONS
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
78a072e1b56619e3230735ae073668311232ec94vboxsync; Main Files
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection $(VBOX_COMPONENT_MAIN) SEC01
78a072e1b56619e3230735ae073668311232ec94vboxsync SectionIn RO ; Section cannot be unselected (read-only)
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOverwrite on
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Because this NSIS installer is always built in 32-bit mode, we have to
78a072e1b56619e3230735ae073668311232ec94vboxsync ; do some tricks for the Windows paths
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Because the next two lines will crash at the license page (??) we have to re-enable that here again
78a072e1b56619e3230735ae073668311232ec94vboxsync ${DisableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRegView 64
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strSystemDir "$SYSDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call EnableLog
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareForUpdate
ca7f7f38dae7697e6b3046bf4d80dfc98eb59210vboxsync DetailPrint "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_strAddVerMaj != ""
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)"
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "No previous version of ${PRODUCT_NAME} detected."
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync DetailPrint "Detected OS: Windows $g_strWinVersion"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync DetailPrint "System Directory: $g_strSystemDir"
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef _DEBUG
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Debug!"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; Which OS are we using?
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
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
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${If} $g_bForceInstall == "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Goto vista ; Assume newer OS than we know of ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Goto notsupported
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
78a072e1b56619e3230735ae073668311232ec94vboxsyncnt4: ; Windows NT4
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetServicePack
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $R0 ; Major version
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $R1 ; Minor version
78a072e1b56619e3230735ae073668311232ec94vboxsync ; At least Service Pack 6 installed?
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $R0 "6" +3
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_YESNO $(VBOX_NT4_NO_SP6) /SD IDYES IDYES +2
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Copy some common files ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync Call NT_Main
78a072e1b56619e3230735ae073668311232ec94vboxsync goto success
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncvista: ; Windows Vista / Windows 7
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Copy some common files ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync Call W2K_Main ; First install stuff from Windows 2000 / XP
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Call Vista_Main ; ... and some specific stuff for Vista / Windows 7
78a072e1b56619e3230735ae073668311232ec94vboxsync goto success
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncw2k: ; Windows 2000 and XP ...
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Copy some common files ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Common_CopyFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync Call W2K_Main
78a072e1b56619e3230735ae073668311232ec94vboxsync goto success
78a072e1b56619e3230735ae073668311232ec94vboxsyncnotsupported:
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Write a registry key with version and installation path for later lookup
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Version" "$%VBOX_VERSION_STRING%"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Revision" "$%VBOX_SVN_REV%"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "InstallDir" "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifndef _DEBUG
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRebootFlag true ; This will show a reboot page at end of installation
78a072e1b56619e3230735ae073668311232ec94vboxsync Call WriteLogUI
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 ; Because this NSIS installer is always built in 32-bit mode, we have to
78a072e1b56619e3230735ae073668311232ec94vboxsync ; do some tricks for the Windows paths.
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Because the next two lines will crash at the license page (??) we have to re-enable that here again
78a072e1b56619e3230735ae073668311232ec94vboxsync ${DisableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRegView 64
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetWindowsVersion
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $R0 ; Windows Version
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Installing auto-logon support ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Another GINA already is installed? Check if this is ours, otherwise let the user decide (unless it's a silent setup)
78a072e1b56619e3230735ae073668311232ec94vboxsync ; 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"
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1 $(VBOX_COMPONENT_AUTOLOGON_WARN_3RDPARTY) /SD IDYES IDYES install
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Do we need VBoxCredProv or VBoxGINA?
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $R0 == 'Vista'
78a072e1b56619e3230735ae073668311232ec94vboxsync ${OrIf} $R0 == '7'
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"
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"
78a072e1b56619e3230735ae073668311232ec94vboxsync; Prepares the access rights for replacing a WRP protected file
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$g_strSystemDir\takeown.exe" 0 +2
78a072e1b56619e3230735ae073668311232ec94vboxsync nsExec::ExecToLog '"$g_strSystemDir\takeown.exe" /F "$0"'
78a072e1b56619e3230735ae073668311232ec94vboxsync AccessControl::SetFileOwner "$0" "(S-1-5-32-545)"
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Setting file owner for '$0': $1"
78a072e1b56619e3230735ae073668311232ec94vboxsync AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess"
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Setting access rights for '$0': $1"
78a072e1b56619e3230735ae073668311232ec94vboxsync; Direct3D support
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%VBOX_WITH_CROGL% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection /o $(VBOX_COMPONENT_D3D) SEC03
e068057c82b010bc7cc663e8f57ac3ef1890a33cvboxsync!if $%VBOX_WITH_WDDM% == "1"
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsync ${If} $g_bInstallWDDM == "true"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; All D3D components are installed with WDDM driver package, nothing to be done here
78a072e1b56619e3230735ae073668311232ec94vboxsync !define LIBRARY_IGNORE_VERSION ; Install in every case
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOverwrite on
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_strSystemDir == ''
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strSystemDir "$SYSDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; crOpenGL: Do *not* install 64-bit files - they don't work yet (use !define LIBRARY_X64 later)
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Only 32-bit apps on 64-bit work (see next block)
78a072e1b56619e3230735ae073668311232ec94vboxsync !if $%BUILD_TARGET_ARCH% == "x86"
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath $g_strSystemDir
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Installing Direct3D support ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\libWine.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_OUT%\bin\additions\wined3d.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Update DLL cache
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$g_strSystemDir\dllcache"
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d8.dll" "$g_strSystemDir\dllcache\msd3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$g_strSystemDir\dllcache\msd3d9.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$g_strSystemDir\dllcache\d3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$g_strSystemDir\dllcache\d3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Exchange DLLs
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; If exchange above failed, do it on reboot
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Save original DLLs ...
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath $g_strSystemDir
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$g_strSystemDir\msd3d8.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$g_strSystemDir\d3d8.dll" "$g_strSystemDir\msd3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$g_strSystemDir\msd3d8.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$g_strSystemDir\d3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$g_strSystemDir\d3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Exchange DLLs
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; If exchange above failed, do it on reboot
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Only 64-bit installer: Also copy 32-bit DLLs on 64-bit target arch in
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Wow64 node (32-bit sub system)
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EnableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath $SYSDIR
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Installing Direct3D support (Wow64) ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\libWine.dll"
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 ; Update DLL cache
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$SYSDIR\dllcache"
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$SYSDIR\dllcache\msd3d8.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$SYSDIR\dllcache\d3d8.dll" "$SYSDIR\dllcache\msd3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$SYSDIR\dllcache\msd3d9.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$SYSDIR\dllcache\d3d9.dll" "$SYSDIR\dllcache\msd3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$SYSDIR\dllcache\d3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$SYSDIR\dllcache\d3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Exchange DLLs
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\dllcache\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\dllcache\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; If exchange above failed, do it on reboot
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\dllcache\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\dllcache\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Save original DLLs ...
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath $SYSDIR
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$SYSDIR\dllcache\msd3d8.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$SYSDIR\d3d8.dll" "$SYSDIR\msd3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync IfFileExists "$SYSDIR\dllcache\msd3d9.dll" +1
78a072e1b56619e3230735ae073668311232ec94vboxsync CopyFiles /SILENT "$SYSDIR\d3d9.dll" "$SYSDIR\msd3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$SYSDIR\d3d8.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync Push "$SYSDIR\d3d9.dll"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call PrepareWRPFile
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Exchange DLLs
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; If exchange above failed, do it on reboot
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$SYSDIR\d3d8.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$SYSDIR\d3d9.dll" "$TEMP"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${DisableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync !endif ; amd64
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_WFP_WARN_REPLACE) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif ; VBOX_WITH_CROGL
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 !insertmacro MUI_FUNCTION_DESCRIPTION_END
08c4185261c17943cff6cc94522579696eeeb478vboxsync!endif ; USE_MUI
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection -Content
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection -StartMenu
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; This section is called after all the files are in place
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection -Post
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef _DEBUG
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Doing post install ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef EXTERNAL_UNINSTALLER
78a072e1b56619e3230735ae073668311232ec94vboxsync SetOutPath "$INSTDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync FILE "$%PATH_TARGET%\uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteUninstaller "$INSTDIR\uninst.exe"
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 ; Tune TcpWindowSize for a better network throughput
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" "TcpWindowSize" 64240
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Installation completed."
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
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; Handle selection of D3D component
08c4185261c17943cff6cc94522579696eeeb478vboxsync SectionGetFlags ${SEC03} $0
08c4185261c17943cff6cc94522579696eeeb478vboxsync ${If} $0 == ${SF_SELECTED}
e068057c82b010bc7cc663e8f57ac3ef1890a33cvboxsync!if $%VBOX_WITH_WDDM% == "1"
0614bee07b5f88aa8803df43fde6d7185a9a7fffvboxsync !if $%BUILD_TARGET_ARCH% == "x86"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; If we're on a 32-bit Windows Vista / 7 also install the WDDM bits
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${If} $g_strWinVersion == "Vista"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${OrIf} $g_strWinVersion == "7"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCpy $g_bInstallWDDM "true"
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
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ; If we're not in safe mode, print a warning and don't install D3D support
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync ${If} $g_iSystemMode == '0'
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_COMPONENT_D3D_NO_SM) /SD IDOK
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync Goto d3d_disable
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncd3d_disable:
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync IntOp $0 $0 & ${SECTION_OFF} ; Unselect section again
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync SectionSetFlags ${SEC03} $0
78a072e1b56619e3230735ae073668311232ec94vboxsync; This function is called when a critical error occured
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction .onInstFailed
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONSTOP $(VBOX_ERROR_INST_FAILED) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bLogEnable "true"
78a072e1b56619e3230735ae073668311232ec94vboxsync Call WriteLogUI
78a072e1b56619e3230735ae073668311232ec94vboxsync SetErrorLevel 1
78a072e1b56619e3230735ae073668311232ec94vboxsync; This function is called when installation was successful!
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction .onInstSuccess
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Nothing to do here yet ...
78a072e1b56619e3230735ae073668311232ec94vboxsync; This function is called at the very beginning of installer execution
78a072e1b56619e3230735ae073668311232ec94vboxsyncFunction .onInit
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Init values
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iSystemMode "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerMaj "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerMin "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerBuild "0"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strAddVerRev "0"
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"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoVideoDrv "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoGuestDrv "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bNoMouseDrv "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithAutoLogon "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bWithD3D "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_bOnlyExtract "false"
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync StrCpy $g_bInstallWDDM "false"
78a072e1b56619e3230735ae073668311232ec94vboxsync SetErrorLevel 0
78a072e1b56619e3230735ae073668311232ec94vboxsync ClearErrors
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifndef UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Handle command line
78a072e1b56619e3230735ae073668311232ec94vboxsync Call HandleCommandLine
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Retrieve Windows version and store result in $g_strWinVersion
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetWindowsVer
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Retrieve system mode and store result in
78a072e1b56619e3230735ae073668311232ec94vboxsync System::Call 'user32::GetSystemMetrics(i ${SM_CLEANBOOT}) i .r0'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_iSystemMode $0
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "System mode: $g_iSystemMode"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Get user Name
78a072e1b56619e3230735ae073668311232ec94vboxsync AccessControl::GetCurrentUserName
78a072e1b56619e3230735ae073668311232ec94vboxsync Pop $g_strCurUser
78a072e1b56619e3230735ae073668311232ec94vboxsync DetailPrint "Current user: $g_strCurUser"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Only uninstall?
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $g_bUninstall "true" uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Only extract files?
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $g_bOnlyExtract "true" extract_files
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Set section bits
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_bWithAutoLogon == "true" ; Auto-logon support
78a072e1b56619e3230735ae073668311232ec94vboxsync SectionSetFlags ${SEC02} ${SF_SELECTED}
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%VBOX_WITH_CROGL% == "1"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${If} $g_bWithD3D == "true" ; D3D support
78a072e1b56619e3230735ae073668311232ec94vboxsync SectionSetFlags ${SEC03} ${SF_SELECTED}
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 ; Do some checks before we actually start ...
78a072e1b56619e3230735ae073668311232ec94vboxsync Call IsUserAdmin
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check if there's already another instance of the installer is running -
78a072e1b56619e3230735ae073668311232ec94vboxsync ; important for preventing NT4 to spawn the installer twice
78a072e1b56619e3230735ae073668311232ec94vboxsync System::Call 'kernel32::CreateMutexA(i 0, i 0, t "VBoxGuestInstaller") ?e'
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCmp $R0 0 +1 exit
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for correct architecture
78a072e1b56619e3230735ae073668311232ec94vboxsync Call CheckArchitecture
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Because this NSIS installer is always built in 32-bit mode, we have to
78a072e1b56619e3230735ae073668311232ec94vboxsync ; do some tricks for the Windows paths for checking for old additions
78a072e1b56619e3230735ae073668311232ec94vboxsync ; in block below.
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${DisableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRegView 64
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Check for old additions
78a072e1b56619e3230735ae073668311232ec94vboxsync Call CheckForOldGuestAdditions
78a072e1b56619e3230735ae073668311232ec94vboxsync Call GetAdditionsVersion
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)
78a072e1b56619e3230735ae073668311232ec94vboxsync ; mode for now.
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${EnableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRegView 32
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall_Innotek
78a072e1b56619e3230735ae073668311232ec94vboxsync Call Uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_UNINST_SUCCESS) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsyncextract_files:
78a072e1b56619e3230735ae073668311232ec94vboxsync Call ExtractFiles
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_OK|MB_ICONINFORMATION $(VBOX_EXTRACTION_COMPLETE) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync!else ; UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsync ; If UNINSTALLER_ONLY is defined, we're only interested in uninst.exe
78a072e1b56619e3230735ae073668311232ec94vboxsync ; so we can sign it.
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Note that the Quit causes the exit status to be 2 instead of 0.
78a072e1b56619e3230735ae073668311232ec94vboxsync WriteUninstaller "$%PATH_TARGET%\uninst.exe"
78a072e1b56619e3230735ae073668311232ec94vboxsync!endif ; UNINSTALLER_ONLY
78a072e1b56619e3230735ae073668311232ec94vboxsyncexit: ; Abort installer for some reason
78a072e1b56619e3230735ae073668311232ec94vboxsync; The uninstaller is built separately when doing code signing.
78a072e1b56619e3230735ae073668311232ec94vboxsync; For some reason NSIS still finds the Uninstall section even
78a072e1b56619e3230735ae073668311232ec94vboxsync; when EXTERNAL_UNINSTALLER is defined. This causes a silly warning.
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifndef EXTERNAL_UNINSTALLER
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_UNINST_SUCCESS) /SD IDOK
78a072e1b56619e3230735ae073668311232ec94vboxsync MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(VBOX_UNINST_CONFIRM) /SD IDYES IDYES proceed
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Because this NSIS installer is always built in 32-bit mode, we have to
78a072e1b56619e3230735ae073668311232ec94vboxsync ; do some tricks for the Windows paths.
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ${DisableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRegView 64
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Set system directory.
78a072e1b56619e3230735ae073668311232ec94vboxsync StrCpy $g_strSystemDir "$SYSDIR"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Retrieve Windows version we're running on and store it in $g_strWinVersion
78a072e1b56619e3230735ae073668311232ec94vboxsyncSection Uninstall
78a072e1b56619e3230735ae073668311232ec94vboxsync!ifdef _DEBUG
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Enable logging
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Because this NSIS installer is always built in 32-bit mode, we have to
78a072e1b56619e3230735ae073668311232ec94vboxsync ; do some tricks for the Windows paths.
78a072e1b56619e3230735ae073668311232ec94vboxsync!if $%BUILD_TARGET_ARCH% == "amd64"
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Do *not* add this line in .onInit - it will crash at the license page (??) because of a weird NSIS bug.
78a072e1b56619e3230735ae073668311232ec94vboxsync ${DisableX64FSRedirection}
78a072e1b56619e3230735ae073668311232ec94vboxsync SetRegView 64
78a072e1b56619e3230735ae073668311232ec94vboxsync ; Call the uninstall main function.
78a072e1b56619e3230735ae073668311232ec94vboxsync ; ... and remove the local install directory
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 DetailPrint "Rebooting ..."
78a072e1b56619e3230735ae073668311232ec94vboxsync; !EXTERNAL_UNINSTALLER
78a072e1b56619e3230735ae073668311232ec94vboxsync;Direct the output to our bin dir
78a072e1b56619e3230735ae073668311232ec94vboxsync!cd "$%PATH_OUT%\bin\additions"