Index: trunk/src/VBox/GuestHost/installation/VBoxDrvInst.cpp
===================================================================
--- trunk/src/VBox/GuestHost/installation/VBoxDrvInst.cpp	(revision 107185)
+++ trunk/src/VBox/GuestHost/installation/VBoxDrvInst.cpp	(revision 107392)
@@ -140,5 +140,6 @@
     VBOXDRVINST_INSTALL_OPT_PNPID,
     VBOXDRVINST_INSTALL_OPT_NOT_FORCE,
-    VBOXDRVINST_INSTALL_OPT_NOT_SILENT
+    VBOXDRVINST_INSTALL_OPT_NOT_SILENT,
+    VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT
 };
 
@@ -148,12 +149,13 @@
 static const RTGETOPTDEF g_aCmdInstallOptions[] =
 {
-    { "--inf-file",    VBOXDRVINST_INSTALL_OPT_INF_FILE,    RTGETOPT_REQ_STRING   },
-    { "--inf-section", VBOXDRVINST_INSTALL_OPT_INF_SECTION, RTGETOPT_REQ_STRING   },
-    { "--model",       VBOXDRVINST_INSTALL_OPT_MODEL,       RTGETOPT_REQ_STRING   },
-    { "--pnp",         VBOXDRVINST_INSTALL_OPT_PNPID,       RTGETOPT_REQ_STRING   },
-    { "--pnpid" ,      VBOXDRVINST_INSTALL_OPT_PNPID,       RTGETOPT_REQ_STRING   },
-    { "--pnp-id",      VBOXDRVINST_INSTALL_OPT_PNPID,       RTGETOPT_REQ_STRING   },
-    { "--not-force",   VBOXDRVINST_INSTALL_OPT_NOT_FORCE,   RTGETOPT_REQ_NOTHING  },
-    { "--not-silent",  VBOXDRVINST_INSTALL_OPT_NOT_SILENT,  RTGETOPT_REQ_NOTHING  }
+    { "--inf-file",      VBOXDRVINST_INSTALL_OPT_INF_FILE,       RTGETOPT_REQ_STRING  },
+    { "--inf-section",   VBOXDRVINST_INSTALL_OPT_INF_SECTION,    RTGETOPT_REQ_STRING  },
+    { "--model",         VBOXDRVINST_INSTALL_OPT_MODEL,          RTGETOPT_REQ_STRING  },
+    { "--pnp",           VBOXDRVINST_INSTALL_OPT_PNPID,          RTGETOPT_REQ_STRING  },
+    { "--pnpid" ,        VBOXDRVINST_INSTALL_OPT_PNPID,          RTGETOPT_REQ_STRING  },
+    { "--pnp-id",        VBOXDRVINST_INSTALL_OPT_PNPID,          RTGETOPT_REQ_STRING  },
+    { "--not-force",     VBOXDRVINST_INSTALL_OPT_NOT_FORCE,      RTGETOPT_REQ_NOTHING },
+    { "--not-silent",    VBOXDRVINST_INSTALL_OPT_NOT_SILENT,     RTGETOPT_REQ_NOTHING },
+    { "--ignore-reboot", VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT, RTGETOPT_REQ_NOTHING }
 };
 
@@ -179,5 +181,6 @@
     VBOXDRVINST_UNINSTALL_OPT_INF_SECTION,
     VBOXDRVINST_UNINSTALL_OPT_MODEL,
-    VBOXDRVINST_UNINSTALL_OPT_PNPID
+    VBOXDRVINST_UNINSTALL_OPT_PNPID,
+    VBOXDRVINST_UNINSTALL_OPT_IGNORE_REBOOT
 };
 
@@ -187,10 +190,11 @@
 static const RTGETOPTDEF g_aCmdUninstallOptions[] =
 {
-    { "--inf-file",    VBOXDRVINST_UNINSTALL_OPT_INF_FILE,    RTGETOPT_REQ_STRING  },
-    { "--inf-section", VBOXDRVINST_UNINSTALL_OPT_INF_SECTION, RTGETOPT_REQ_STRING  },
-    { "--model",       VBOXDRVINST_UNINSTALL_OPT_MODEL,       RTGETOPT_REQ_STRING  },
-    { "--pnp",         VBOXDRVINST_UNINSTALL_OPT_PNPID,       RTGETOPT_REQ_STRING  },
-    { "--pnpid" ,      VBOXDRVINST_UNINSTALL_OPT_PNPID,       RTGETOPT_REQ_STRING  },
-    { "--pnp-id",      VBOXDRVINST_UNINSTALL_OPT_PNPID,       RTGETOPT_REQ_STRING  }
+    { "--inf-file",      VBOXDRVINST_UNINSTALL_OPT_INF_FILE,      RTGETOPT_REQ_STRING  },
+    { "--inf-section",   VBOXDRVINST_UNINSTALL_OPT_INF_SECTION,   RTGETOPT_REQ_STRING  },
+    { "--model",         VBOXDRVINST_UNINSTALL_OPT_MODEL,         RTGETOPT_REQ_STRING  },
+    { "--pnp",           VBOXDRVINST_UNINSTALL_OPT_PNPID,         RTGETOPT_REQ_STRING  },
+    { "--pnpid" ,        VBOXDRVINST_UNINSTALL_OPT_PNPID,         RTGETOPT_REQ_STRING  },
+    { "--pnp-id",        VBOXDRVINST_UNINSTALL_OPT_PNPID,         RTGETOPT_REQ_STRING  },
+    { "--ignore-reboot", VBOXDRVINST_UNINSTALL_OPT_IGNORE_REBOOT, RTGETOPT_REQ_NOTHING }
 };
 
@@ -401,10 +405,11 @@
     switch (pOpt->iShort)
     {
-        case VBOXDRVINST_INSTALL_OPT_INF_FILE:    return "Specifies the INF file to install";
-        case VBOXDRVINST_INSTALL_OPT_INF_SECTION: return "Specifies the INF section to install";
-        case VBOXDRVINST_INSTALL_OPT_MODEL:       return "Specifies the driver model";
-        case VBOXDRVINST_INSTALL_OPT_PNPID:       return "Specifies the PnP (device) ID";
-        case VBOXDRVINST_INSTALL_OPT_NOT_FORCE:   return "Installation will not be forced";
-        case VBOXDRVINST_INSTALL_OPT_NOT_SILENT:  return "Installation will not run in silent mode";
+        case VBOXDRVINST_INSTALL_OPT_INF_FILE:      return "Specifies the INF file to install";
+        case VBOXDRVINST_INSTALL_OPT_INF_SECTION:   return "Specifies the INF section to install";
+        case VBOXDRVINST_INSTALL_OPT_MODEL:         return "Specifies the driver model";
+        case VBOXDRVINST_INSTALL_OPT_PNPID:         return "Specifies the PnP (device) ID";
+        case VBOXDRVINST_INSTALL_OPT_NOT_FORCE:     return "Installation will not be forced";
+        case VBOXDRVINST_INSTALL_OPT_NOT_SILENT:    return "Installation will not run in silent mode";
+        case VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT: return "Ignores reboot requirements";
         default:
             break;
@@ -428,4 +433,7 @@
     /* By default we want to force an installation and be silent. */
     uint32_t fInstall = VBOX_WIN_DRIVERINSTALL_F_SILENT | VBOX_WIN_DRIVERINSTALL_F_FORCE;
+
+    /* Whether to ignore reboot messages or not. This will also affect the returned exit code. */
+    bool fIgnoreReboot = false;
 
     int rc = VINF_SUCCESS;
@@ -473,4 +481,8 @@
                 break;
 
+            case VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT:
+                fIgnoreReboot = true;
+                break;
+
             default:
                 return RTGetOptPrintError(ch, &ValueUnion);
@@ -492,5 +504,6 @@
         if (RT_SUCCESS(rc))
         {
-            if (rc == VINF_REBOOT_NEEDED)
+            if (   rc == VINF_REBOOT_NEEDED
+                && !fIgnoreReboot)
                 rcExit = (RTEXITCODE)VBOXDRVINSTEXITCODE_REBOOT_NEEDED;
         }
@@ -514,8 +527,9 @@
     switch (pOpt->iShort)
     {
-        case VBOXDRVINST_UNINSTALL_OPT_INF_FILE:    return "Specifies the INF File to install";
-        case VBOXDRVINST_UNINSTALL_OPT_INF_SECTION: return "Specifies the INF section to install";
-        case VBOXDRVINST_UNINSTALL_OPT_MODEL:       return "Specifies the driver model to install";
-        case VBOXDRVINST_UNINSTALL_OPT_PNPID:       return "Specifies the PnP (device) ID to install";
+        case VBOXDRVINST_UNINSTALL_OPT_INF_FILE:      return "Specifies the INF File to install";
+        case VBOXDRVINST_UNINSTALL_OPT_INF_SECTION:   return "Specifies the INF section to install";
+        case VBOXDRVINST_UNINSTALL_OPT_MODEL:         return "Specifies the driver model to install";
+        case VBOXDRVINST_UNINSTALL_OPT_PNPID:         return "Specifies the PnP (device) ID to install";
+        case VBOXDRVINST_UNINSTALL_OPT_IGNORE_REBOOT: return "Ignores reboot requirements";
         default:
             break;
@@ -539,4 +553,7 @@
     /* By default we want a silent uninstallation. */
     uint32_t fInstall = VBOX_WIN_DRIVERINSTALL_F_SILENT;
+
+    /* Whether to ignore reboot messages or not. This will also affect the returned exit code. */
+    bool fIgnoreReboot = false;
 
     int rc = VINF_SUCCESS;
@@ -580,4 +597,8 @@
                 break;
 
+            case VBOXDRVINST_UNINSTALL_OPT_IGNORE_REBOOT:
+                fIgnoreReboot = true;
+                break;
+
             default:
                 return RTGetOptPrintError(ch, &ValueUnion);
@@ -599,5 +620,6 @@
         if (RT_SUCCESS(rc))
         {
-            if (rc == VINF_REBOOT_NEEDED)
+            if (   rc == VINF_REBOOT_NEEDED
+                && !fIgnoreReboot)
                 rcExit = (RTEXITCODE)VBOXDRVINSTEXITCODE_REBOOT_NEEDED;
         }
