VirtualBox

Changeset 106321 in vbox


Ignore:
Timestamp:
Oct 15, 2024 1:06:30 PM (6 weeks ago)
Author:
vboxsync
Message:

Windows installers: Big revamp for removing all DIFxApp-related / DIFxApi-related code and build dependencies for the host and guest installers. bugref:10762

This implements an own framework (VBoxWinDrvInst and VBoxWinDrvStore) for installing Windows drivers and querying / handling the Windows driver store,
along with testcases for the Windows guest and host installers.

Location:
trunk
Files:
6 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/err.h

    r106061 r106321  
    32993299/** @} */
    33003300
     3301/** A reboot is needed for completing driver (un)installation. */
     3302#define VERR_DRIVER_REBOOT_NEEDED                  (-1028)
     3303/** A reboot is needed for completing driver (un)installation. */
     3304#define VINF_DRIVER_REBOOT_NEEDED                  (1028)
    33013305/* SED-END */
    33023306
  • trunk/include/iprt/err.h

    r106061 r106321  
    408408/** Floating pointer overflow. */
    409409#define VWRN_FLOAT_OVERFLOW                 (22427)
     410/** A reboot is needed. */
     411#define VERR_REBOOT_NEEDED                  (-22428)
     412/** A reboot is needed. */
     413#define VINF_REBOOT_NEEDED                  (22428)
     414/** Installation has failed. */
     415#define VERR_INSTALLATION_FAILED            (-22429)
    410416/** @} */
    411417
  • trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk

    r106247 r106321  
    6262endif
    6363VBoxDrvInst_DEPS    = $(VBOX_SVN_REV_KMK)
    64 VBoxDrvInst_SDKS    = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST) VBoxWinNewDevLib
     64VBoxDrvInst_SDKS    = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST)
    6565VBoxDrvInst_INCS    = ../include
    66 VBoxDrvInst_LIBS    = \
    67         $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/setupapi.lib
    6866VBoxDrvInst_SOURCES = \
    6967        VBoxDrvInst.cpp \
    70         VBoxDrvInst.rc
     68        VBoxDrvInst.rc \
     69        $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvCommon.cpp \
     70        $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvInst.cpp \
     71        $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvStore.cpp
    7172VBoxDrvInst_VBOX_IMPORT_CHECKER.win.x86 := nt4 # setupapi was introduced in NT4
    7273
     
    263264        -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
    264265        -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
    265         -E 'VBOX_PATH_DIFX=$(subst /,\,$(VBOX_PATH_DIFX))' \
    266266        -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
    267267        -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp

    r106061 r106321  
    3939#include <iprt/win/windows.h>
    4040#include <iprt/win/setupapi.h>
     41#include <newdev.h> /* For INSTALLFLAG_XXX. */
     42#include <cfgmgr32.h> /* For MAX_DEVICE_ID_LEN. */
    4143#include <devguid.h>
    4244#include <RegStr.h>
     
    4749
    4850#include <iprt/asm.h>
     51#include <iprt/err.h>
     52#include <iprt/initterm.h>
     53#include <iprt/ldr.h>
    4954#include <iprt/mem.h>
     55#include <iprt/message.h>
     56#include <iprt/once.h>
    5057#include <iprt/path.h>      /* RTPATH_IS_SEP */
     58#include <iprt/stream.h>
    5159#include <iprt/string.h>
     60#include <iprt/system.h>
    5261#include <iprt/utf16.h>
     62
     63#include <VBox/GuestHost/VBoxWinDrvInst.h>
    5364
    5465/* Exit codes */
     
    6576*   Defines                                                                                                                      *
    6677*********************************************************************************************************************************/
    67 /* Defines */
    68 #define DRIVER_PACKAGE_REPAIR                   0x00000001
    69 #define DRIVER_PACKAGE_SILENT                   0x00000002
    70 #define DRIVER_PACKAGE_FORCE                    0x00000004
    71 #define DRIVER_PACKAGE_ONLY_IF_DEVICE_PRESENT   0x00000008
    72 #define DRIVER_PACKAGE_LEGACY_MODE              0x00000010
    73 #define DRIVER_PACKAGE_DELETE_FILES             0x00000020
    74 
    75 /* DIFx error codes */
    76 /** @todo any reason why we're not using difxapi.h instead of these redefinitions? */
    77 #ifndef ERROR_DRIVER_STORE_ADD_FAILED
    78 # define ERROR_DRIVER_STORE_ADD_FAILED          (APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x0247L)
    79 #endif
    80 #define ERROR_DEPENDENT_APPLICATIONS_EXIST      (APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x300)
    81 #define ERROR_DRIVER_PACKAGE_NOT_IN_STORE       (APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x302)
    82 
    8378/* Registry string list flags */
    8479#define VBOX_REG_STRINGLIST_NONE                0x00000000        /**< No flags set. */
    8580#define VBOX_REG_STRINGLIST_ALLOW_DUPLICATES    0x00000001        /**< Allows duplicates in list when adding a value. */
    86 
    87 #ifdef DEBUG
    88 # define VBOX_DRVINST_LOGFILE                   "C:\\Temp\\VBoxDrvInstDIFx.log"
    89 #endif
    9081
    9182/** NT4: The video service name. */
     
    9687
    9788/*********************************************************************************************************************************
    98 *   Structures and Typedefs                                                                                                      *
    99 *********************************************************************************************************************************/
    100 typedef struct
    101 {
    102     PCWSTR pApplicationId;
    103     PCWSTR pDisplayName;
    104     PCWSTR pProductName;
    105     PCWSTR pMfgName;
    106 } INSTALLERINFO, *PINSTALLERINFO;
    107 typedef const PINSTALLERINFO PCINSTALLERINFO;
    108 
    109 typedef enum
    110 {
    111     DIFXAPI_SUCCESS,
    112     DIFXAPI_INFO,
    113     DIFXAPI_WARNING,
    114     DIFXAPI_ERROR
    115 } DIFXAPI_LOG;
    116 
    117 typedef void (__cdecl *DIFXAPILOGCALLBACK_W)(DIFXAPI_LOG Event, DWORD Error, PCWSTR EventDescription, PVOID CallbackContext);
    118 typedef DWORD (WINAPI *PFN_DriverPackageInstall_T)(PCTSTR DriverPackageInfPath, DWORD Flags, PCINSTALLERINFO pInstallerInfo, BOOL *pNeedReboot);
    119 typedef DWORD (WINAPI *PFN_DriverPackageUninstall_T)(PCTSTR DriverPackageInfPath, DWORD Flags, PCINSTALLERINFO pInstallerInfo, BOOL *pNeedReboot);
    120 typedef VOID  (WINAPI *PFN_DIFXAPISetLogCallback_T)(DIFXAPILOGCALLBACK_W LogCallback, PVOID CallbackContext);
    121 
    122 
    123 /*********************************************************************************************************************************
    12489*   Global Variables                                                                                                             *
    12590*********************************************************************************************************************************/
    126 static PFN_DriverPackageInstall_T   g_pfnDriverPackageInstall   = NULL;
    127 static PFN_DriverPackageUninstall_T g_pfnDriverPackageUninstall = NULL;
    128 static PFN_DIFXAPISetLogCallback_T  g_pfnDIFXAPISetLogCallback  = NULL;
    129 
    130 
    131 
    13291static char *ArgToUtf8(wchar_t const *pwszString, const char *pszArgName)
    13392{
     
    198157}
    199158
    200 
    201 /**
    202  * Log callback for DIFxAPI calls.
    203  *
    204  * @param   enmEvent        Event logging level.
    205  * @param   dwError         Event error number.
    206  * @param   pwszEventDesc   Event description text.
    207  * @param   pvCtx           Log file handle, if we've got one.
    208  */
    209 static void __cdecl VBoxDIFxLogCallback(DIFXAPI_LOG enmEvent, DWORD dwError, PCWSTR pwszEventDesc, PVOID pvCtx)
    210 {
    211     const char *pszEvent;
    212     switch (enmEvent)
    213     {
    214         case DIFXAPI_SUCCESS:   pszEvent  =  "DIFXAPI_SUCCESS"; break;
    215         case DIFXAPI_INFO:      pszEvent  =  "DIFXAPI_INFO";    break;
    216         case DIFXAPI_WARNING:   pszEvent  =  "DIFXAPI_WARNING"; break;
    217         case DIFXAPI_ERROR:     pszEvent  =  "DIFXAPI_ERROR";   break;
    218         default:                pszEvent  =  "DIFXAPI_<unknown>"; break;
    219     }
    220 
    221     /*
    222      * Log to standard output:
    223      */
    224     PrintStr(pszEvent);
    225     if (dwError == 0)
    226         PrintStr(": ");
    227     else
    228     {
    229         PrintStr(": ERROR: ");
    230         PrintX64(dwError);
    231         PrintStr(" - ");
    232     }
    233     PrintWStr(pwszEventDesc);
    234     PrintStr("\r\n");
    235 
    236     /*
    237      * Write to the log file if we have one - have to convert the input to UTF-8.
    238      */
    239     HANDLE const hLogFile = (HANDLE)pvCtx;
    240     if (hLogFile != INVALID_HANDLE_VALUE)
    241     {
    242         /* "event: err - desc\r\n" */
    243         char szBuf[256];
    244         RTStrCopy(szBuf, sizeof(szBuf), pszEvent);
    245         RTStrCat(szBuf, sizeof(szBuf), ": ");
    246         size_t offVal = strlen(szBuf);
    247         RTStrFormatU32(&szBuf[offVal], sizeof(szBuf) - offVal, dwError, 16, 0, 0, dwError ? RTSTR_F_SPECIAL : 0);
    248         RTStrCat(szBuf, sizeof(szBuf), " - ");
    249         DWORD dwIgn;
    250         WriteFile(hLogFile, szBuf, (DWORD)strlen(szBuf), &dwIgn, NULL);
    251 
    252         char *pszUtf8 = NULL;
    253         int vrc = RTUtf16ToUtf8(pwszEventDesc, &pszUtf8);
    254         if (RT_SUCCESS(vrc))
    255         {
    256             WriteFile(hLogFile, pszUtf8, (DWORD)strlen(pszUtf8), &dwIgn, NULL);
    257             RTStrFree(pszUtf8);
    258             WriteFile(hLogFile, RT_STR_TUPLE("\r\n"), &dwIgn, NULL);
    259         }
    260         else
    261             WriteFile(hLogFile, RT_STR_TUPLE("<RTUtf16ToUtf8 failed>\r\n"), &dwIgn, NULL);
    262     }
    263 }
    264 
    265 
    266 /**
    267  * Writes a header to the DIFx log file.
    268  */
    269 static void VBoxDIFxWriteLogHeader(HANDLE hLogFile, char const *pszOperation, wchar_t const *pwszInfFile)
    270 {
    271     /* Don't want to use RTStrPrintf here as it drags in a lot of code, thus this tedium... */
    272     char   szBuf[256];
    273     size_t offBuf = 2;
    274     RTStrCopy(szBuf, sizeof(szBuf), "\r\n");
    275 
    276     SYSTEMTIME SysTime = {0};
    277     GetSystemTime(&SysTime);
    278 
    279     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wYear, 10, 4, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    280     offBuf += strlen(&szBuf[offBuf]);
    281     szBuf[offBuf++] = '-';
    282 
    283     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wMonth, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    284     offBuf += strlen(&szBuf[offBuf]);
    285     szBuf[offBuf++] = '-';
    286 
    287     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wDay, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    288     offBuf += strlen(&szBuf[offBuf]);
    289     szBuf[offBuf++] = 'T';
    290 
    291     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wHour, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    292     offBuf += strlen(&szBuf[offBuf]);
    293     szBuf[offBuf++] = ':';
    294 
    295     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wMinute, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    296     offBuf += strlen(&szBuf[offBuf]);
    297     szBuf[offBuf++] = ':';
    298 
    299     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wSecond, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    300     offBuf += strlen(&szBuf[offBuf]);
    301     szBuf[offBuf++] = '.';
    302 
    303     RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wMilliseconds, 10, 3, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
    304     offBuf += strlen(&szBuf[offBuf]);
    305     RTStrCat(&szBuf[offBuf], sizeof(szBuf) - offBuf, "Z: Opened log file for ");
    306     RTStrCat(&szBuf[offBuf], sizeof(szBuf) - offBuf, pszOperation);
    307     RTStrCat(&szBuf[offBuf], sizeof(szBuf) - offBuf, " of '");
    308 
    309     DWORD dwIgn;
    310     WriteFile(hLogFile, szBuf, (DWORD)strlen(szBuf), &dwIgn, NULL);
    311 
    312     char *pszUtf8 = NULL;
    313     int vrc = RTUtf16ToUtf8(pwszInfFile, &pszUtf8);
    314     if (RT_SUCCESS(vrc))
    315     {
    316         WriteFile(hLogFile, pszUtf8, (DWORD)strlen(pszUtf8), &dwIgn, NULL);
    317         RTStrFree(pszUtf8);
    318         WriteFile(hLogFile, RT_STR_TUPLE("'\r\n"), &dwIgn, NULL);
    319     }
    320     else
    321         WriteFile(hLogFile, RT_STR_TUPLE("<RTUtf16ToUtf8 failed>'\r\n"), &dwIgn, NULL);
    322 }
    323159
    324160#ifdef RT_ARCH_X86
     
    618454}
    619455
    620 
    621 /**
    622  * Installs or uninstalls a driver.
     456/**
     457 * Logging callback for the Windows driver (un)installation code.
     458 */
     459static DECLCALLBACK(void) vboxWinDrvInstLogCallback(VBOXWINDRIVERLOGTYPE enmType, const char *pszMsg, void *pvUser)
     460{
     461    HANDLE const hLog = (HANDLE)pvUser;
     462
     463    /*
     464     * Log to standard output:
     465     */
     466    switch (enmType)
     467    {
     468        case VBOXWINDRIVERLOGTYPE_ERROR:
     469            PrintSSS("*** Error: ", pszMsg, "\r\n");
     470            break;
     471
     472        default:
     473            PrintSS(pszMsg, "\r\n");
     474            break;
     475    }
     476
     477    /*
     478     * Log to file (if any):
     479     */
     480    if (hLog != INVALID_HANDLE_VALUE)
     481    {
     482        char szBuf[1024];
     483        RTStrCopy(szBuf, sizeof(szBuf), enmType == VBOXWINDRIVERLOGTYPE_ERROR ? "*** Error: " : "");
     484        DWORD dwIgn;
     485        WriteFile(hLog, szBuf, (DWORD)strlen(szBuf), &dwIgn, NULL);
     486        WriteFile(hLog, pszMsg, (DWORD)strlen(pszMsg), &dwIgn, NULL);
     487        WriteFile(hLog, RT_STR_TUPLE("\r\n"), &dwIgn, NULL);
     488    }
     489}
     490
     491/**
     492 * Writes the driver log file header.
    623493 *
    624  * @return  Exit code (EXIT_OK, EXIT_FAIL)
    625  * @param   fInstall            Set to @c true for installation, and @c false
    626  *                              for uninstallation.
    627  * @param   pwszDriverPath      Path to the driver's .INF file.
    628  * @param   fSilent             Set to @c true for silent installation.
    629  * @param   pwszLogFile         Pointer to full qualified path to log file to be
    630  *                              written during installation. Optional.
    631  */
    632 static int VBoxInstallDriver(const BOOL fInstall, const wchar_t *pwszDriverPath, bool fSilent, const wchar_t *pwszLogFile)
    633 {
    634     /*
    635      * Windows 2000 and later.
    636      */
    637     OSVERSIONINFOW VerInfo = { sizeof(VerInfo) };
    638     GetVersionExW(&VerInfo);
    639     if (VerInfo.dwPlatformId != VER_PLATFORM_WIN32_NT)
    640         return ErrorMsg("Platform not supported for driver (un)installation!");
    641     if (VerInfo.dwMajorVersion < 5)
    642         return ErrorMsg("Platform too old to be supported for driver (un)installation!");
    643 
    644     /*
    645      * Get the full path to the INF file.
    646      */
    647     wchar_t wszFullDriverInf[MAX_PATH];
    648     if (GetFullPathNameW(pwszDriverPath, MAX_PATH, wszFullDriverInf, NULL) ==0 )
    649         return ErrorMsgLastErrSWS("GetFullPathNameW failed on '", pwszDriverPath, "'");
    650 
    651     /*
    652      * Load DIFxAPI.dll from our application directory and resolve the symbols we need
    653      * from it.  We always resolve all for reasons of simplicity and general paranoia.
    654      */
    655     HMODULE hModDifXApi = LoadAppDll(L"DIFxAPI.dll");
    656     if (!hModDifXApi)
    657         return EXIT_FAIL;
    658 
    659     static struct { FARPROC *ppfn; const char *pszName; } const s_aFunctions[] =
    660     {
    661         { (FARPROC *)&g_pfnDriverPackageInstall,   "DriverPackageInstallW" },
    662         { (FARPROC *)&g_pfnDriverPackageUninstall, "DriverPackageUninstallW" },
    663         { (FARPROC *)&g_pfnDIFXAPISetLogCallback,  "DIFXAPISetLogCallbackW" },
    664     };
    665     for (size_t i = 0; i < RT_ELEMENTS(s_aFunctions); i++)
    666     {
    667         FARPROC pfn = *s_aFunctions[i].ppfn = GetProcAddress(hModDifXApi, s_aFunctions[i].pszName);
    668         if (!pfn)
    669             return ErrorMsgLastErrSSS("Failed to find symbol '", s_aFunctions[i].pszName, "' in DIFxAPI.dll");
    670     }
    671 
    672     /*
    673      * Try open the log file and register a logger callback with DIFx.
    674      * Failures here are non-fatal.
    675      */
    676     HANDLE hLogFile = INVALID_HANDLE_VALUE;
     494 * @returns VBox status code.
     495 * @param   hLog                Handle to log file.
     496 * @param   pwszInfFile         INF file this log belongs to.
     497 */
     498static void driverLogWriteHeader(HANDLE hLog, const wchar_t *pwszInfFile)
     499{
     500    /* Don't want to use RTStrPrintf here as it drags in a lot of code, thus this tedium... */
     501    char   szBuf[256];
     502    size_t offBuf = 2;
     503    RTStrCopy(szBuf, sizeof(szBuf), "\r\n");
     504
     505    SYSTEMTIME SysTime = {0};
     506    GetSystemTime(&SysTime);
     507
     508    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wYear, 10, 4, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     509    offBuf += strlen(&szBuf[offBuf]);
     510    szBuf[offBuf++] = '-';
     511
     512    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wMonth, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     513    offBuf += strlen(&szBuf[offBuf]);
     514    szBuf[offBuf++] = '-';
     515
     516    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wDay, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     517    offBuf += strlen(&szBuf[offBuf]);
     518    szBuf[offBuf++] = 'T';
     519
     520    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wHour, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     521    offBuf += strlen(&szBuf[offBuf]);
     522    szBuf[offBuf++] = ':';
     523
     524    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wMinute, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     525    offBuf += strlen(&szBuf[offBuf]);
     526    szBuf[offBuf++] = ':';
     527
     528    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wSecond, 10, 2, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     529    offBuf += strlen(&szBuf[offBuf]);
     530    szBuf[offBuf++] = '.';
     531
     532    RTStrFormatU32(&szBuf[offBuf], sizeof(szBuf) - offBuf, SysTime.wMilliseconds, 10, 3, 0, RTSTR_F_ZEROPAD | RTSTR_F_WIDTH);
     533    offBuf += strlen(&szBuf[offBuf]);
     534    RTStrCat(&szBuf[offBuf], sizeof(szBuf) - offBuf, "Z: Opened log file ");
     535
     536    DWORD dwIgn;
     537    WriteFile(hLog, szBuf, (DWORD)strlen(szBuf), &dwIgn, NULL);
     538
     539    char *pszUtf8 = NULL;
     540    int vrc = RTUtf16ToUtf8(pwszInfFile, &pszUtf8);
     541    if (RT_SUCCESS(vrc))
     542    {
     543        WriteFile(hLog, pszUtf8, (DWORD)strlen(pszUtf8), &dwIgn, NULL);
     544        RTStrFree(pszUtf8);
     545        WriteFile(hLog, RT_STR_TUPLE("'\r\n"), &dwIgn, NULL);
     546    }
     547    else
     548        WriteFile(hLog, RT_STR_TUPLE("<RTUtf16ToUtf8 failed>'\r\n"), &dwIgn, NULL);
     549}
     550
     551/**
     552 * Opens (creates / appends) the driver (un)installation log.
     553 *
     554 * @returns VBox status code.
     555 * @param   pwszLogFile         Path to log file to create / open. If set to NULL, no logging will be performed.
     556 * @param   phLog               Where to return the log handle on success.
     557 */
     558static int driverLogOpen(const wchar_t *pwszLogFile, PHANDLE phLog)
     559{
     560    int rc = VINF_SUCCESS;
     561
     562    /* Failures here are non-fatal. */
    677563    if (pwszLogFile)
    678564    {
    679         hLogFile = CreateFileW(pwszLogFile, FILE_GENERIC_WRITE & ~FILE_WRITE_DATA /* append mode */, FILE_SHARE_READ,
    680                                NULL /*pSecAttr*/, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL /*hTemplateFile*/);
    681         if (hLogFile != INVALID_HANDLE_VALUE)
    682             VBoxDIFxWriteLogHeader(hLogFile, fInstall ? "install" : "uninstall", pwszDriverPath);
     565        HANDLE hLog = INVALID_HANDLE_VALUE;
     566        hLog = CreateFileW(pwszLogFile, FILE_GENERIC_WRITE & ~FILE_WRITE_DATA /* append mode */, FILE_SHARE_READ,
     567                           NULL /*pSecAttr*/, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL /*hTemplateFile*/);
     568        if (hLog != INVALID_HANDLE_VALUE)
     569        {
     570            driverLogWriteHeader(hLog, pwszLogFile);
     571
     572            *phLog = hLog;
     573        }
    683574        else
     575        {
    684576            ErrorMsgLastErrSWS("Failed to open/create log file '", pwszLogFile, "'");
    685         g_pfnDIFXAPISetLogCallback(VBoxDIFxLogCallback, (void *)hLogFile);
    686     }
    687 
    688     PrintStr(fInstall ? "Installing driver ...\r\n" : "Uninstalling driver ...\r\n");
    689     PrintSWS("INF-File: '", wszFullDriverInf, "'\r\n");
    690 #ifdef RT_ARCH_X86
    691     InstallWinVerifyTrustInterceptorInSetupApi();
    692 #endif
    693 
    694     INSTALLERINFO InstInfo =
    695     {
    696         L"{7d2c708d-c202-40ab-b3e8-de21da1dc629}", /* Our GUID for representing this installation tool. */
    697         L"VirtualBox Guest Additions Install Helper",
    698         L"VirtualBox Guest Additions", /** @todo Add version! */
    699         L"Oracle Corporation"
    700     };
    701 
    702     /* Flags */
    703     DWORD dwFlags = DRIVER_PACKAGE_FORCE;
    704     if (!fInstall)
    705         dwFlags |= DRIVER_PACKAGE_DELETE_FILES;
    706     if (VerInfo.dwMajorVersion < 6 && fInstall)
    707     {
    708         PrintStr("Using legacy mode for install ...\r\n");
    709         dwFlags |= DRIVER_PACKAGE_LEGACY_MODE;
    710     }
    711     if (fSilent)
    712     {
    713         /* Don't add DRIVER_PACKAGE_SILENT to dwFlags here, otherwise the
    714            installation will fail because we don't have WHQL certified drivers.
    715            See CERT_E_WRONG_USAGE on MSDN for more information. */
    716         PrintStr("Installation is silent ...\r\n");
    717     }
    718 
    719     /* Do the install/uninstall: */
    720     BOOL  fReboot = FALSE;
    721     DWORD dwErr;
    722     if (fInstall)
    723         dwErr = g_pfnDriverPackageInstall(wszFullDriverInf, dwFlags, &InstInfo, &fReboot);
    724     else
    725         dwErr = g_pfnDriverPackageUninstall(wszFullDriverInf, dwFlags, &InstInfo, &fReboot);
    726 
    727     /*
    728      * Report error
    729      */
    730     int         rcExit = EXIT_FAIL;
    731     const char *psz    = NULL;
    732     switch (dwErr)
    733     {
    734         case ERROR_SUCCESS:
    735             rcExit = EXIT_OK;
    736             break;
    737 
    738         case CRYPT_E_FILE_ERROR:
    739             psz = "The catalog file for the specified driver package was not found!";
    740             break;
    741         case ERROR_ACCESS_DENIED:
    742             psz = fInstall ? "Caller is not in Administrators group to install this driver package!"
    743                            : "Caller is not in Administrators group to uninstall this driver package!";
    744             break;
    745         case ERROR_BAD_ENVIRONMENT:
    746             psz = "The current Microsoft Windows version does not support this operation!";
    747             break;
    748         case ERROR_CANT_ACCESS_FILE:
    749             psz = "The driver package files could not be accessed!";
    750             break;
    751         case ERROR_DEPENDENT_APPLICATIONS_EXIST:
    752             psz = "DriverPackageUninstall removed an association between the driver package and the specified application but the function did not uninstall the driver package because other applications are associated with the driver package!";
    753             break;
    754         case ERROR_DRIVER_PACKAGE_NOT_IN_STORE:
    755             psz = fInstall ? "There is no INF file in the DIFx driver store that corresponds to the INF file being installed!"
    756                            : "There is no INF file in the DIFx driver store that corresponds to the INF file being uninstalled!";
    757             break;
    758         case ERROR_FILE_NOT_FOUND:
    759             psz = "INF-file not found!";
    760             break;
    761         case ERROR_IN_WOW64:
    762             psz = "The calling application is a 32-bit application attempting to execute in a 64-bit environment, which is not allowed!";
    763             break;
    764         case ERROR_INVALID_FLAGS:
    765             psz = "The flags specified are invalid!";
    766             break;
    767         case ERROR_INSTALL_FAILURE:
    768             psz = fInstall ? "The install operation failed! Consult the Setup API logs for more information."
    769                            : "The uninstall operation failed! Consult the Setup API logs for more information.";
    770             break;
    771         case ERROR_NO_MORE_ITEMS:
    772             psz = "The function found a match for the HardwareId value, but the specified driver was not a better match than the current driver and the caller did not specify the INSTALLFLAG_FORCE flag!";
    773             break;
    774         case ERROR_NO_DRIVER_SELECTED:
    775             psz = "No driver in .INF-file selected!";
    776             break;
    777         case ERROR_SECTION_NOT_FOUND:
    778             psz = "Section in .INF-file was not found!";
    779             break;
    780         case ERROR_SHARING_VIOLATION:
    781             psz = "A component of the driver package in the DIFx driver store is locked by a thread or process!";
    782             break;
    783 
    784         /*
    785          * !    sig:           Verifying file against specific Authenticode(tm) catalog failed! (0x800b0109)
    786          * !    sig:           Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
    787          * !!!  sto:           No error message will be displayed as client is running in non-interactive mode.
    788          * !!!  ndv:           Driver package failed signature validation. Error = 0xE0000247
    789          */
    790         case ERROR_DRIVER_STORE_ADD_FAILED:
    791             psz = "Adding driver to the driver store failed!!";
    792             break;
    793         case ERROR_UNSUPPORTED_TYPE:
    794             psz = "The driver package type is not supported of INF-file!";
    795             break;
    796         case ERROR_NO_SUCH_DEVINST:
    797             psz = "The driver package was installed but no matching devices found in the device tree (ERROR_NO_SUCH_DEVINST).";
    798             /* GA installer should ignore this error code and continue */
    799             rcExit = EXIT_OK;
    800             break;
    801 
    802         default:
    803         {
    804             /* Try error lookup with GetErrorMsg(). */
    805             ErrorMsgSWS(fInstall ? "Installation of '" : "Uninstallation of '", wszFullDriverInf, "' failed!");
    806             ErrorMsgBegin("dwErr=");
    807             ErrorMsgErrVal(dwErr, false);
    808             WCHAR wszErrMsg[1024];
    809             if (GetErrorMsg(dwErr, wszErrMsg, RT_ELEMENTS(wszErrMsg)))
    810             {
    811                 ErrorMsgStr(": ");
    812                 ErrorMsgWStr(wszErrMsg);
    813             }
    814             ErrorMsgEnd(NULL);
    815             break;
    816         }
    817     }
    818     if (psz)
    819     {
    820         ErrorMsgSWS(fInstall ? "Installation of '" : "Uninstallation of '", wszFullDriverInf, "' failed!");
    821         ErrorMsgBegin("dwErr=");
    822         ErrorMsgErrVal(dwErr, false);
    823         ErrorMsgStr(": ");
    824         ErrorMsgEnd(psz);
    825     }
    826 
    827     /* Close the log file. */
    828     if (pwszLogFile)
    829     {
    830         g_pfnDIFXAPISetLogCallback(NULL, NULL);
    831         if (hLogFile != INVALID_HANDLE_VALUE)
    832             CloseHandle(hLogFile);
    833     }
    834     if (rcExit == EXIT_OK)
    835     {
    836         PrintStr(fInstall ? "Driver was installed successfully!\r\n"
    837                           : "Driver was uninstalled successfully!\r\n");
    838         if (fReboot)
    839         {
    840             PrintStr(fInstall ? "A reboot is needed to complete the driver installation!\r\n"
    841                               : "A reboot is needed to complete the driver uninstallation!\r\n");
    842             /** @todo r=bird: We don't set EXIT_REBOOT here for some reason... The
    843              *        ExecuteInf didn't use EXIT_REBOOT either untill the no-CRT rewrite,
    844              *        so perhaps the EXIT_REBOOT stuff can be removed? */
    845         }
    846     }
    847 
    848     return rcExit;
    849 }
    850 
     577            rc = VERR_CANT_CREATE;
     578        }
     579    }
     580
     581    return rc;
     582}
     583
     584/**
     585 * Closes the driver (un)installation log.
     586 *
     587 * @returns VBox status code.
     588 * @param   hLog                Handle of log to close.
     589 */
     590static int driverLogClose(HANDLE hLog)
     591{
     592    if (hLog != INVALID_HANDLE_VALUE)
     593        CloseHandle(hLog);
     594
     595    return VINF_SUCCESS;
     596}
    851597
    852598/** Handles 'driver install'. */
    853599static int handleDriverInstall(unsigned cArgs, wchar_t **papwszArgs)
    854600{
    855     return VBoxInstallDriver(true /*fInstall*/, papwszArgs[0], false /*fSilent*/,
    856                              cArgs > 1 && papwszArgs[1][0] ? papwszArgs[1] : NULL /* pwszLogFile*/);
    857 }
    858 
     601    char *pszInfFile = NULL;
     602    int rc = RTUtf16ToUtf8(papwszArgs[0], &pszInfFile);
     603    if (RT_SUCCESS(rc))
     604    {
     605        char *pszPnpId = NULL; /* PnP ID can be optional. */
     606        if (cArgs >= 2)
     607            rc = RTUtf16ToUtf8(papwszArgs[1], &pszPnpId);
     608        if (RT_SUCCESS(rc))
     609        {
     610            HANDLE hLog = INVALID_HANDLE_VALUE;
     611            if (cArgs >= 3)
     612                /* ignore rc, non-fatal */ driverLogOpen(papwszArgs[2], &hLog);
     613#ifdef DEBUG
     614            PrintSSS("INF File: ", pszInfFile, "\r\n");
     615            PrintSSS("  PnP ID: ", pszPnpId ? pszPnpId : "<None>", "\r\n");
     616#endif
     617            VBOXWINDRVINST hWinDrvInst;
     618            rc = VBoxWinDrvInstCreateEx(&hWinDrvInst, 4 /* Verbosity */, &vboxWinDrvInstLogCallback, hLog /* pvUser */);
     619            if (RT_SUCCESS(rc))
     620            {
     621                rc = VBoxWinDrvInstInstall(hWinDrvInst, pszInfFile, pszPnpId,
     622                                           VBOX_WIN_DRIVERINSTALL_F_SILENT | VBOX_WIN_DRIVERINSTALL_F_FORCE);
     623
     624                VBoxWinDrvInstDestroy(hWinDrvInst);
     625            }
     626
     627            driverLogClose(hLog);
     628            hLog = INVALID_HANDLE_VALUE;
     629
     630            RTStrFree(pszPnpId);
     631        }
     632        RTStrFree(pszInfFile);
     633    }
     634
     635    return rc == VINF_REBOOT_NEEDED ? EXIT_REBOOT : RT_SUCCESS(rc) ? EXIT_OK : EXIT_FAIL;
     636}
    859637
    860638/** Handles 'driver uninstall'. */
    861639static int handleDriverUninstall(unsigned cArgs, wchar_t **papwszArgs)
    862640{
    863     return VBoxInstallDriver(false /*fInstall*/, papwszArgs[0], false /*fSilent*/,
    864                              cArgs > 1 && papwszArgs[1][0] ? papwszArgs[1] : NULL /* pwszLogFile*/);
    865 }
    866 
    867 
    868 /**
    869  * Implementes PSP_FILE_CALLBACK_W, used by ExecuteInfFile.
    870  */
    871 static UINT CALLBACK
    872 vboxDrvInstExecuteInfFileCallback(PVOID pvContext, UINT uNotification, UINT_PTR uParam1, UINT_PTR uParam2) RT_NOTHROW_DEF
    873 {
     641    char *pszInfFile = NULL;
     642    int rc = RTUtf16ToUtf8(papwszArgs[0], &pszInfFile);
     643    if (RT_SUCCESS(rc))
     644    {
     645        char *pszModel = NULL; /* Model is optional. */
     646        if (cArgs >= 2)
     647            rc = RTUtf16ToUtf8(papwszArgs[1], &pszModel);
     648        char *pszPnpId = NULL; /* PnP ID is optional. */
     649        if (cArgs >= 3)
     650            rc = RTUtf16ToUtf8(papwszArgs[2], &pszPnpId);
     651        if (RT_SUCCESS(rc))
     652        {
     653            HANDLE hLog = INVALID_HANDLE_VALUE;
     654            if (cArgs >= 3)
     655                /* ignore rc, non-fatal */ driverLogOpen(papwszArgs[2], &hLog);
     656
    874657#ifdef DEBUG
    875     PrintSXS("Got installation notification ", uNotification, "\r\n");
     658            PrintSSS("INF File: ", pszInfFile, "\r\n");
     659            PrintSSS("   Model: ", pszModel ? pszModel : "<None>", "\r\n");
     660            PrintSSS("  PnP ID: ", pszPnpId ? pszPnpId : "<None>", "\r\n");
    876661#endif
    877 
    878     switch (uNotification)
    879     {
    880         case SPFILENOTIFY_NEEDMEDIA:
    881             PrintStr("Requesting installation media ...\r\n");
    882             break;
    883 
    884         case SPFILENOTIFY_STARTCOPY:
    885             PrintStr("Copying driver files to destination ...\r\n");
    886             break;
    887 
    888         case SPFILENOTIFY_TARGETNEWER:
    889         case SPFILENOTIFY_TARGETEXISTS:
    890             return TRUE;
    891     }
    892 
    893     return SetupDefaultQueueCallbackW(pvContext, uNotification, uParam1, uParam2);
    894 }
    895 
    896 
    897 /**
    898  * Executes a specific .INF section to install/uninstall drivers and/or
    899  * services.
    900  *
    901  * @return  Exit code (EXIT_OK, EXIT_FAIL, EXIT_REBOOT)
    902  * @param   pwszSection Section to execute; usually it's L"DefaultInstall".
    903  * @param   pwszInf     Path of the .INF file to use.
    904  */
    905 static int ExecuteInfFile(const wchar_t *pwszSection, const wchar_t *pwszInf)
    906 {
    907     PrintSWSWS("Installing from INF-File: '", pwszInf, "', Section: '", pwszSection, "' ...\r\n");
    908 #ifdef RT_ARCH_X86
    909     InstallWinVerifyTrustInterceptorInSetupApi();
    910 #endif
    911 
    912     UINT uErrorLine = 0;
    913     HINF hInf = SetupOpenInfFileW(pwszInf, NULL, INF_STYLE_WIN4, &uErrorLine);
    914     if (hInf == INVALID_HANDLE_VALUE)
    915         return ErrorMsgLastErrSWSRSUS("SetupOpenInfFileW failed to open '", pwszInf, "' ", ", error line ", uErrorLine, NULL);
    916 
    917     int   rcExit  = EXIT_FAIL;
    918     PVOID pvQueue = SetupInitDefaultQueueCallback(NULL);
    919     if (pvQueue)
    920     {
    921         if (SetupInstallFromInfSectionW(NULL /*hWndOwner*/, hInf, pwszSection, SPINST_ALL, HKEY_LOCAL_MACHINE,
    922                                         NULL /*pwszSrcRootPath*/, SP_COPY_NEWER_OR_SAME | SP_COPY_NOSKIP,
    923                                         vboxDrvInstExecuteInfFileCallback, pvQueue, NULL /*hDevInfoSet*/, NULL /*pDevInfoData*/))
    924         {
    925             PrintStr("File installation stage successful\r\n");
    926 
    927             if (SetupInstallServicesFromInfSectionW(hInf, L"DefaultInstall.Services", 0 /* Flags */))
     662            VBOXWINDRVINST hWinDrvInst;
     663            rc = VBoxWinDrvInstCreateEx(&hWinDrvInst, 4 /* Verbosity */, &vboxWinDrvInstLogCallback, hLog /* pvUser */);
     664            if (RT_SUCCESS(rc))
    928665            {
    929                 PrintStr("Service installation stage successful. Installation completed.\r\n");
    930                 rcExit = EXIT_OK;
     666                rc = VBoxWinDrvInstUninstall(hWinDrvInst, pszInfFile, pszModel, pszPnpId,
     667                                             VBOX_WIN_DRIVERINSTALL_F_SILENT | VBOX_WIN_DRIVERINSTALL_F_FORCE);
     668
     669                VBoxWinDrvInstDestroy(hWinDrvInst);
    931670            }
    932             else if (GetLastError() == ERROR_SUCCESS_REBOOT_REQUIRED)
    933             {
    934                 PrintStr("A reboot is required to complete the installation\r\n");
    935                 rcExit = EXIT_REBOOT;
    936             }
    937             else
    938                 ErrorMsgLastErrSWSWS("SetupInstallServicesFromInfSectionW failed on '", pwszSection, "' in '", pwszInf, "'");
    939         }
    940         SetupTermDefaultQueueCallback(pvQueue);
    941     }
    942     else
    943         ErrorMsgLastErr("SetupInitDefaultQueueCallback failed");
    944     SetupCloseInfFile(hInf);
    945     return rcExit;
     671
     672            driverLogClose(hLog);
     673            hLog = INVALID_HANDLE_VALUE;
     674
     675            RTStrFree(pszPnpId);
     676        }
     677        RTStrFree(pszInfFile);
     678    }
     679
     680    return rc == VINF_REBOOT_NEEDED ? EXIT_REBOOT : RT_SUCCESS(rc) ? EXIT_OK : EXIT_FAIL;
    946681}
    947682
     
    950685static int handleDriverExecuteInf(unsigned cArgs, wchar_t **papwszArgs)
    951686{
    952     RT_NOREF(cArgs);
    953     return ExecuteInfFile(L"DefaultInstall", papwszArgs[0]);
     687    char *pszInfFile = NULL;
     688    int rc = RTUtf16ToUtf8(papwszArgs[0], &pszInfFile);
     689    if (RT_SUCCESS(rc))
     690    {
     691        char *pszSection = NULL; /* Section is optional. */
     692        if (cArgs >= 2)
     693            rc = RTUtf16ToUtf8(papwszArgs[1], &pszSection);
     694        if (RT_SUCCESS(rc))
     695        {
     696            HANDLE hLog = INVALID_HANDLE_VALUE;
     697            if (cArgs >= 3)
     698                /* ignore rc, non-fatal */ driverLogOpen(papwszArgs[2], &hLog);
     699
     700#ifdef DEBUG
     701            PrintSSS("INF File: ", pszInfFile, "\r\n");
     702            PrintSSS(" Section: ", pszSection ? pszSection : "DefaultInstall", "\r\n");
     703#endif
     704            VBOXWINDRVINST hWinDrvInst;
     705            rc = VBoxWinDrvInstCreateEx(&hWinDrvInst, 4 /* Verbosity */, &vboxWinDrvInstLogCallback, hLog /* pvUser */);
     706            if (RT_SUCCESS(rc))
     707            {
     708                rc = VBoxWinDrvInstInstallExecuteInf(hWinDrvInst, pszInfFile, pszSection ? pszSection : "DefaultInstall",
     709                                                     VBOX_WIN_DRIVERINSTALL_F_SILENT | VBOX_WIN_DRIVERINSTALL_F_FORCE);
     710                VBoxWinDrvInstDestroy(hWinDrvInst);
     711            }
     712
     713            driverLogClose(hLog);
     714            hLog = INVALID_HANDLE_VALUE;
     715        }
     716        RTStrFree(pszInfFile);
     717    }
     718
     719    return rc == VINF_REBOOT_NEEDED ? EXIT_REBOOT : RT_SUCCESS(rc) ? EXIT_OK : EXIT_FAIL;
    954720}
    955721
     
    24582224             "\r\n"
    24592225             "Drivers:\r\n"
    2460              "    VBoxDrvInst driver install <inf-file> [log-file]\r\n"
    2461              "    VBoxDrvInst driver uninstall <inf-file> [log-file]\r\n"
    2462              "    VBoxDrvInst driver executeinf <inf-file>\r\n"
     2226             "    VBoxDrvInst driver install <inf-file> [pnp-id] [log-file]\r\n"
     2227             "    VBoxDrvInst driver uninstall <inf-file> <model> [pnp-id] [log-file]\r\n"
     2228             "    VBoxDrvInst driver executeinf <inf-file> [section]\r\n"
    24632229             "    VBoxDrvInst driver nt4-install-video [install-dir]\r\n"
    24642230             "\r\n"
     
    24942260int wmain(int argc, wchar_t **argv)
    24952261{
    2496     /* Not initializing IPRT here, ASSUMING the little bit we use of it does
    2497        not need any initialization.  Reduces the binary size a little. */
     2262    int rc = RTR3InitExeNoArguments(0);
     2263    if (RT_FAILURE(rc))
     2264        return RTMsgInitFailure(rc);
    24982265
    24992266    static struct
     
    25052272    } s_aActions[] =
    25062273    {
    2507         { "driver",         "install",              1,  2, handleDriverInstall },
    2508         { "driver",         "uninstall",            1,  2, handleDriverUninstall },
    2509         { "driver",         "executeinf",           1,  1, handleDriverExecuteInf },
     2274        { "driver",         "install",              1,  3, handleDriverInstall },
     2275        { "driver",         "uninstall",            2,  4, handleDriverUninstall },
     2276        { "driver",         "executeinf",           1,  3, handleDriverExecuteInf },
    25102277        { "driver",         "nt4-install-video",    0,  1, handleDriverNt4InstallVideo },
    25112278        { "service",        "create",               5,  9, handleServiceCreate },
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh

    r106061 r106321  
    5656!endif
    5757
    58   FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
    5958  FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
    6059
     
    215214  SetOutPath "$0\Tools"
    216215  FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
    217   FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
    218216!ifdef VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
    219217  FILE "$%PATH_OUT%\bin\additions\VBoxAudioTest.exe"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstall.nsh

    r106061 r106321  
    3535  ; Remove common files
    3636  Delete /REBOOTOK "$INSTDIR\VBoxDrvInst.exe"
    37   Delete /REBOOTOK "$INSTDIR\DIFxAPI.dll"
    3837
    3938  Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
     
    132131exit:
    133132
     133  ;
     134  ; Dump UI log to on success too. Only works with non-silent installs.
     135  ; (This has to be done here rather than in .onUninstSuccess, because by
     136  ; then the log is no longer visible in the UI.)
     137  ;
     138  ${IfNot} ${Silent}
     139  !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
     140    VBoxGuestInstallHelper::DumpLog "$TEMP\vbox_uninstall_ui.log"
     141  !else
     142    StrCpy $0 "$TEMP\vbox_uninstall_ui.log"
     143    Push $0
     144    Call DumpLog
     145  !endif
     146  ${EndIf}
     147
    134148FunctionEnd
    135149!macroend
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh

    r106061 r106321  
    344344  !endif
    345345  ${EndIf}
    346 
    347   ; Log the certificates present on the system.
    348   ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" display-all" 'non-zero-exitcode=log'
    349346!endif ; VBOX_SIGN_ADDITIONS
    350347
     
    514511  ${If} $g_bNoGuestDrv == "false"
    515512    ${LogVerbose} "Installing guest driver ..."
    516     ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest$g_strEarlyNTDrvInfix.inf$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
     513    ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest$g_strEarlyNTDrvInfix.inf$\" $\"PCI\VEN_80EE&DEV_CAFE$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    517514  ${Else}
    518515    ${LogVerbose} "Guest driver installation skipped!"
     
    522519    ${If} $g_bWithWDDM == "true"
    523520      ${LogVerbose} "Installing WDDM video driver..."
    524       ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
     521      ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxWddm.inf$\" $\"$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    525522    ${Else}
    526523      ${LogVerbose} "Installing video driver ..."
    527       ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo$g_strEarlyNTDrvInfix.inf$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
     524      ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo$g_strEarlyNTDrvInfix.inf$\" $\"$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    528525    ${EndIf}
    529526  ${Else}
     
    536533  ${If} $g_bNoMouseDrv == "false"
    537534    ${LogVerbose} "Installing mouse driver ..."
    538     ; The mouse filter does not contain any device IDs but a "DefaultInstall" section;
    539     ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented
    540     ; with VBoxDrvInst's "driver executeinf" routine
    541     ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxMouse.inf$\"" 'non-zero-exitcode=abort'
     535    ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver executeinf $\"$INSTDIR\VBoxMouse.inf$\" $\"DefaultInstall.NT$%KBUILD_TARGET_ARCH%$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    542536  ${Else}
    543537    ${LogVerbose} "Mouse driver installation skipped!"
     
    690684  ; Remove VirtualBox video driver
    691685  ${LogVerbose} "Uninstalling video driver ..."
    692   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo$g_strEarlyNTDrvInfix.inf$\"" 'non-zero-exitcode=log'
     686  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo$g_strEarlyNTDrvInfix.inf$\" $\"VBoxVideo*$\"" 'non-zero-exitcode=log'
    693687  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" 'non-zero-exitcode=log'
    694688  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
     
    699693
    700694  ${LogVerbose} "Uninstalling WDDM video driver..."
    701   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxWddm.inf$\"" 'non-zero-exitcode=log'
     695  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxWddm.inf$\" $\"VBoxWddm*$\"" 'non-zero-exitcode=log'
    702696  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxWddm" 'non-zero-exitcode=log'
    703697  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
     
    707701  ; Obsolete files begin
    708702  ${LogVerbose} "Uninstalling WDDM video driver for Windows 8..."
    709   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" 'non-zero-exitcode=log'
     703  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\" $\"VBoxVideoW8*$\"" 'non-zero-exitcode=log'
    710704  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" 'non-zero-exitcode=log'
    711705  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
     
    714708
    715709  ${LogVerbose} "Uninstalling WDDM video driver for Windows Vista and 7..."
    716   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" 'non-zero-exitcode=log'
     710  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\" $\"VBoxVideoWddm*$\"" 'non-zero-exitcode=log'
    717711  ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
    718712  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" 'non-zero-exitcode=log'
     
    751745  ; Remove mouse driver
    752746  ${LogVerbose} "Removing mouse driver ..."
    753   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" 'non-zero-exitcode=log'
    754   Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
     747  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxMouse.inf$\" $\"VBoxMouse*$\"" 'non-zero-exitcode=log'
     748  ; @todo Fix VBoxMouse.inf to also take care of the next line!
    755749  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" 'non-zero-exitcode=log'
    756750
     
    776770  ; Remove guest driver
    777771  ${LogVerbose} "Removing guest driver ..."
    778   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest$g_strEarlyNTDrvInfix.inf$\"" 'non-zero-exitcode=log'
     772  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest$g_strEarlyNTDrvInfix.inf$\" $\"VBoxGuest*$\"" 'non-zero-exitcode=log'
    779773
    780774  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" 'non-zero-exitcode=log'
  • trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMouse.inf

    r106061 r106321  
    3434;edit-DriverVer=08/26/2008,2.00.0000
    3535;cat CatalogFile=VBoxMouse.cat
     36;PnpLockdown=1
    3637
    3738[SourceDisksNames]
    38 1 = %VBoxMouse.MediaDesc%
     391 = %VBoxMouse_DiskDesc%,,,
    3940
    4041[SourceDisksFiles]
     
    4445DefaultDestDir = 12     ; DIRID_DRIVERS
    4546
    46 ; Disabled install via [Manufacturer], not working. See [DefaultInstall].
    47 ;[Manufacturer]
    48 ;%ORACLE%=VBoxMouse@COMMA-NT-ARCH@
    49 ;
    50 ;[VBoxMouse@DOT-NT-ARCH@]
    51 ;%VBoxMouse.SvcDesc%=VBoxMouse_Install
    52 ;
    53 ;[VBoxMouse_Install]
    54 ;CopyFiles = @VBoxMouse.sys
    55 ;
    56 ;[VBoxMouse_Install.Services]
    57 ;AddService = VBoxMouse,,VBoxMouse.Service
     47; Do *not* add a [Manufacturer] section, as this is a so-called "primitive driver".
     48; Adding such a section will make InfVerif.exe fail.
    5849
    5950[DefaultInstall@DOT-NT-ARCH@]
    60 CopyFiles = @VBoxMouse.sys
     51%ORACLE%=VBoxMouse@COMMA-NT-ARCH@
     52CopyFiles = VBoxMouse_CopyFiles
    6153
    6254[DefaultInstall@[email protected]]
    63 AddService = VBoxMouse,,VBoxMouse.Service
     55AddService = VBoxMouse,0x00000002,VBoxMouse_Service
    6456
    65 [VBoxMouse.AddRegistry]
     57[DefaultUninstall@DOT-NT-ARCH@]
     58[email protected]
     59LegacyUninstall=1
     60
     61[DefaultUninstall@[email protected]]
     62DelService = VBoxMouse,0x00000200
     63LegacyUninstall = 1
     64
     65[VBoxMouse_AddReg]
    6666HKLM, System\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}, UpperFilters, 0x00010000, "VBoxMouse", "mouclass"
    6767
    68 [VBoxMouse.Service]
    69 DisplayName    = %VBoxMouse.SvcDesc%
     68[VBoxMouse_CopyFiles]
     69VBoxMouse.sys
     70
     71[VBoxMouse_Service]
     72DisplayName    = %VBoxMouse_SvcDesc%
    7073ServiceType    = %SERVICE_KERNEL_DRIVER%
    7174StartType      = %SERVICE_DEMAND_START%
    7275ErrorControl   = %SERVICE_ERROR_IGNORE%
    7376ServiceBinary  = %12%\VBoxMouse.sys
    74 AddReg         = VBoxMouse.AddRegistry
     77AddReg         = VBoxMouse_AddReg
    7578
    7679[Strings]
    77 VBoxMouse.SvcDesc       = "VirtualBox Guest Mouse Service"
    78 VBoxMouse.MediaDesc     = "VirtualBox Guest Mouse Driver Installation Media"
    79 ORACLE                  = "Oracle Corporation"
     80ORACLE = "Oracle Corporation"
     81VBoxMouse_SvcDesc  ="VirtualBox Guest Mouse Service"
     82VBoxMouse_DrvDesc  ="VirtualBox Guest Mouse Driver"
     83VBoxMouse_DiskDesc ="VBoxMouse Installation Disk"
    8084
    8185; Useful constants
     
    8387SERVICE_DEMAND_START  = 3
    8488SERVICE_ERROR_IGNORE  = 0
     89SERVICE_ERROR_NORMAL  = 1
     90
  • trunk/src/VBox/Additions/WINNT/include/NoCrtOutput.h

    r106240 r106321  
    489489
    490490
     491DECLINLINE(void) PrintSS(const char *pszMsg1, const char *pszMsg2)
     492{
     493    PrintStr(pszMsg1);
     494    PrintStr(pszMsg2);
     495}
     496
     497
     498DECLINLINE(void) PrintSSS(const char *pszMsg1, const char *pszMsg2, const char *pszMsg3)
     499{
     500    PrintStr(pszMsg1);
     501    PrintStr(pszMsg2);
     502    PrintStr(pszMsg3);
     503}
     504
     505
    491506DECLINLINE(void) PrintSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3)
    492507{
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r106061 r106321  
    5353 VBoxGuest_NAME.solaris  = vboxguest
    5454 VBoxGuest_INST.darwin   = $(INST_ADDITIONS)VBoxGuest.kext/Contents/MacOS/
    55  if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS) # See Additions/WINNT/Makefile.kmk?
     55 #if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS) # See Additions/WINNT/Makefile.kmk?
    5656  VBoxGuest_INSTTYPE.win = none
    5757  VBoxGuest_DEBUG_INSTTYPE.win = both
    58  endif
     58 #endif
    5959 VBoxGuest_DEFS.haiku    = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
    6060 VBoxGuest_DEFS.solaris  = VBOX_SVN_REV=$(VBOX_SVN_REV)
     
    114114  endif # win
    115115  ifn1of ($(KBUILD_TARGET), linux freebsd netbsd solaris haiku)
    116    VBoxGuest_SOURCES    = VBoxGuest-$(KBUILD_TARGET).cpp
     116   VBoxGuest_SOURCES   += VBoxGuest-$(KBUILD_TARGET).cpp
    117117  else
    118    VBoxGuest_SOURCES    = VBoxGuest-$(KBUILD_TARGET).c
     118   VBoxGuest_SOURCES   += VBoxGuest-$(KBUILD_TARGET).c
    119119   VBoxGuest_$(KBUILD_TARGET).c_DEPS = $(VBOX_SVN_REV_HEADER)
    120120   ifeq ($(KBUILD_TARGET),freebsd)
     
    125125        VBoxGuest.cpp
    126126  VBoxGuest_SOURCES.win += \
     127        win/VBoxGuest.inf \
    127128        win/VBoxGuest.rc
    128129  VBoxGuest_SOURCES.win.x86 += \
  • trunk/src/VBox/Additions/common/VBoxGuest/win/VBoxGuest.inf

    r106208 r106321  
    4343;edit-DriverVer=08/26/2008,2.00.0000
    4444;cat CatalogFile=VBoxGuest.cat
     45;PnpLockdown=1
    4546
    4647[SourceDisksNames]
    47 1 = %VBoxGuest.MediaDesc%
     481 = %VBoxGuest_MediaDesc%,,,
    4849
    4950[SourceDisksFiles]
     
    5354
    5455[DestinationDirs]
    55 DefaultDestDir = 12 ; drivers
     56VBoxGuest_CopyFiles = 12 ; drivers
    5657VBoxTray_CopyFiles = 11 ; system32
    5758
     
    6465[VBoxGuest_Install]
    6566CopyFiles = VBoxGuest_CopyFiles, VBoxTray_CopyFiles
    66 AddReg = VBoxTray_Add_Reg
     67AddReg = VBoxTray_AddReg
    6768
    6869[VBoxGuest_CopyFiles]
     
    7475
    7576[VBoxGuest_Install.Services]
    76 AddService = VBoxGuest, 0x00000002, VBoxGuest_ServiceInstallSection
     77AddService = VBoxGuest, 0x00000002, VBoxGuest_AddService
    7778DelService = VBoxTray, 0x00000004
    7879
    79 [VBoxGuest_ServiceInstallSection]
    80 DisplayName    = %VBoxGuest_svcdesc%
    81 ServiceType    = 0x00000001 ; kernel driver
    82 StartType      = 0x00000000 ; boot start
    83 ErrorControl   = 0x00000001 ; normal error handling
     80[VBoxGuest_AddService]
     81DisplayName    = %VBoxGuest_SvcDesc%
     82ServiceType    = %SERVICE_TYPE_KERNEL_DRIVER%
     83StartType      = %SERVICE_STARTTYPE_BOOT%
     84ErrorControl   = %SERVICE_ERRORCTL_NORMAL%
    8485LoadOrderGroup = Base
    8586ServiceBinary  = %12%\VBoxGuest.sys
    8687
    87 [VBoxTray_Add_Reg]
     88[VBoxTray_AddReg]
    8889HKLM, SOFTWARE\Microsoft\Windows\CurrentVersion\Run, VBoxTray, 0x00020000, %%SystemRoot%%\system32\VBoxTray.exe
    8990
     
    9495ORACLE = "Oracle Corporation"
    9596VBoxGuest.DeviceDesc = "VirtualBox Guest Device"
    96 VBoxGuest_svcdesc = "VirtualBox Guest Driver"
    97 VBoxTray_svcdesc = "VirtualBox Guest Tray"
    98 VBoxGuest.MediaDesc = "VirtualBox Guest Driver Installation Disk"
     97VBoxGuest_SvcDesc = "VirtualBox Guest Driver"
     98VBoxTray_SvcDesc = "VirtualBox Guest Tray"
     99VBoxGuest_MediaDesc = "VirtualBox Guest Driver Installation Disk"
     100
     101; Useful constants
     102SERVICE_TYPE_KERNEL_DRIVER = 1
     103SERVICE_STARTTYPE_BOOT    = 0
     104SERVICE_STARTTYPE_DEMAND  = 3
     105SERVICE_ERRORCTL_IGNORE  = 0
     106SERVICE_ERRORCTL_NORMAL  = 1
     107
  • trunk/src/VBox/HostDrivers/Support/win/VBoxSup.inf

    r106061 r106321  
    4343DriverPackageType=KernelService
    4444;cat CatalogFile=VBoxSup.cat
     45;PnpLockdown=1
    4546
    4647[DestinationDirs]
     
    4849
    4950[DefaultInstall@DOT-NT-ARCH@]
     51%ORACLE%=VBoxSup@COMMA-NT-ARCH@
    5052CopyFiles=VBoxSup_CopyFiles
    5153
     
    6163LegacyUninstall=1
    6264
    63 ;; This does not actually work either (see VBoxUSBMon), though it triggers in the
    64 ;; installer rather at manual installation on my test system (could be polluted & confused).
    65 ;; This may apparently also causes unloading trouble due to 'root\VBoxSup' or something related to that.
    66 ;; [Manufacturer]
    67 ;; %ORACLE%=VBoxSup@COMMA-NT-ARCH@
    68 ;;
    69 ;; ; Models section (referenced by [Manufacturer]).
    70 ;; [VBoxSup@DOT-NT-ARCH@]
    71 ;; %VBoxSup.DRVDESC%=VBoxSup_Install,root\VBoxSup
    72 ;;
    73 ;; [VBoxSup_Install@DOT-NT-ARCH@]
    74 ;; CopyFiles=VBoxSup_CopyFiles
    75 ;;
    76 ;; [VBoxSup_Install@[email protected]]
    77 ;; AddService=VBoxSup,0x00000002,VBoxSup_Service
     65[Manufacturer]
     66%ORACLE%=VBoxSup@COMMA-NT-ARCH@
     67
     68[VBoxSup@DOT-NT-ARCH@]
     69%VBoxSup.DRVDESC%=VBoxSup_Install
     70
     71[VBoxSup_Install@DOT-NT-ARCH@]
     72CopyFiles=VBoxSup_CopyFiles
     73
     74[VBoxSup_Install@[email protected]]
     75AddService=VBoxSup,0x00000002,VBoxSup_Service
    7876
    7977[SourceDisksFiles]
     
    8886[VBoxSup_Service]
    8987DisplayName    = %VBoxSup.SVCDESC%
    90 ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
    91 ;StartType      = 3                  ; SERVICE_DEMAND_START
    92 StartType      = 1                  ; autostart to fix Vista problem
    93 ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
     88ServiceType    = %SERVICE_TYPE_KERNEL_DRIVER%
     89StartType      = %SERVICE_STARTTYPE_AUTO%
     90ErrorControl   = %SERVICE_ERRORCTL_NORMAL%
    9491ServiceBinary  = %12%\VBoxSup.sys
    9592
     
    9996VBoxSup.DRVDESC = "VirtualBox Support Driver"
    10097VBoxSup.DSKDESC = "VirtualBox Support Driver Installation Disk"
     98
     99; Useful constants
     100SERVICE_TYPE_KERNEL_DRIVER = 1
     101SERVICE_STARTTYPE_BOOT = 0
     102SERVICE_STARTTYPE_AUTO = 1
     103SERVICE_STARTTYPE_DEMAND = 3
     104SERVICE_ERRORCTL_IGNORE = 0
     105SERVICE_ERRORCTL_NORMAL = 1
     106
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUSB.inf

    r106061 r106321  
    4242;edit-DriverVer=08/26/2008,2.00.0000
    4343;cat CatalogFile=VBoxUSB.cat
     44;PnpLockdown=1
    4445
    4546[SourceDisksNames]
    46 1=%Disk_Description%,,,
     471=%VBoxUSB_DiskDesc%,,,
    4748
    4849[SourceDisksFiles]
    4950VBoxUSB.sys = 1
     51
     52[DestinationDirs]
     53DefaultDestDir = 10,System32\Drivers
    5054
    5155[Manufacturer]
     
    5357
    5458[VBoxUSB@DOT-NT-ARCH@]
    55 %USB\VID_80EE&PID_CAFE.DeviceDesc%=VBoxUSB.Dev, USB\VID_80EE&PID_CAFE
     59%VBoxUSB_DrvDesc%=VBoxUSBDev,USB\VID_80EE&PID_CAFE
    5660
    57 [DestinationDirs]
    58 VBoxUSB.Files.Ext = 10,System32\Drivers
     61[VBoxUSB@[email protected]s]
     62AddService=VBoxUSB,0x00000002,VBoxUSB_Service,VBoxUSB_AddReg
    5963
    60 [VBoxUSB.Dev.NT]
    61 CopyFiles=VBoxUSB.Files.Ext
     64[VBoxUSBDev@DOT-NT-ARCH@]
     65CopyFiles=VBoxUSB_CopyFiles
    6266
    63 [VBoxUSB.Dev.NT.Services]
    64 Addservice = VBoxUSB, 0x00000002, VBoxUSB.AddService
     67[DefaultUninstall@[email protected]]
     68DelService = VBoxUSB,0x00000200
     69DelReg     = VBoxUSB_Registry
    6570
    66 [VBoxUSB.AddService]
    67 DisplayName    = %VBoxUSB.SvcDesc%
    68 ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
    69 StartType      = 3                  ; SERVICE_DEMAND_START
    70 ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
     71[VBoxUSB_Service]
     72DisplayName    = %VBoxUSB_SvcDesc%
     73ServiceType    = %SERVICE_TYPE_KERNEL_DRIVER%
     74StartType      = %SERVICE_STARTTYPE_DEMAND%
     75ErrorControl   = %SERVICE_ERRORCTL_NORMAL%
    7176ServiceBinary  = %10%\System32\Drivers\VBoxUSB.sys
    72 AddReg         = VBoxUSB.AddReg
    7377LoadOrderGroup = Base
    7478
    75 [VBoxUSB.AddReg]
     79[VBoxUSB_AddReg]
     80AddReg         = VBoxUSB_Registry
     81
     82[VBoxUSB_Registry]
    7683HKR,,DevLoader,,*ntkern
    7784HKR,,NTMPDriver,,VBoxUSB.sys
    7885
    79 [VBoxUSB.Files.Ext]
     86[VBoxUSB_CopyFiles]
    8087VBoxUSB.sys
    81 
    82 ;---------------------------------------------------------------;
    8388
    8489[Strings]
    8590ORACLE="Oracle Corporation"
    86 Disk_Description="VBoxUSB Installation Disk"
    87 USB\VID_80EE&PID_CAFE.DeviceDesc="VirtualBox USB"
    88 VBoxUSB.SvcDesc="VirtualBox USB"
     91VBoxUSB_SvcDesc="VirtualBox USB Service"
     92VBoxUSB_DrvDesc="VirtualBox USB Driver"
     93VBoxUSB_DiskDesc="VBoxUSB Installation Disk"
     94
     95; Useful constants
     96SERVICE_TYPE_KERNEL_DRIVER = 1
     97SERVICE_STARTTYPE_BOOT = 0
     98SERVICE_STARTTYPE_DEMAND = 3
     99SERVICE_ERRORCTL_IGNORE = 0
     100SERVICE_ERRORCTL_NORMAL = 1
     101
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf

    r106061 r106321  
    4343DriverPackageType=KernelService
    4444;cat CatalogFile=VBoxUSBMon.cat
     45;PnpLockdown=1
    4546
    4647[DestinationDirs]
    4748DefaultDestDir = 12
    4849
    49 [DefaultInstall@DOT-NT-ARCH@]
    50 CopyFiles=VBoxUSBMon_CopyFiles
     50[Manufacturer]
     51%ORACLE%=VBoxUSBMon@COMMA-NT-ARCH@
    5152
    52 [DefaultInstall@[email protected]]
     53[VBoxUSBMon@DOT-NT-ARCH@]
     54%VBoxUSBMon_DrvDesc%=VBoxUSBMonDev
     55
     56[VBoxUSBMon@[email protected]]
    5357AddService=VBoxUSBMon,0x00000002,VBoxUSBMon_Service,VBoxUSBMon_AddEventLog
    5458
    55 ;; Cannot get this to work (same works fine for VBoxDrv):
    56 ;; [Manufacturer]
    57 ;; %ORACLE%=VBoxUSBMon@COMMA-NT-ARCH@
    58 ;;
    59 ;; ; Models section (referenced by [Manufacturer]).
    60 ;; [VBoxUSBMon@DOT-NT-ARCH@]
    61 ;; %VBoxUSBMon.DRVDESC%=VBoxUSBMon_Install,root\VBoxUSBMon
    62 ;;
    63 ;; [VBoxUSBMon_Install@DOT-NT-ARCH@]
    64 ;; CopyFiles=VBoxUSBMon_CopyFiles
    65 ;;
    66 ;; [VBoxUSBMon_Install@[email protected]]
    67 ;; AddService=VBoxUSBMon,0x00000002,VBoxUSBMon_Service,VBoxUSBMon_AddEventLog
     59[VBoxUSBMonDev@DOT-NT-ARCH@]
     60CopyFiles=VBoxUSBMon_CopyFiles
    6861
    6962[SourceDisksFiles]
     
    7164
    7265[SourceDisksNames]
    73 1=%VBoxUSBMon.DSKDESC%,
     661=%VBoxUSBMon_DiskDesc%,
    7467
    7568[VBoxUSBMon_CopyFiles]
     
    7770
    7871[VBoxUSBMon_Service]
    79 DisplayName    = %VBoxUSBMon.SVCDESC%
    80 ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
    81 ;StartType      = 3                  ; SERVICE_DEMAND_START
    82 StartType      = 1                  ; autostart to fix Vista problem
    83 ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
     72DisplayName    = %VBoxUSBMon_SvcDesc%
     73ServiceType    = %SERVICE_TYPE_KERNEL_DRIVER%
     74StartType      = %SERVICE_STARTTYPE_AUTO%
     75ErrorControl   = %SERVICE_ERRORCTL_NORMAL%
    8476ServiceBinary  = %12%\VBoxUSBMon.sys
    8577
     
    9385[Strings]
    9486ORACLE = "Oracle Corporation"
    95 VBoxUSBMon.SVCDESC = "VirtualBox USB Monitor Service"
    96 VBoxUSBMon.DRVDESC = "VirtualBox USB Monitor Driver"
    97 VBoxUSBMon.DSKDESC = "VirtualBox USB Monitor Driver Installation Disk"
     87VBoxUSBMon_SvcDesc = "VirtualBox USB Monitor Service"
     88VBoxUSBMon_DrvDesc = "VirtualBox USB Monitor Driver"
     89VBoxUSBMon_DiskDesc = "VirtualBox USB Monitor Driver Installation Disk"
    9890
     91; Useful constants
     92SERVICE_TYPE_KERNEL_DRIVER = 1
     93SERVICE_STARTTYPE_BOOT = 0
     94SERVICE_STARTTYPE_AUTO = 1
     95SERVICE_STARTTYPE_DEMAND = 3
     96SERVICE_ERRORCTL_IGNORE = 0
     97SERVICE_ERRORCTL_NORMAL = 1
     98
  • trunk/src/VBox/Installer/win/InstallHelper/Makefile.kmk

    r106061 r106321  
    5050        VBoxInstallHelper.def \
    5151        VBoxInstallHelper.rc \
    52         VBoxCommon.cpp
     52        VBoxCommon.cpp \
     53        $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvCommon.cpp \
     54        $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvInst.cpp \
     55        $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvStore.cpp
    5356ifndef VBOX_OSE
    5457 VBoxInstallHelper_SOURCES += \
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp

    r106061 r106321  
    4242
    4343
     44/**
     45 * Retrieves a MSI property (in UTF-16), extended version.
     46 *
     47 * @returns VBox status code.
     48 * @param   hMsi                MSI handle to use.
     49 * @param   pwszName            Name of property to retrieve.
     50 * @param   pwszVal             Where to store the allocated value on success.
     51 * @param   pcwVal              Input and output size (in WCHARs) of \a pwszVal.
     52 */
     53int VBoxMsiQueryPropEx(MSIHANDLE hMsi, const WCHAR *pwszName, WCHAR *pwszVal, DWORD *pcwVal)
     54{
     55    AssertPtrReturn(pwszName, VERR_INVALID_POINTER);
     56    AssertPtrReturn(pwszVal, VERR_INVALID_POINTER);
     57    AssertPtrReturn(pcwVal, VERR_INVALID_POINTER);
     58    AssertReturn(*pcwVal, VERR_INVALID_PARAMETER);
     59
     60    int rc;
     61
     62    RT_BZERO(pwszVal, *pcwVal * sizeof(WCHAR));
     63    UINT uRc = MsiGetPropertyW(hMsi, pwszName, pwszVal, pcwVal);
     64    if (uRc == ERROR_SUCCESS)
     65    {
     66        if (*pcwVal > 0)
     67        {
     68            rc = VINF_SUCCESS;
     69        }
     70        else /* Indicates value not found. */
     71            rc = VERR_NOT_FOUND;
     72    }
     73    else
     74        rc = RTErrConvertFromWin32(uRc);
     75
     76    return rc;
     77}
     78
    4479#ifndef TESTCASE
    4580/**
    4681 * Retrieves a MSI property (in UTF-16).
    4782 *
    48  * Convenience function for VBoxGetMsiProp().
    49  *
    5083 * @returns VBox status code.
    5184 * @param   hMsi                MSI handle to use.
    5285 * @param   pwszName            Name of property to retrieve.
    53  * @param   pwszValueBuf        Where to store the allocated value on success.
    54  * @param   cwcValueBuf         Size (in WCHARs) of \a pwszValueBuf.
     86 * @param   pwszVal             Where to store the allocated value on success.
     87 * @param   cwVal               Input size (in WCHARs) of \a pwszVal.
    5588 */
    56 UINT VBoxGetMsiProp(MSIHANDLE hMsi, const WCHAR *pwszName, WCHAR *pwszValueBuf, DWORD cwcValueBuf)
     89int VBoxMsiQueryProp(MSIHANDLE hMsi, const WCHAR *pwszName, WCHAR *pwszVal, DWORD cwVal)
    5790{
    58     RT_BZERO(pwszValueBuf, cwcValueBuf * sizeof(WCHAR));
    59     return MsiGetPropertyW(hMsi, pwszName, pwszValueBuf, &cwcValueBuf);
     91    return VBoxMsiQueryPropEx(hMsi, pwszName, pwszVal, &cwVal);
    6092}
    61 #endif
     93#endif /* !TESTCASE */
    6294
    6395/**
     
    68100 * @returns VBox status code.
    69101 * @param   hMsi                MSI handle to use.
    70  * @param   pcszName            Name of property to retrieve.
     102 * @param   pszName             Name of property to retrieve.
    71103 * @param   ppszValue           Where to store the allocated value on success.
    72104 *                              Must be free'd using RTStrFree() by the caller.
    73105 */
    74 int VBoxGetMsiPropUtf8(MSIHANDLE hMsi, const char *pcszName, char **ppszValue)
     106int VBoxMsiQueryPropUtf8(MSIHANDLE hMsi, const char *pszName, char **ppszValue)
    75107{
     108   AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     109   AssertPtrReturn(ppszValue, VERR_INVALID_POINTER);
     110
    76111    PRTUTF16 pwszName;
    77     int rc = RTStrToUtf16(pcszName, &pwszName);
     112    int rc = RTStrToUtf16(pszName, &pwszName);
    78113    if (RT_SUCCESS(rc))
    79114    {
    80115        WCHAR wszValue[1024]; /* 1024 should be enough for everybody (tm). */
    81         if (VBoxGetMsiProp(hMsi, pwszName, wszValue, RT_ELEMENTS(wszValue)) == ERROR_SUCCESS)
     116        rc = VBoxMsiQueryProp(hMsi, pwszName, wszValue, RT_ELEMENTS(wszValue));
     117        if (RT_SUCCESS(rc))
    82118            rc = RTUtf16ToUtf8(wszValue, ppszValue);
    83         else
    84             rc = VERR_NOT_FOUND;
    85119
    86120        RTUtf16Free(pwszName);
     
    91125
    92126#ifndef TESTCASE
    93 UINT VBoxSetMsiProp(MSIHANDLE hMsi, const WCHAR *pwszName, const WCHAR *pwszValue)
     127int VBoxMsiQueryPropInt32(MSIHANDLE hMsi, const char *pszName, DWORD *pdwValue)
     128{
     129   AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     130   AssertPtrReturn(pdwValue, VERR_INVALID_POINTER);
     131
     132    PRTUTF16 pwszName;
     133    int rc = RTStrToUtf16(pszName, &pwszName);
     134    if (RT_SUCCESS(rc))
     135    {
     136        char *pszTemp;
     137        rc = VBoxMsiQueryPropUtf8(hMsi, pszName, &pszTemp);
     138        if (RT_SUCCESS(rc))
     139        {
     140            *pdwValue = RTStrToInt32(pszTemp);
     141            RTStrFree(pszTemp);
     142        }
     143    }
     144
     145    return rc;
     146}
     147
     148UINT VBoxMsiSetProp(MSIHANDLE hMsi, const WCHAR *pwszName, const WCHAR *pwszValue)
    94149{
    95150    return MsiSetPropertyW(hMsi, pwszName, pwszValue);
     
    97152#endif
    98153
    99 UINT VBoxSetMsiPropDWORD(MSIHANDLE hMsi, const WCHAR *pwszName, DWORD dwVal)
     154UINT VBoxMsiSetPropDWORD(MSIHANDLE hMsi, const WCHAR *pwszName, DWORD dwVal)
    100155{
    101156    wchar_t wszTemp[32];
    102157    RTUtf16Printf(wszTemp, RT_ELEMENTS(wszTemp), "%u", dwVal);
    103     return VBoxSetMsiProp(hMsi, pwszName, wszTemp);
     158    return VBoxMsiSetProp(hMsi, pwszName, wszTemp);
    104159}
    105160
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.h

    r106061 r106321  
    3636#endif
    3737
    38 UINT VBoxGetMsiProp(MSIHANDLE hMsi, const WCHAR *pwszName, WCHAR *pwszValueBuf, DWORD cwcValueBuf);
    39 int  VBoxGetMsiPropUtf8(MSIHANDLE hMsi, const char *pcszName, char **ppszValue);
    40 UINT VBoxSetMsiProp(MSIHANDLE hMsi, const WCHAR *pwszName, const WCHAR *pwszValue);
    41 UINT VBoxSetMsiPropDWORD(MSIHANDLE hMsi, const WCHAR *pwszName, DWORD dwVal);
     38int  VBoxMsiQueryProp(MSIHANDLE hMsi, const WCHAR *pwszName, WCHAR *pwszVal, DWORD cwVal);
     39int  VBoxMsiQueryPropEx(MSIHANDLE hMsi, const WCHAR *pwszName, WCHAR *pwszVal, DWORD *pcwVal);
     40int  VBoxMsiQueryPropUtf8(MSIHANDLE hMsi, const char *pszName, char **ppszValue);
     41int  VBoxMsiQueryPropInt32(MSIHANDLE hMsi, const char *pszName, DWORD *pdwValue);
     42UINT VBoxMsiSetProp(MSIHANDLE hMsi, const WCHAR *pwszName, const WCHAR *pwszValue);
     43UINT VBoxMsiSetPropDWORD(MSIHANDLE hMsi, const WCHAR *pwszName, DWORD dwVal);
    4244
    4345#endif /* !VBOX_INCLUDED_SRC_InstallHelper_VBoxCommon_h */
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp

    r106061 r106321  
    6060#include <iprt/err.h>
    6161#include <iprt/file.h>
     62#include <iprt/initterm.h>
    6263#include <iprt/mem.h>
    6364#include <iprt/path.h>   /* RTPATH_MAX, RTPATH_IS_SLASH */
     
    6667#include <iprt/thread.h>
    6768#include <iprt/utf16.h>
     69
     70#include <VBox/GuestHost/VBoxWinDrvInst.h>
    6871
    6972#include "VBoxCommon.h"
     
    134137BOOL WINAPI DllMain(HANDLE hInst, ULONG uReason, LPVOID pReserved)
    135138{
    136     RT_NOREF(hInst, uReason, pReserved);
     139    RT_NOREF(hInst, pReserved);
    137140
    138141#ifdef DEBUG
     
    147150        case DLL_PROCESS_ATTACH:
    148151        {
     152            int rc = RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
     153            if (RT_FAILURE(rc))
     154                return FALSE;
     155
    149156            g_cRef++;
    150157#if 0
     
    157164             * and 2-3 times during uninstall.
    158165             *
    159              * Note! The DIFxApp.DLL will automatically trigger breakpoints when a
    160              *       debugger is attached.  Just continue on these.
    161166             */
    162167            RTUtf16Printf(wszMsg, RT_ELEMENTS(wszMsg), "Waiting for debugger to attach: windbg -g -G -p %u\n", GetCurrentProcessId());
     
    174179        case DLL_PROCESS_DETACH:
    175180        {
     181            /** @todo RTR3Term(); */
     182
    176183            g_cRef--;
    177184            break;
     
    649656    char *pszTargetDir;
    650657
    651     int vrc = VBoxGetMsiPropUtf8(hModule, "INSTALLDIR", &pszTargetDir);
    652     if (RT_SUCCESS(vrc))
     658    int vrc = VBoxMsiQueryPropUtf8(hModule, "INSTALLDIR", &pszTargetDir);
     659    if (vrc == VERR_NOT_FOUND) /* Target directory might not set yet. */
     660    {
     661        logStringF(hModule, "CheckTargetDir: No INSTALLDIR set (yet), skipping ...");
     662
     663        VBoxMsiSetProp(hModule, L"VBox_Target_Dir_Is_Valid", L"1");
     664        vrc = VINF_SUCCESS;
     665    }
     666    else if (RT_SUCCESS(vrc))
    653667    {
    654668        logStringF(hModule, "CheckTargetDir: Checking target directory '%s' ...", pszTargetDir);
    655669
    656         if (!RTStrNLen(pszTargetDir, RTPATH_MAX))
    657         {
    658             logStringF(hModule, "CheckTargetDir: No INSTALLDIR set (yet), skipping ...");
    659             VBoxSetMsiProp(hModule, L"VBox_Target_Dir_Is_Valid", L"1");
    660         }
    661         else
    662         {
    663             union
    664             {
    665                 RTPATHPARSED    Parsed;
    666                 uint8_t         ab[RTPATH_MAX];
    667             } u;
    668 
    669             vrc = RTPathParse(pszTargetDir, &u.Parsed, sizeof(u), RTPATH_STR_F_STYLE_DOS);
     670        union
     671        {
     672            RTPATHPARSED    Parsed;
     673            uint8_t         ab[RTPATH_MAX];
     674        } u;
     675
     676        vrc = RTPathParse(pszTargetDir, &u.Parsed, sizeof(u), RTPATH_STR_F_STYLE_DOS);
     677        if (RT_SUCCESS(vrc))
     678        {
     679            if (u.Parsed.fProps & RTPATH_PROP_DOTDOT_REFS)
     680                vrc = VERR_INVALID_PARAMETER;
    670681            if (RT_SUCCESS(vrc))
    671682            {
    672                 if (u.Parsed.fProps & RTPATH_PROP_DOTDOT_REFS)
    673                     vrc = VERR_INVALID_PARAMETER;
     683                vrc = initTargetDirSecurityCtx(&g_TargetDirSecCtx, hModule, pszTargetDir);
    674684                if (RT_SUCCESS(vrc))
    675685                {
    676                     vrc = initTargetDirSecurityCtx(&g_TargetDirSecCtx, hModule, pszTargetDir);
    677                     if (RT_SUCCESS(vrc))
     686                    uint16_t idxComp = u.Parsed.cComps;
     687                    char     szPathToCheck[RTPATH_MAX];
     688                    while (idxComp > 1) /* We traverse backwards from INSTALLDIR and leave out the root (e.g. C:\"). */
    678689                    {
    679                         uint16_t idxComp = u.Parsed.cComps;
    680                         char     szPathToCheck[RTPATH_MAX];
    681                         while (idxComp > 1) /* We traverse backwards from INSTALLDIR and leave out the root (e.g. C:\"). */
     690                        u.Parsed.cComps = idxComp;
     691                        vrc = RTPathParsedReassemble(pszTargetDir, &u.Parsed, RTPATH_STR_F_STYLE_DOS,
     692                                                     szPathToCheck, sizeof(szPathToCheck));
     693                        if (RT_FAILURE(vrc))
     694                            break;
     695                        if (RTDirExists(szPathToCheck))
    682696                        {
    683                             u.Parsed.cComps = idxComp;
    684                             vrc = RTPathParsedReassemble(pszTargetDir, &u.Parsed, RTPATH_STR_F_STYLE_DOS,
    685                                                          szPathToCheck, sizeof(szPathToCheck));
     697                            vrc = checkTargetDirOne(hModule, &g_TargetDirSecCtx, szPathToCheck);
    686698                            if (RT_FAILURE(vrc))
    687699                                break;
    688                             if (RTDirExists(szPathToCheck))
    689                             {
    690                                 vrc = checkTargetDirOne(hModule, &g_TargetDirSecCtx, szPathToCheck);
    691                                 if (RT_FAILURE(vrc))
    692                                     break;
    693                             }
    694                             else
    695                                 logStringF(hModule, "CheckTargetDir: Path '%s' does not exist (yet)", szPathToCheck);
    696                             idxComp--;
    697700                        }
    698 
    699                         destroyTargetDirSecurityCtx(&g_TargetDirSecCtx);
     701                        else
     702                            logStringF(hModule, "CheckTargetDir: Path '%s' does not exist (yet)", szPathToCheck);
     703                        idxComp--;
    700704                    }
    701                     else
    702                         logStringF(hModule, "CheckTargetDir: initTargetDirSecurityCtx failed with %Rrc\n", vrc);
    703 
    704                     if (RT_SUCCESS(vrc))
    705                         VBoxSetMsiProp(hModule, L"VBox_Target_Dir_Is_Valid", L"1");
     705
     706                    destroyTargetDirSecurityCtx(&g_TargetDirSecCtx);
    706707                }
    707             }
    708             else
    709                 logStringF(hModule, "CheckTargetDir: Parsing path failed with %Rrc", vrc);
    710         }
     708                else
     709                    logStringF(hModule, "CheckTargetDir: initTargetDirSecurityCtx failed with %Rrc\n", vrc);
     710
     711                if (RT_SUCCESS(vrc))
     712                    VBoxMsiSetProp(hModule, L"VBox_Target_Dir_Is_Valid", L"1");
     713            }
     714        }
     715        else
     716            logStringF(hModule, "CheckTargetDir: Parsing path failed with %Rrc", vrc);
    711717
    712718        RTStrFree(pszTargetDir);
     
    716722    {
    717723        logStringF(hModule, "CheckTargetDir: Checking failed with %Rrc", vrc);
    718         VBoxSetMsiProp(hModule, L"VBox_Target_Dir_Is_Valid", L"0");
     724        VBoxMsiSetProp(hModule, L"VBox_Target_Dir_Is_Valid", L"0");
    719725    }
    720726
     
    988994    {
    989995        logStringF(hModule, "IsPythonInstalled: Python installation found at \"%ls\"", wszPythonPath);
    990         VBoxSetMsiProp(hModule, L"VBOX_PYTHON_PATH", wszPythonPath);
    991         VBoxSetMsiProp(hModule, L"VBOX_PYTHON_INSTALLED", L"1");
     996        VBoxMsiSetProp(hModule, L"VBOX_PYTHON_PATH", wszPythonPath);
     997        VBoxMsiSetProp(hModule, L"VBOX_PYTHON_INSTALLED", L"1");
    992998    }
    993999    else
     
    9951001        logStringF(hModule, "IsPythonInstalled: Error: No suitable Python installation found (%u), skipping installation.", rcWin);
    9961002        logStringF(hModule, "IsPythonInstalled: Python seems not to be installed; please download + install the Python Core package.");
    997         VBoxSetMsiProp(hModule, L"VBOX_PYTHON_INSTALLED", L"0");
     1003        VBoxMsiSetProp(hModule, L"VBOX_PYTHON_INSTALLED", L"0");
    9981004    }
    9991005
     
    10251031        logStringF(hModule, "ArePythonAPIDepsInstalled: Failed with dwErr=%u", dwErr);
    10261032
    1027     VBoxSetMsiProp(hModule, L"VBOX_PYTHON_DEPS_INSTALLED", dwErr == ERROR_SUCCESS ? L"1" : L"0");
     1033    VBoxMsiSetProp(hModule, L"VBOX_PYTHON_DEPS_INSTALLED", dwErr == ERROR_SUCCESS ? L"1" : L"0");
    10281034    return ERROR_SUCCESS; /* Never return failure. */
    10291035}
     
    10641070                if (lrc == ERROR_SUCCESS)
    10651071                {
    1066                     VBoxSetMsiPropDWORD(hModule, L"VBOX_MSCRT_VER_MAJ", dwMaj);
     1072                    VBoxMsiSetPropDWORD(hModule, L"VBOX_MSCRT_VER_MAJ", dwMaj);
    10671073
    10681074                    DWORD dwMin = 0;
     
    10701076                    if (lrc == ERROR_SUCCESS)
    10711077                    {
    1072                         VBoxSetMsiPropDWORD(hModule, L"VBOX_MSCRT_VER_MIN", dwMin);
     1078                        VBoxMsiSetPropDWORD(hModule, L"VBOX_MSCRT_VER_MIN", dwMin);
    10731079
    10741080                        logStringF(hModule, "IsMSCRTInstalled: Found v%u.%u\n", dwMaj, dwMin);
     
    10761082                        /* Check for at least 2019. */
    10771083                        if (dwMaj > 14 || (dwMaj == 14 && dwMin >= 20))
    1078                             VBoxSetMsiProp(hModule, L"VBOX_MSCRT_INSTALLED", L"1");
     1084                            VBoxMsiSetProp(hModule, L"VBOX_MSCRT_INSTALLED", L"1");
    10791085                    }
    10801086                    else
     
    11291135            logStringF(hModule, "IsWindows10/CurrentMajorVersionNumber: %u", dwVal);
    11301136
    1131             VBoxSetMsiProp(hModule, L"VBOX_IS_WINDOWS_10", dwVal >= 10 ? L"1" : L"");
     1137            VBoxMsiSetProp(hModule, L"VBOX_IS_WINDOWS_10", dwVal >= 10 ? L"1" : L"");
    11321138        }
    11331139        else
     
    11611167    if (rcWin != ERROR_SUCCESS)
    11621168    {
    1163         VBoxSetMsiProp(hModule, L"VBOX_API_INSTALLED", L"0");
     1169        VBoxMsiSetProp(hModule, L"VBOX_API_INSTALLED", L"0");
    11641170        return ERROR_SUCCESS;
    11651171    }
     
    11701176    /* Get the VBox API setup string. */
    11711177    WCHAR wszVBoxPythonInstallerPath[RTPATH_MAX];
    1172     rcWin = VBoxGetMsiProp(hModule, L"CustomActionData", wszVBoxPythonInstallerPath, RT_ELEMENTS(wszVBoxPythonInstallerPath));
    1173     if (rcWin == ERROR_SUCCESS)
     1178    int rc = VBoxMsiQueryProp(hModule, L"CustomActionData", wszVBoxPythonInstallerPath, RT_ELEMENTS(wszVBoxPythonInstallerPath));
     1179    if (RT_SUCCESS(rc))
    11741180    {
    11751181        /* Make sure our current working directory is the VBox installation path. */
     
    11991205                    {
    12001206                        logStringF(hModule, "InstallPythonAPI: VBox API looks good.");
    1201                         VBoxSetMsiProp(hModule, L"VBOX_API_INSTALLED", L"1");
     1207                        VBoxMsiSetProp(hModule, L"VBOX_API_INSTALLED", L"1");
    12021208                        return ERROR_SUCCESS;
    12031209                    }
     
    12181224    }
    12191225    else
    1220         logStringF(hModule, "InstallPythonAPI: Unable to retrieve VBox installation directory: rcWin=%u (%#x)", rcWin, rcWin);
    1221 
    1222     VBoxSetMsiProp(hModule, L"VBOX_API_INSTALLED", L"0");
     1226        logStringF(hModule, "InstallPythonAPI: Unable to retrieve VBox installation directory: rc=%Rrc", rc);
     1227
     1228    VBoxMsiSetProp(hModule, L"VBOX_API_INSTALLED", L"0");
    12231229    logStringF(hModule, "InstallPythonAPI: Installation failed");
    12241230    return ERROR_SUCCESS; /* Do not fail here. */
     
    13731379
    13741380    WCHAR wszPath[RTPATH_MAX];
    1375     UINT rc = VBoxGetMsiProp(hModule, L"CustomActionData", wszPath, RT_ELEMENTS(wszPath));
    1376     if (rc == ERROR_SUCCESS)
     1381    int rc = VBoxMsiQueryProp(hModule, L"CustomActionData", wszPath, RT_ELEMENTS(wszPath));
     1382    if (RT_SUCCESS(rc))
    13771383    {
    13781384        size_t const cwcPath = RTUtf16Len(wszPath);
     
    13881394    }
    13891395
    1390     logStringF(hModule, "UninstallBranding: Handling done. (rc=%u (ignored))", rc);
     1396    logStringF(hModule, "UninstallBranding: Handling done. (rc=%Rrc (ignored))", rc);
    13911397    return ERROR_SUCCESS; /* Do not fail here. */
    13921398}
     
    14001406     */
    14011407    wchar_t wszSrcPath[RTPATH_MAX];
    1402     UINT rc = VBoxGetMsiProp(hModule, L"SOURCEDIR", wszSrcPath, RT_ELEMENTS(wszSrcPath));
    1403     if (rc == ERROR_SUCCESS)
     1408    int rc = VBoxMsiQueryProp(hModule, L"SOURCEDIR", wszSrcPath, RT_ELEMENTS(wszSrcPath));
     1409    if (RT_SUCCESS(rc))
    14041410    {
    14051411        wchar_t wszDstPath[RTPATH_MAX];
    1406         rc = VBoxGetMsiProp(hModule, L"CustomActionData", wszDstPath, RT_ELEMENTS(wszDstPath) - 1);
    1407         if (rc == ERROR_SUCCESS)
     1412        rc = VBoxMsiQueryProp(hModule, L"CustomActionData", wszDstPath, RT_ELEMENTS(wszDstPath));
     1413        if (RT_SUCCESS(rc))
    14081414        {
    14091415            /*
    14101416             * First we copy the src\.custom dir to the target.
    14111417             */
    1412             rc = AppendToPath(wszSrcPath, RT_ELEMENTS(wszSrcPath) - 1, L".custom", true /*fDoubleTerm*/);
    1413             if (rc == ERROR_SUCCESS)
    1414             {
    1415                 rc = CopyDir(hModule, wszDstPath, wszSrcPath);
    1416                 if (rc == ERROR_SUCCESS)
     1418            UINT rcWin = AppendToPath(wszSrcPath, RT_ELEMENTS(wszSrcPath) - 1, L".custom", true /*fDoubleTerm*/);
     1419            if (rcWin == ERROR_SUCCESS)
     1420            {
     1421                rcWin = CopyDir(hModule, wszDstPath, wszSrcPath);
     1422                if (rcWin == ERROR_SUCCESS)
    14171423                {
    14181424                    /*
    14191425                     * The rename the '.custom' directory we now got in the target area to 'custom'.
    14201426                     */
    1421                     rc = JoinPaths(wszSrcPath, RT_ELEMENTS(wszSrcPath), wszDstPath, L".custom", true /*fDoubleTerm*/);
     1427                    rcWin = JoinPaths(wszSrcPath, RT_ELEMENTS(wszSrcPath), wszDstPath, L".custom", true /*fDoubleTerm*/);
    14221428                    if (rc == ERROR_SUCCESS)
    14231429                    {
    1424                         rc = AppendToPath(wszDstPath, RT_ELEMENTS(wszDstPath), L"custom", true /*fDoubleTerm*/);
     1430                        rcWin = AppendToPath(wszDstPath, RT_ELEMENTS(wszDstPath), L"custom", true /*fDoubleTerm*/);
    14251431                        if (rc == ERROR_SUCCESS)
    1426                             rc = RenameDir(hModule, wszDstPath, wszSrcPath);
     1432                            rcWin = RenameDir(hModule, wszDstPath, wszSrcPath);
    14271433                    }
    14281434                }
    14291435            }
    1430         }
    1431     }
    1432 
    1433     logStringF(hModule, "InstallBranding: Handling done. (rc=%u (ignored))", rc);
     1436
     1437            logStringF(hModule, "InstallBranding: Handling done. (rc=%Rrc (ignored))", rc);
     1438        }
     1439    }
     1440
     1441    logStringF(hModule, "InstallBranding: Handling done. (rc=%Rrc (ignored))", rc);
     1442    return ERROR_SUCCESS; /* Do not fail here. */
     1443}
     1444
     1445static DECLCALLBACK(void) vboxWinDrvInstLogCallback(VBOXWINDRIVERLOGTYPE enmType, const char *pszMsg, void *pvUser)
     1446{
     1447    MSIHANDLE *phModule = (MSIHANDLE *)pvUser;
     1448
     1449    switch (enmType)
     1450    {
     1451        case VBOXWINDRIVERLOGTYPE_ERROR:
     1452            logStringF(*phModule, "*** Error: %s", pszMsg);
     1453            break;
     1454
     1455        default:
     1456            logStringF(*phModule, "%s", pszMsg);
     1457            break;
     1458    }
     1459}
     1460
     1461UINT __stdcall DriverInstall(MSIHANDLE hModule)
     1462{
     1463    logStringF(hModule, "Installing driver ...");
     1464
     1465    char *pszInfFile = NULL;
     1466    int rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvInstInfFile", &pszInfFile);
     1467    if (RT_SUCCESS(rc))
     1468    {
     1469        char *pszInfSection = NULL;
     1470        rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvInstInfSection", &pszInfSection);
     1471        if (   RT_SUCCESS(rc)
     1472            || rc == VERR_NOT_FOUND) /* VBoxDrvInstInfSection is optional. */
     1473        {
     1474            char *pszPnpId = NULL;
     1475            rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvInstPnpId", &pszPnpId);
     1476            if (   RT_SUCCESS(rc)
     1477                || rc == VERR_NOT_FOUND) /* VBoxDrvInstHwId is optional. */
     1478            {
     1479                uint32_t fFlags = VBOX_WIN_DRIVERINSTALL_F_NONE;
     1480
     1481                DWORD dwVal;
     1482                rc = VBoxMsiQueryPropInt32(hModule, "VBoxDrvInstFlagForce", &dwVal);
     1483                if (RT_SUCCESS(rc))
     1484                    fFlags |= VBOX_WIN_DRIVERINSTALL_F_FORCE;
     1485                rc = VBoxMsiQueryPropInt32(hModule, "VBoxDrvInstFlagSilent", &dwVal);
     1486                if (RT_SUCCESS(rc))
     1487                    fFlags |= VBOX_WIN_DRIVERINSTALL_F_SILENT;
     1488
     1489                VBOXWINDRVINST hWinDrvInst;
     1490                rc = VBoxWinDrvInstCreateEx(&hWinDrvInst, 1 /* uVerbostiy */, &vboxWinDrvInstLogCallback, &hModule /* pvUser */);
     1491                if (RT_SUCCESS(rc))
     1492                {
     1493                    if (pszInfSection && *pszInfSection)
     1494                        rc = VBoxWinDrvInstInstallExecuteInf(hWinDrvInst, pszInfFile, pszInfSection, fFlags);
     1495                    else
     1496                        rc = VBoxWinDrvInstInstall(hWinDrvInst, pszInfFile, pszPnpId, fFlags);
     1497
     1498                    VBoxWinDrvInstDestroy(hWinDrvInst);
     1499                }
     1500
     1501                RTStrFree(pszPnpId);
     1502            }
     1503
     1504            RTStrFree(pszInfSection);
     1505        }
     1506
     1507        RTStrFree(pszInfFile);
     1508    }
     1509    else
     1510    {
     1511        logStringF(hModule, "DriverInstall: No INF or invalid file to install specified!");
     1512        if (rc == VERR_NOT_FOUND) /* Give a better clue. */
     1513            rc = VERR_INVALID_PARAMETER;
     1514    }
     1515
     1516    logStringF(hModule, "DriverInstall: Handling done. rc=%Rrc (ignored)", rc);
     1517    return ERROR_SUCCESS; /* Do not fail here. */
     1518}
     1519
     1520UINT __stdcall DriverUninstall(MSIHANDLE hModule)
     1521{
     1522    char *pszInfFile = NULL;
     1523    int rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvUninstInfFile", &pszInfFile);
     1524    if (   RT_SUCCESS(rc)
     1525        || rc == VERR_NOT_FOUND) /* VBoxDrvUninstInfFile is optional. */
     1526    {
     1527        char *pszInfSection = NULL;
     1528        rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvUninstInfSection", &pszInfSection);
     1529        if (   RT_SUCCESS(rc)
     1530            || rc == VERR_NOT_FOUND) /* VBoxDrvUninstInfSection is optional. */
     1531        {
     1532            char *pszModel = NULL;
     1533            rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvUninstModel", &pszModel);
     1534            if (   RT_SUCCESS(rc)
     1535                || rc == VERR_NOT_FOUND) /* VBoxDrvUninstModel is optional. */
     1536            {
     1537                char *pszPnpId = NULL;
     1538                rc = VBoxMsiQueryPropUtf8(hModule, "VBoxDrvUninstPnpId", &pszPnpId);
     1539                if (   RT_SUCCESS(rc)
     1540                    || rc == VERR_NOT_FOUND) /* VBoxDrvUninstPnpId is optional. */
     1541                {
     1542                    VBOXWINDRVINST hWinDrvInst;
     1543                    rc = VBoxWinDrvInstCreateEx(&hWinDrvInst, 1 /* uVerbostiy */,
     1544                                                &vboxWinDrvInstLogCallback, &hModule /* pvUser */);
     1545                    if (RT_SUCCESS(rc))
     1546                    {
     1547                        if (pszInfSection && *pszInfSection)
     1548                            rc = VBoxWinDrvInstUninstallExecuteInf(hWinDrvInst, pszInfFile, pszInfSection,
     1549                                                                   VBOX_WIN_DRIVERINSTALL_F_NONE);
     1550                        else
     1551                            rc = VBoxWinDrvInstUninstall(hWinDrvInst, pszInfFile, pszModel, pszPnpId,
     1552                                                         VBOX_WIN_DRIVERINSTALL_F_NONE);
     1553
     1554                        VBoxWinDrvInstDestroy(hWinDrvInst);
     1555                    }
     1556
     1557                    RTStrFree(pszPnpId);
     1558                }
     1559
     1560                RTStrFree(pszModel);
     1561            }
     1562
     1563            RTStrFree(pszInfSection);
     1564        }
     1565
     1566        RTStrFree(pszInfFile);
     1567    }
     1568
     1569    logStringF(hModule, "DriverUninstall: Handling done. rc=%Rrc (ignored)", rc);
    14341570    return ERROR_SUCCESS; /* Do not fail here. */
    14351571}
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.def

    r106061 r106321  
    4545    UninstallTAPInstances
    4646    UninstallVBoxDrv
     47    DriverInstall
     48    DriverUninstall
    4749    CreateHostOnlyInterface
    4850    StopHostOnlyInterfaces
  • trunk/src/VBox/Installer/win/Makefile.kmk

    r106061 r106321  
    7575 VBOX_WITH_DOCS_PACKING         :=
    7676 VBOX_WITH_QTGUI                :=
    77  VBOX_WITH_USB                  :=
     77 VBOX_WITH_USB                  := 1
    7878 VBOX_WITH_VBOX_IMG             :=
    7979 VBOX_WITH_VBOXSDL              :=
     
    310310#
    311311VBOX_TOOLS_WIN_WIX_EXT := \
    312         -lib $(VBOX_TOOLS_WIN_WIXEXT_DIR)/difxapp_$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",x86,x64).wixlib \
    313312        $(if-expr defined(VBOX_WITH_MSI_HACK),-ext $(MsiHack_0_OUTDIR)/MsiHackExtension.dll,) \
    314313        -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.Ui.wixext.dll \
    315         -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.DifxApp.wixext.dll \
    316314        -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.Util.wixext.dll
    317315
     
    578576                -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
    579577                -lib $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_$(lang).wixlib \
    580                 -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.DifxApp.wixext.dll \
    581578                -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.Util.wixext.dll \
    582579                -pdbtype none \
     
    596593                '  files-VirtualBox_$(lang)/License_$(lang).wxl ^' \
    597594                '  -lib VirtualBox_en_US.wixlib ^' \
    598                 '  -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.DifxApp.wixext.dll ^' \
    599595                '  -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.Util.wixext.dll ^' \
    600596                '  -pdbtype none ^' \
     
    10591055                -lib $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_en_US.wixlib \
    10601056                -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.Util.wixext.dll \
    1061                 -ext $(VBOX_TOOLS_WIN_WIXEXT_DIR)/WixToolset.DifxApp.wixext.dll \
    10621057                -pdbtype none \
    10631058                -out $$(@D)/$(PACKAGE_NAME_LANG)_$(lang).msi
  • trunk/src/VBox/Installer/win/Scripts/Combined-3-RepackAdditions.cmd

    r106061 r106321  
    237237        -E "PATH_TARGET_X86=%_MY_REPACK_DIR_X86%\resources" ^
    238238        -E "VBOX_PATH_ADDITIONS_WIN_X86=%_MY_REPACK_DIR_AMD64%\..\bin\additions" ^
    239         -E "VBOX_PATH_DIFX=%KBUILD_DEVTOOLS%\win.amd64\DIFx\v2.1-r3" ^
    240239        -E "VBOX_VENDOR=Oracle Corporation" -E "VBOX_VENDOR_SHORT=Oracle" -E "VBOX_PRODUCT=Oracle VirtualBox" ^
    241240        -E "VBOX_C_YEAR=@VBOX_C_YEAR@" -E "VBOX_VERSION_STRING=@VBOX_VERSION_STRING@" -E "VBOX_VERSION_STRING_RAW=@VBOX_VERSION_STRING_RAW@" ^
     
    268267        -E "PATH_TARGET_X86=%_MY_REPACK_DIR_X86%\resources" ^
    269268        -E "VBOX_PATH_ADDITIONS_WIN_X86=%_MY_REPACK_DIR_X86%\..\bin\additions" ^
    270         -E "VBOX_PATH_DIFX=%KBUILD_DEVTOOLS%\win.x86\DIFx\v2.1-r3" ^
    271269        -E "VBOX_VENDOR=Oracle Corporation" -E "VBOX_VENDOR_SHORT=Oracle" -E "VBOX_PRODUCT=Oracle VirtualBox" ^
    272270        -E "VBOX_C_YEAR=@VBOX_C_YEAR@" -E "VBOX_VERSION_STRING=@VBOX_VERSION_STRING@" -E "VBOX_VERSION_STRING_RAW=@VBOX_VERSION_STRING_RAW@" ^
  • trunk/src/VBox/Installer/win/VBoxMergeApp.wxi

    r106061 r106321  
    2424-->
    2525
    26 <Include xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:difxapp="http://wixtoolset.org/schemas/v4/wxs/difxapp">
     26<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
    2727
    2828<?ifdef env.VBOX_QT_INFIX ?>
     
    5151<?if $(env.VBOX_SIGNING_MODE) != none ?>
    5252            <Component Id="cp_VBoxSupCat_PreW10" Guid="673195c2-f315-42e7-ff00-5acbd91ea0bd" Bitness="$(var.Property_Bitness)" Condition="(NOT VBOX_IS_WINDOWS_10)">
    53 
    5453                <File Id="file_VBoxSup_PreW10.cat" Name="VBoxSup.cat" Source="$(env.PATH_OUT)\bin\VBoxSup-PreW10.cat" />
    5554            </Component>
    5655            <Component Id="cp_VBoxSupCat_W10" Guid="589be90d-0286-4684-503d-a1681f9587bc" Bitness="$(var.Property_Bitness)" Condition="(VBOX_IS_WINDOWS_10)">
    57 
    5856                <File Id="file_VBoxSup.cat" Name="VBoxSup.cat" Source="$(env.PATH_OUT)\bin\VBoxSup.cat" />
    5957            </Component>
    6058<?endif?>
    6159            <Component Id="cp_VBoxSup" Guid="D3E2F2BB-569F-46A2-836C-BDF30FF1EDF8" Bitness="$(var.Property_Bitness)">
    62                 <difxapp:Driver AddRemovePrograms="no" ForceInstall="yes" DeleteFiles="yes" Legacy="$(var.Property_DriverLegacy)" Sequence="2" PlugAndPlayPrompt="no" />
     60                <!-- Note: Driver gets installed via custom action via VBoxInstallHelper. -->
    6361                <File Id="file_VBoxSup.sys" Name="VBoxSup.sys" KeyPath="yes" Source="$(env.PATH_OUT)\bin\VBoxSup.sys" />
    6462                <File Id="file_VBoxSup.inf" Name="VBoxSup.inf" Source="$(env.PATH_OUT)\bin\VBoxSup.inf" />
  • trunk/src/VBox/Installer/win/VBoxMergeAppCA.wxi

    r106061 r106321  
    2626<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
    2727
     28    <CustomAction Id="ca_VBoxSupDrvInst" DllEntry="DriverInstall" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />                     
     29    <CustomAction Id="ca_VBoxSupDrvInstArgInfFile" Property="VBoxDrvInstInfFile" Value="[#file_VBoxSup.inf]" Execute="immediate" />
     30    <CustomAction Id="ca_VBoxSupDrvInstArgModel" Property="VBoxDrvInstModel" Value="VBoxSup" Execute="immediate" />
     31    <CustomAction Id="ca_VBoxSupDrvInstArgFlagForce" Property="VBoxDrvInstFlagForce" Value="1" Execute="immediate" />
     32    <CustomAction Id="ca_VBoxSupDrvInstArgFlagSilent" Property="VBoxDrvInstFlagSilent" Value="1" Execute="immediate" />
     33
     34    <CustomAction Id="ca_VBoxSupDrvUninst" DllEntry="DriverUninstall" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />
     35    <CustomAction Id="ca_VBoxSupDrvUninstArgModel" Property="VBoxDrvUninstModel" Value="VBoxSup*" Execute="immediate" />
     36
    2837<?if $(env.VBOX_WITH_CRT_PACKING) = "no" ?>
    2938    <CustomAction Id="ca_IsMSCRTInstalled" DllEntry="IsMSCRTInstalled" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />
  • trunk/src/VBox/Installer/win/VBoxMergeAppSeq.wxi

    r106061 r106321  
    2626<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
    2727
     28    <Custom Action="ca_VBoxSupDrvInstArgFlagSilent" Before="ca_VBoxSupDrvInstArgFlagForce" Condition="NOT REMOVE" />
     29    <Custom Action="ca_VBoxSupDrvInstArgFlagForce" Before="ca_VBoxSupDrvInstArgModel" Condition="NOT REMOVE" />
     30    <Custom Action="ca_VBoxSupDrvInstArgInfFile" Before="ca_VBoxSupDrvInstArgModel" Condition="NOT REMOVE" />
     31    <Custom Action="ca_VBoxSupDrvInstArgModel" Before="ca_VBoxSupDrvInst" Condition="NOT REMOVE" />
     32    <Custom Action="ca_VBoxSupDrvInst" After="InstallFinalize" Condition="NOT REMOVE" />
     33
     34    <Custom Action="ca_VBoxSupDrvUninstArgModel" Before="ca_VBoxSupDrvUninst"
     35            Condition="NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE=&quot;ALL&quot;)" />
     36    <Custom Action="ca_VBoxSupDrvUninst" After="InstallInitialize"
     37            Condition="NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE=&quot;ALL&quot;)" />
     38
    2839<?if $(env.VBOX_WITH_CRT_PACKING) = "no" ?>
    2940    <Custom Action="ca_IsMSCRTInstalled" Before="LaunchConditions"/>
  • trunk/src/VBox/Installer/win/VBoxMergeUSB.wxi

    r106061 r106321  
    2424-->
    2525
    26 <Include xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:difxapp="http://wixtoolset.org/schemas/v4/wxs/difxapp">
     26<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
    2727
    2828    <Directory Id="dir_VBoxUSBFilter" Name="filter">
     
    3838<?endif?>
    3939        <Component Id="cp_USBFilterDriver" Guid="B7D782D2-96DF-4775-A0E1-A76CF7B04B65" Bitness="$(var.Property_Bitness)">
    40             <difxapp:Driver AddRemovePrograms="no" ForceInstall="yes" DeleteFiles="yes" Legacy="$(var.Property_DriverLegacy)" Sequence="3" PlugAndPlayPrompt="no" />
    4140            <File Id="file_VBoxUSBMon.sys" Name="VBoxUSBMon.sys" Source="$(env.PATH_OUT)\bin\VBoxUSBMon.sys" />
    4241            <File Id="file_VBoxUSBMon.inf" Name="VBoxUSBMon.inf" Source="$(env.PATH_OUT)\bin\VBoxUSBMon.inf" />
     
    5655<?endif?>
    5756        <Component Id="cp_USBDeviceDriver" Guid="010FE46A-E358-43E2-8BDC-38BC8BEC82E0" Bitness="$(var.Property_Bitness)">
    58             <difxapp:Driver AddRemovePrograms="no" ForceInstall="yes" DeleteFiles="yes" Legacy="$(var.Property_DriverLegacy)" Sequence="3" PlugAndPlayPrompt="no" />
    5957            <File Id="file_VBoxUSB.sys" Name="VBoxUSB.sys" Source="$(env.PATH_OUT)\bin\VBoxUSB.sys" />
    6058            <File Id="file_VBoxUSB.inf" Name="VBoxUSB.inf" Source="$(env.PATH_OUT)\bin\VBoxUSB.inf" />
  • trunk/src/VBox/Installer/win/VBoxMergeUSBCA.wxi

    r106061 r106321  
    2626<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
    2727
     28    <CustomAction Id="ca_VBoxUSBDevDrvInst" DllEntry="DriverInstall" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />
     29    <CustomAction Id="ca_VBoxUSBDevDrvInstArgInfFile"  Property="VBoxDrvInstInfFile" Value="[#file_VBoxUSB.inf]" Execute="immediate" />
     30    <CustomAction Id="ca_VBoxUSBDevDrvInstArgModel" Property="VBoxDrvInstModel" Value="VBoxUSB*" Execute="immediate" />
     31    <CustomAction Id="ca_VBoxUSBDevDrvInstArgFlagForce" Property="VBoxDrvInstFlagForce" Value="1" Execute="immediate" />
     32    <CustomAction Id="ca_VBoxUSBDevDrvInstArgFlagSilent" Property="VBoxDrvInstFlagSilent" Value="1" Execute="immediate" />
     33
     34    <CustomAction Id="ca_VBoxUSBDevDrvUninst" DllEntry="DriverUninstall" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />
     35    <CustomAction Id="ca_VBoxUSBDevDrvUninstArgModel" Property="VBoxDrvUninstModel" Value="VBoxUSB*" Execute="immediate" />
     36
     37    <CustomAction Id="ca_VBoxUSBMonDrvInst" DllEntry="DriverInstall" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />
     38    <CustomAction Id="ca_VBoxUSBMonDrvInstArgInfFile"  Property="VBoxDrvInstInfFile" Value="[#file_VBoxUSBMon.inf]" Execute="immediate" />
     39    <CustomAction Id="ca_VBoxUSBMonDrvInstArgModel" Property="VBoxDrvInstModel" Value="VBoxUSBMon*" Execute="immediate" />
     40    <CustomAction Id="ca_VBoxUSBMonDrvInstArgFlagForce" Property="VBoxDrvInstFlagForce" Value="1" Execute="immediate" />
     41    <CustomAction Id="ca_VBoxUSBMonDrvInstArgFlagSilent" Property="VBoxDrvInstFlagSilent" Value="1" Execute="immediate" />
     42
     43    <CustomAction Id="ca_VBoxUSBMonDrvUninst" DllEntry="DriverUninstall" Execute="immediate" Return="ignore" Impersonate="no" BinaryRef="VBoxInstallHelper" />
     44    <CustomAction Id="ca_VBoxUSBMonDrvUninstArgModel" Property="VBoxDrvUninstModel" Value="VBoxUSBMon*" Execute="immediate" />
     45
    2846</Include>
     47
  • trunk/src/VBox/Installer/win/VBoxMergeUSBSeq.wxi

    r106061 r106321  
    2626<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
    2727
     28    <Custom Action="ca_VBoxUSBDevDrvInstArgFlagSilent" Before="ca_VBoxUSBDevDrvInstArgFlagForce" Condition="NOT REMOVE" />
     29    <Custom Action="ca_VBoxUSBDevDrvInstArgFlagForce" Before="ca_VBoxUSBDevDrvInstArgModel" Condition="NOT REMOVE" />
     30    <Custom Action="ca_VBoxUSBDevDrvInstArgModel" Before="ca_VBoxUSBDevDrvInstArgInfFile" Condition="NOT REMOVE" />
     31    <Custom Action="ca_VBoxUSBDevDrvInstArgInfFile" Before="ca_VBoxUSBDevDrvInst" Condition="NOT REMOVE" />
     32    <Custom Action="ca_VBoxUSBDevDrvInst" After="InstallFinalize" Condition="NOT REMOVE" />
     33
     34    <Custom Action="ca_VBoxUSBDevDrvUninstArgModel" Before="ca_VBoxUSBDevDrvUninst"
     35            Condition="NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE=&quot;ALL&quot;)" />
     36    <Custom Action="ca_VBoxUSBDevDrvUninst" After="InstallInitialize"
     37            Condition="NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE=&quot;ALL&quot;)"/>
     38
     39    <Custom Action="ca_VBoxUSBMonDrvInstArgFlagSilent" Before="ca_VBoxUSBMonDrvInstArgFlagForce" Condition="NOT REMOVE" />
     40    <Custom Action="ca_VBoxUSBMonDrvInstArgFlagForce" Before="ca_VBoxUSBMonDrvInstArgModel" Condition="NOT REMOVE" />
     41    <Custom Action="ca_VBoxUSBMonDrvInstArgModel" Before="ca_VBoxUSBMonDrvInstArgInfFile" Condition="NOT REMOVE" />
     42    <Custom Action="ca_VBoxUSBMonDrvInstArgInfFile" Before="ca_VBoxUSBMonDrvInst" Condition="NOT REMOVE" />
     43    <Custom Action="ca_VBoxUSBMonDrvInst" After="InstallFinalize" Condition="NOT REMOVE" />
     44
     45    <Custom Action="ca_VBoxUSBMonDrvUninstArgModel" Before="ca_VBoxUSBMonDrvUninst"
     46            Condition="NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE=&quot;ALL&quot;)" />
     47    <Custom Action="ca_VBoxUSBMonDrvUninst" After="InstallInitialize"
     48            Condition="NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE=&quot;ALL&quot;)" />
     49
    2850</Include>
     51
  • trunk/src/VBox/Runtime/win/RTErrConvertFromWin32.cpp

    r106061 r106321  
    222222
    223223        case ERROR_SERVICE_ALREADY_RUNNING: return VERR_ALREADY_LOADED; /* Not the best match, but seen it with VBoxSup.sys. */
     224        case ERROR_NOT_FOUND:               return VERR_NOT_FOUND;
    224225
    225226
  • trunk/tools/bin/common-gen-workspace.inc.sh

    r106061 r106321  
    338338    fi
    339339    my_generate_project "ShClip-GH"     "src/VBox/GuestHost/SharedClipboard"    --begin-incs "include"                                          --end-includes "src/VBox/GuestHost/SharedClipboard"
     340    my_generate_project "Install-GH"    "src/VBox/GuestHost/installation"       --begin-incs "include"                                          --end-includes "src/VBox/GuestHost/installation"
    340341
    341342    # src/VBox/HostDrivers
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette