VBoxStub.cpp revision ad27e1d5e48ca41245120c331cc88b50464813ce
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * VBoxStub - VirtualBox's Windows installer stub.
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * Copyright (C) 2010 Oracle Corporation
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * This file is part of VirtualBox Open Source Edition (OSE), as
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * available from http://www.virtualbox.org. This file is free software;
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * you can redistribute it and/or modify it under the terms of the GNU
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * General Public License (GPL) as published by the Free Software
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * Foundation, in version 2 as it comes in the "COPYING" file of the
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai/*******************************************************************************
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai* Header Files *
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai*******************************************************************************/
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * Shows a message box with a printf() style formatted string.
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * @returns Message box result (IDOK, IDCANCEL, ...).
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * @param uType Type of the message box (see MSDN).
d0a16c48f3477794c63f4ff3242dc20db6a49295Satyen Desai * @param pszFmt Printf-style format string to show in the message box body.
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai rc = MessageBox(GetDesktopWindow(), pszMsg, VBOX_STUB_TITLE, MB_ICONINFORMATION);
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai rc = MessageBox(GetDesktopWindow(), pszFmt, VBOX_STUB_TITLE, MB_ICONINFORMATION);
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * Shows an error message box with a printf() style formatted string.
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * @returns Message box result (IDOK, IDCANCEL, ...).
b1c2d1f8735dc44a6c1a80f77447293503d5a054Satyen Desai * @param pszFmt Printf-style format string to show in the message box body.
char *pszMsg;
int rc;
if (pszMsg)
return rc;
const char *pszDataName,
HRSRC hRsrc = FindResourceEx(hInst, RT_RCDATA, pszDataName, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
return VINF_SUCCESS;
return VERR_IO_GEN_FAILURE;
const char *pszTargetFileName,
char **ppszTempFile)
return VINF_SUCCESS;
return VERR_NO_STR_MEMORY;
const char *pszTempFile)
int rc;
if (bCreatedFile)
return rc;
const char *pszTempFile)
fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
return FALSE;
return bIsWow64;
return TRUE;
return TRUE;
return TRUE;
return FALSE;
SHFILEOPSTRUCT s = {0};
char *lpCmdLine,
int nCmdShow)
/* Do not use a global namespace ("Global\\") for mutex name here, will blow up NT4 compatibility! */
return vrc;
for (int i = 0; i < iArgC; i++)
&& (iArgC > i))
&& (iArgC > i))
if (bExit)
NULL);
if (fEnableLogging)
if (!fSilent)
switch (uStatus)
"You must install a Windows service pack that contains a newer version of the Windows Installer service.");
if ( !fExtractOnly
if ( fExtractOnly
&& !fSilent)
switch(vrc)
case VERR_NO_CHANGE:
return vrc;