Index: trunk/src/VBox/GuestHost/installation/VBoxWinDrvInst.cpp
===================================================================
--- trunk/src/VBox/GuestHost/installation/VBoxWinDrvInst.cpp	(revision 107057)
+++ trunk/src/VBox/GuestHost/installation/VBoxWinDrvInst.cpp	(revision 107059)
@@ -1011,5 +1011,8 @@
                 vboxWinDrvInstLogVerbose(pCtx, 1, "Using g_pfnDiInstallDriverW(), dwInstallFlags=%#x", dwInstallFlags);
 
-                fRc = g_pfnDiInstallDriverW(NULL /* hWndParent */, pParms->pwszInfFile, dwInstallFlags, &fReboot);
+                if (!(pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN))
+                    fRc = g_pfnDiInstallDriverW(NULL /* hWndParent */, pParms->pwszInfFile, dwInstallFlags, &fReboot);
+                else
+                    fRc = TRUE;
                 if (!fRc)
                 {
@@ -1056,7 +1059,11 @@
                                              pParms->u.UnInstall.pwszPnpId, pParms->pwszInfFile, dwInstallFlags);
 
-                    fRc = g_pfnUpdateDriverForPlugAndPlayDevicesW(NULL /* hWndParent */,
-                                                                  pParms->u.UnInstall.pwszPnpId,
-                                                                  pParms->pwszInfFile, dwInstallFlags, &fReboot);
+                    if (!(pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN))
+                        fRc = g_pfnUpdateDriverForPlugAndPlayDevicesW(NULL /* hWndParent */,
+                                                                      pParms->u.UnInstall.pwszPnpId,
+                                                                      pParms->pwszInfFile, dwInstallFlags, &fReboot);
+                    else
+                        fRc = TRUE;
+
                     if (!fRc)
                     {
@@ -1101,6 +1108,9 @@
                     {
                         RTUTF16 wszDstPathAbs[RTPATH_MAX] = { 0 };
-                        fRc = g_pfnSetupCopyOEMInfW(wszInfFileAbs, wszSrcPathAbs, SPOST_PATH, 0,
-                                                    wszDstPathAbs, RT_ELEMENTS(wszDstPathAbs), NULL, NULL);
+                        if (!(pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN))
+                            fRc = g_pfnSetupCopyOEMInfW(wszInfFileAbs, wszSrcPathAbs, SPOST_PATH, 0,
+                                                        wszDstPathAbs, RT_ELEMENTS(wszDstPathAbs), NULL, NULL);
+                        else
+                            fRc = TRUE;
 
                         vboxWinDrvInstLogVerbose(pCtx, 1, "   INF file: %ls", wszInfFileAbs);
@@ -1445,5 +1455,8 @@
             vboxWinDrvInstLogVerbose(pCtx, 1, "Using DiUninstallDriverW()");
             BOOL fReboot = FALSE;
-            fRc = g_pfnDiUninstallDriverW(NULL /* hWndParent */, pCur->wszInfFile, 0 /* Flags */, &fReboot);
+            if (!(pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN))
+                fRc = g_pfnDiUninstallDriverW(NULL /* hWndParent */, pCur->wszInfFile, 0 /* Flags */, &fReboot);
+            else
+                fRc = TRUE;
             if (fRc)
                 pCtx->fReboot = RT_BOOL(fReboot);
@@ -1466,5 +1479,8 @@
                 dwUninstallFlags |= SUOI_FORCEDELETE;
 
-            fRc = g_pfnSetupUninstallOEMInfW(pCur->wszInfFile, dwUninstallFlags, NULL /* pReserved */);
+            if (!(pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN))
+                fRc = g_pfnSetupUninstallOEMInfW(pCur->wszInfFile, dwUninstallFlags, NULL /* pReserved */);
+            else
+                fRc = FALSE;
         }
 
@@ -1550,4 +1566,7 @@
     bool const fInstall = pParms->enmMode == VBOXWINDRVINSTMODE_INSTALL
                        || pParms->enmMode == VBOXWINDRVINSTMODE_INSTALL_INFSECTION;
+
+    if (pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN)
+        vboxWinDrvInstLogWarn(pCtx, "Dry-run mode active -- no installation performed!");
 
     const char * const pszLogAction = fInstall ? "Installing" : "Uninstalling";
@@ -1563,5 +1582,6 @@
     {
         vboxWinDrvInstLogInfo(pCtx, "Setting non-interactive mode ...");
-        g_pfnSetupSetNonInteractiveMode(TRUE /* fEnable */);
+        if (!(pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_DRYRUN))
+            g_pfnSetupSetNonInteractiveMode(TRUE /* fEnable */);
     }
 
@@ -1772,8 +1792,11 @@
     int rc = RTPathReal(pszInfFile, szInfPathAbs, sizeof(szInfPathAbs));
     if (RT_SUCCESS(rc))
+    {
         rc = RTStrToUtf16(szInfPathAbs, &pCtx->Parms.pwszInfFile);
-
-    if (RT_FAILURE(rc))
-        vboxWinDrvInstLogError(pCtx, "Failed to build path for INF file \"%s\", rc=%Rrc", pszInfFile, rc);
+        if (RT_FAILURE(rc))
+            vboxWinDrvInstLogError(pCtx, "Failed to build path for INF file \"%s\", rc=%Rrc", pszInfFile, rc);
+    }
+    else
+        vboxWinDrvInstLogError(pCtx, "Determining real path for INF file \"%s\" failed, rc=%Rrc", pszInfFile, rc);
 
     if (RT_SUCCESS(rc) && pszModel) /* Model is optional. */
