Changeset 107764 in vbox for trunk/src/VBox/GuestHost
- Timestamp:
- Jan 15, 2025 9:57:00 AM (4 weeks ago)
- Location:
- trunk/src/VBox/GuestHost/installation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/installation/VBoxDrvInst.cpp
r107393 r107764 141 141 VBOXDRVINST_INSTALL_OPT_NOT_FORCE, 142 142 VBOXDRVINST_INSTALL_OPT_NOT_SILENT, 143 VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT 143 VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT, 144 VBOXDRVINST_INSTALL_OPT_DEBUG_OS_VER 144 145 }; 145 146 … … 157 158 { "--not-force", VBOXDRVINST_INSTALL_OPT_NOT_FORCE, RTGETOPT_REQ_NOTHING }, 158 159 { "--not-silent", VBOXDRVINST_INSTALL_OPT_NOT_SILENT, RTGETOPT_REQ_NOTHING }, 159 { "--ignore-reboot", VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT, RTGETOPT_REQ_NOTHING } 160 { "--ignore-reboot", VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT, RTGETOPT_REQ_NOTHING }, 161 { "--debug-os-ver", VBOXDRVINST_INSTALL_OPT_DEBUG_OS_VER, RTGETOPT_REQ_UINT32_PAIR } 160 162 }; 161 163 … … 414 416 case VBOXDRVINST_INSTALL_OPT_NOT_SILENT: return "Installation will not run in silent mode"; 415 417 case VBOXDRVINST_INSTALL_OPT_IGNORE_REBOOT: return "Ignores reboot requirements"; 418 case VBOXDRVINST_INSTALL_OPT_DEBUG_OS_VER: return "Overwrites the detected OS version"; 416 419 default: 417 420 break; … … 432 435 char *pszPnpId = NULL; 433 436 char *pszInfSection = NULL; 437 uint64_t uOsVer = 0; 434 438 435 439 /* By default we want to force an installation and be silent. */ … … 487 491 break; 488 492 493 case VBOXDRVINST_INSTALL_OPT_DEBUG_OS_VER: 494 uOsVer = RTSYSTEM_MAKE_NT_VERSION(ValueUnion.PairU32.uFirst, ValueUnion.PairU32.uSecond, 495 0 /* Build Version */); 496 break; 497 489 498 default: 490 499 return RTGetOptPrintError(ch, &ValueUnion); … … 503 512 if (RT_SUCCESS(rc)) 504 513 { 514 if (uOsVer) 515 VBoxWinDrvInstSetOsVersion(hWinDrvInst, uOsVer); 516 505 517 rc = VBoxWinDrvInstInstallEx(hWinDrvInst, pszInfFile, pszModel, pszPnpId, fInstall); 506 518 if (RT_SUCCESS(rc)) … … 712 724 RTStrmPrintf(pStrm, "\nExamples:\n"); 713 725 RTStrmPrintf(pStrm, "\t%s install --inf-file C:\\Path\\To\\VBoxUSB.inf\n", pszProcName); 726 RTStrmPrintf(pStrm, "\t%s install --debug-os-ver 6:0 --inf-file C:\\Path\\To\\VBoxGuest.inf\n", pszProcName); 714 727 RTStrmPrintf(pStrm, "\t%s uninstall --inf -file C:\\Path\\To\\VBoxUSB.inf --pnp-id \"USB\\VID_80EE&PID_CAFE\"\n", pszProcName); 715 728 RTStrmPrintf(pStrm, "\t%s uninstall --model \"VBoxUSB.AMD64\"\n", pszProcName); -
trunk/src/VBox/GuestHost/installation/VBoxWinDrvInst.cpp
r107061 r107764 160 160 /** Whether a reboot is needed in order to perform the current (un)installation. */ 161 161 bool fReboot; 162 /** OS version to use. Detected on creation. RTSYSTEM_NT_VERSION_GET_XXX style. 163 * Can be overwritten via VBoxWinDrvInstSetOsVersion(). */ 164 uint64_t uOsVer; 162 165 /** Parameters for (un)installation. */ 163 166 VBOXWINDRVINSTPARMS Parms; … … 948 951 BOOL fReboot = FALSE; 949 952 950 uint64_t const uNtVer = RTSystemGetNtVersion();951 952 953 /* 953 954 * Pre-install driver. 954 955 */ 955 956 DWORD dwInstallFlags = 0; 956 if ( uNtVer >= RTSYSTEM_MAKE_NT_VERSION(6, 0, 0)) /* for Vista / 2008 Server and up. */957 if (pCtx->uOsVer >= RTSYSTEM_MAKE_NT_VERSION(6, 0, 0)) /* for Vista / 2008 Server and up. */ 957 958 { 958 959 if (pParms->fFlags & VBOX_WIN_DRIVERINSTALL_F_FORCE) … … 997 998 { 998 999 /* Using INSTALLFLAG_NONINTERACTIVE will trigger an invalid parameter error on Windows 2000. */ 999 if ( uNtVer >= RTSYSTEM_MAKE_NT_VERSION(5, 1, 0))1000 if (pCtx->uOsVer >= RTSYSTEM_MAKE_NT_VERSION(5, 1, 0)) 1000 1001 dwInstallFlags |= INSTALLFLAG_NONINTERACTIVE; 1001 1002 else … … 1591 1592 pCtx->pvUser = pvUser; 1592 1593 1593 uint64_t const uNtVer = RTSystemGetNtVersion();1594 pCtx->uOsVer = RTSystemGetNtVersion(); /* Might be overwritten later via VBoxWinDrvInstSetOsVersion(). */ 1594 1595 1595 1596 vboxWinDrvInstLogInfo(pCtx, VBOX_PRODUCT " Version " VBOX_VERSION_STRING " - r%s", RTBldCfgRevisionStr()); 1596 vboxWinDrvInstLogInfo(pCtx, "Detected Windows version %d.%d.%d (%s)", RTSYSTEM_NT_VERSION_GET_MAJOR( uNtVer),1597 RTSYSTEM_NT_VERSION_GET_MINOR( uNtVer),1598 RTSYSTEM_NT_VERSION_GET_BUILD( uNtVer),1597 vboxWinDrvInstLogInfo(pCtx, "Detected Windows version %d.%d.%d (%s)", RTSYSTEM_NT_VERSION_GET_MAJOR(pCtx->uOsVer), 1598 RTSYSTEM_NT_VERSION_GET_MINOR(pCtx->uOsVer), 1599 RTSYSTEM_NT_VERSION_GET_BUILD(pCtx->uOsVer), 1599 1600 RTBldCfgTargetArch()); 1600 1601 … … 1685 1686 1686 1687 /** 1688 * Sets (overwrites) the current OS version used for the (un)installation code. 1689 * 1690 * @param hDrvInst Windows driver installer handle. 1691 * @param uOsVer OS version to set. RTSYSTEM_MAKE_NT_VERSION style. 1692 */ 1693 void VBoxWinDrvInstSetOsVersion(VBOXWINDRVINST hDrvInst, uint64_t uOsVer) 1694 { 1695 PVBOXWINDRVINSTINTERNAL pCtx = hDrvInst; 1696 VBOXWINDRVINST_VALID_RETURN_VOID(pCtx); 1697 1698 pCtx->uOsVer = uOsVer; 1699 1700 vboxWinDrvInstLogInfo(pCtx, "Set OS version to: %u.%u\n", RTSYSTEM_NT_VERSION_GET_MAJOR(pCtx->uOsVer), 1701 RTSYSTEM_NT_VERSION_GET_MINOR(pCtx->uOsVer)); 1702 } 1703 1704 /** 1687 1705 * Sets the verbosity of a Windows driver installer instance. 1688 1706 *
Note:
See TracChangeset
for help on using the changeset viewer.