Changeset 106321 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 15, 2024 1:06:30 PM (4 months ago)
- svn:sync-xref-src-repo-rev:
- 165131
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk
r106247 r106321 62 62 endif 63 63 VBoxDrvInst_DEPS = $(VBOX_SVN_REV_KMK) 64 VBoxDrvInst_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST) VBoxWinNewDevLib64 VBoxDrvInst_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST) 65 65 VBoxDrvInst_INCS = ../include 66 VBoxDrvInst_LIBS = \67 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/setupapi.lib68 66 VBoxDrvInst_SOURCES = \ 69 67 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 71 72 VBoxDrvInst_VBOX_IMPORT_CHECKER.win.x86 := nt4 # setupapi was introduced in NT4 72 73 … … 263 264 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \ 264 265 -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \ 265 -E 'VBOX_PATH_DIFX=$(subst /,\,$(VBOX_PATH_DIFX))' \266 266 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \ 267 267 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \ -
trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp
r106061 r106321 39 39 #include <iprt/win/windows.h> 40 40 #include <iprt/win/setupapi.h> 41 #include <newdev.h> /* For INSTALLFLAG_XXX. */ 42 #include <cfgmgr32.h> /* For MAX_DEVICE_ID_LEN. */ 41 43 #include <devguid.h> 42 44 #include <RegStr.h> … … 47 49 48 50 #include <iprt/asm.h> 51 #include <iprt/err.h> 52 #include <iprt/initterm.h> 53 #include <iprt/ldr.h> 49 54 #include <iprt/mem.h> 55 #include <iprt/message.h> 56 #include <iprt/once.h> 50 57 #include <iprt/path.h> /* RTPATH_IS_SEP */ 58 #include <iprt/stream.h> 51 59 #include <iprt/string.h> 60 #include <iprt/system.h> 52 61 #include <iprt/utf16.h> 62 63 #include <VBox/GuestHost/VBoxWinDrvInst.h> 53 64 54 65 /* Exit codes */ … … 65 76 * Defines * 66 77 *********************************************************************************************************************************/ 67 /* Defines */68 #define DRIVER_PACKAGE_REPAIR 0x0000000169 #define DRIVER_PACKAGE_SILENT 0x0000000270 #define DRIVER_PACKAGE_FORCE 0x0000000471 #define DRIVER_PACKAGE_ONLY_IF_DEVICE_PRESENT 0x0000000872 #define DRIVER_PACKAGE_LEGACY_MODE 0x0000001073 #define DRIVER_PACKAGE_DELETE_FILES 0x0000002074 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_FAILED78 # define ERROR_DRIVER_STORE_ADD_FAILED (APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x0247L)79 #endif80 #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 83 78 /* Registry string list flags */ 84 79 #define VBOX_REG_STRINGLIST_NONE 0x00000000 /**< No flags set. */ 85 80 #define VBOX_REG_STRINGLIST_ALLOW_DUPLICATES 0x00000001 /**< Allows duplicates in list when adding a value. */ 86 87 #ifdef DEBUG88 # define VBOX_DRVINST_LOGFILE "C:\\Temp\\VBoxDrvInstDIFx.log"89 #endif90 81 91 82 /** NT4: The video service name. */ … … 96 87 97 88 /********************************************************************************************************************************* 98 * Structures and Typedefs *99 *********************************************************************************************************************************/100 typedef struct101 {102 PCWSTR pApplicationId;103 PCWSTR pDisplayName;104 PCWSTR pProductName;105 PCWSTR pMfgName;106 } INSTALLERINFO, *PINSTALLERINFO;107 typedef const PINSTALLERINFO PCINSTALLERINFO;108 109 typedef enum110 {111 DIFXAPI_SUCCESS,112 DIFXAPI_INFO,113 DIFXAPI_WARNING,114 DIFXAPI_ERROR115 } 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 /*********************************************************************************************************************************124 89 * Global Variables * 125 90 *********************************************************************************************************************************/ 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 132 91 static char *ArgToUtf8(wchar_t const *pwszString, const char *pszArgName) 133 92 { … … 198 157 } 199 158 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 else228 {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 else261 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 else321 WriteFile(hLogFile, RT_STR_TUPLE("<RTUtf16ToUtf8 failed>'\r\n"), &dwIgn, NULL);322 }323 159 324 160 #ifdef RT_ARCH_X86 … … 618 454 } 619 455 620 621 /** 622 * Installs or uninstalls a driver. 456 /** 457 * Logging callback for the Windows driver (un)installation code. 458 */ 459 static 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. 623 493 * 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 */ 498 static 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 */ 558 static int driverLogOpen(const wchar_t *pwszLogFile, PHANDLE phLog) 559 { 560 int rc = VINF_SUCCESS; 561 562 /* Failures here are non-fatal. */ 677 563 if (pwszLogFile) 678 564 { 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 } 683 574 else 575 { 684 576 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 */ 590 static int driverLogClose(HANDLE hLog) 591 { 592 if (hLog != INVALID_HANDLE_VALUE) 593 CloseHandle(hLog); 594 595 return VINF_SUCCESS; 596 } 851 597 852 598 /** Handles 'driver install'. */ 853 599 static int handleDriverInstall(unsigned cArgs, wchar_t **papwszArgs) 854 600 { 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 } 859 637 860 638 /** Handles 'driver uninstall'. */ 861 639 static int handleDriverUninstall(unsigned cArgs, wchar_t **papwszArgs) 862 640 { 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 874 657 #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"); 876 661 #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)) 928 665 { 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); 931 670 } 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; 946 681 } 947 682 … … 950 685 static int handleDriverExecuteInf(unsigned cArgs, wchar_t **papwszArgs) 951 686 { 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; 954 720 } 955 721 … … 2458 2224 "\r\n" 2459 2225 "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" 2463 2229 " VBoxDrvInst driver nt4-install-video [install-dir]\r\n" 2464 2230 "\r\n" … … 2494 2260 int wmain(int argc, wchar_t **argv) 2495 2261 { 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); 2498 2265 2499 2266 static struct … … 2505 2272 } s_aActions[] = 2506 2273 { 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 }, 2510 2277 { "driver", "nt4-install-video", 0, 1, handleDriverNt4InstallVideo }, 2511 2278 { "service", "create", 5, 9, handleServiceCreate }, -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh
r106061 r106321 56 56 !endif 57 57 58 FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"59 58 FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe" 60 59 … … 215 214 SetOutPath "$0\Tools" 216 215 FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe" 217 FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"218 216 !ifdef VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST 219 217 FILE "$%PATH_OUT%\bin\additions\VBoxAudioTest.exe" -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstall.nsh
r106061 r106321 35 35 ; Remove common files 36 36 Delete /REBOOTOK "$INSTDIR\VBoxDrvInst.exe" 37 Delete /REBOOTOK "$INSTDIR\DIFxAPI.dll"38 37 39 38 Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf" … … 132 131 exit: 133 132 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 134 148 FunctionEnd 135 149 !macroend -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh
r106061 r106321 344 344 !endif 345 345 ${EndIf} 346 347 ; Log the certificates present on the system.348 ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" display-all" 'non-zero-exitcode=log'349 346 !endif ; VBOX_SIGN_ADDITIONS 350 347 … … 514 511 ${If} $g_bNoGuestDrv == "false" 515 512 ${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' 517 514 ${Else} 518 515 ${LogVerbose} "Guest driver installation skipped!" … … 522 519 ${If} $g_bWithWDDM == "true" 523 520 ${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' 525 522 ${Else} 526 523 ${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' 528 525 ${EndIf} 529 526 ${Else} … … 536 533 ${If} $g_bNoMouseDrv == "false" 537 534 ${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' 542 536 ${Else} 543 537 ${LogVerbose} "Mouse driver installation skipped!" … … 690 684 ; Remove VirtualBox video driver 691 685 ${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' 693 687 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" 'non-zero-exitcode=log' 694 688 Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys" … … 699 693 700 694 ${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' 702 696 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxWddm" 'non-zero-exitcode=log' 703 697 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall … … 707 701 ; Obsolete files begin 708 702 ${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' 710 704 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" 'non-zero-exitcode=log' 711 705 ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall … … 714 708 715 709 ${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' 717 711 ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently 718 712 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" 'non-zero-exitcode=log' … … 751 745 ; Remove mouse driver 752 746 ${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! 755 749 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" 'non-zero-exitcode=log' 756 750 … … 776 770 ; Remove guest driver 777 771 ${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' 779 773 780 774 ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" 'non-zero-exitcode=log' -
trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMouse.inf
r106061 r106321 34 34 ;edit-DriverVer=08/26/2008,2.00.0000 35 35 ;cat CatalogFile=VBoxMouse.cat 36 ;PnpLockdown=1 36 37 37 38 [SourceDisksNames] 38 1 = %VBoxMouse .MediaDesc%39 1 = %VBoxMouse_DiskDesc%,,, 39 40 40 41 [SourceDisksFiles] … … 44 45 DefaultDestDir = 12 ; DIRID_DRIVERS 45 46 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. 58 49 59 50 [DefaultInstall@DOT-NT-ARCH@] 60 CopyFiles = @VBoxMouse.sys 51 %ORACLE%=VBoxMouse@COMMA-NT-ARCH@ 52 CopyFiles = VBoxMouse_CopyFiles 61 53 62 54 [DefaultInstall@[email protected]] 63 AddService = VBoxMouse, ,VBoxMouse.Service55 AddService = VBoxMouse,0x00000002,VBoxMouse_Service 64 56 65 [VBoxMouse.AddRegistry] 57 [DefaultUninstall@DOT-NT-ARCH@] 58 [email protected] 59 LegacyUninstall=1 60 61 [DefaultUninstall@[email protected]] 62 DelService = VBoxMouse,0x00000200 63 LegacyUninstall = 1 64 65 [VBoxMouse_AddReg] 66 66 HKLM, System\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}, UpperFilters, 0x00010000, "VBoxMouse", "mouclass" 67 67 68 [VBoxMouse.Service] 69 DisplayName = %VBoxMouse.SvcDesc% 68 [VBoxMouse_CopyFiles] 69 VBoxMouse.sys 70 71 [VBoxMouse_Service] 72 DisplayName = %VBoxMouse_SvcDesc% 70 73 ServiceType = %SERVICE_KERNEL_DRIVER% 71 74 StartType = %SERVICE_DEMAND_START% 72 75 ErrorControl = %SERVICE_ERROR_IGNORE% 73 76 ServiceBinary = %12%\VBoxMouse.sys 74 AddReg = VBoxMouse .AddRegistry77 AddReg = VBoxMouse_AddReg 75 78 76 79 [Strings] 77 VBoxMouse.SvcDesc = "VirtualBox Guest Mouse Service" 78 VBoxMouse.MediaDesc = "VirtualBox Guest Mouse Driver Installation Media" 79 ORACLE = "Oracle Corporation" 80 ORACLE = "Oracle Corporation" 81 VBoxMouse_SvcDesc ="VirtualBox Guest Mouse Service" 82 VBoxMouse_DrvDesc ="VirtualBox Guest Mouse Driver" 83 VBoxMouse_DiskDesc ="VBoxMouse Installation Disk" 80 84 81 85 ; Useful constants … … 83 87 SERVICE_DEMAND_START = 3 84 88 SERVICE_ERROR_IGNORE = 0 89 SERVICE_ERROR_NORMAL = 1 90 -
trunk/src/VBox/Additions/WINNT/include/NoCrtOutput.h
r106240 r106321 489 489 490 490 491 DECLINLINE(void) PrintSS(const char *pszMsg1, const char *pszMsg2) 492 { 493 PrintStr(pszMsg1); 494 PrintStr(pszMsg2); 495 } 496 497 498 DECLINLINE(void) PrintSSS(const char *pszMsg1, const char *pszMsg2, const char *pszMsg3) 499 { 500 PrintStr(pszMsg1); 501 PrintStr(pszMsg2); 502 PrintStr(pszMsg3); 503 } 504 505 491 506 DECLINLINE(void) PrintSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3) 492 507 { -
trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk
r106061 r106321 53 53 VBoxGuest_NAME.solaris = vboxguest 54 54 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? 56 56 VBoxGuest_INSTTYPE.win = none 57 57 VBoxGuest_DEBUG_INSTTYPE.win = both 58 endif58 #endif 59 59 VBoxGuest_DEFS.haiku = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1 60 60 VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV) … … 114 114 endif # win 115 115 ifn1of ($(KBUILD_TARGET), linux freebsd netbsd solaris haiku) 116 VBoxGuest_SOURCES 116 VBoxGuest_SOURCES += VBoxGuest-$(KBUILD_TARGET).cpp 117 117 else 118 VBoxGuest_SOURCES 118 VBoxGuest_SOURCES += VBoxGuest-$(KBUILD_TARGET).c 119 119 VBoxGuest_$(KBUILD_TARGET).c_DEPS = $(VBOX_SVN_REV_HEADER) 120 120 ifeq ($(KBUILD_TARGET),freebsd) … … 125 125 VBoxGuest.cpp 126 126 VBoxGuest_SOURCES.win += \ 127 win/VBoxGuest.inf \ 127 128 win/VBoxGuest.rc 128 129 VBoxGuest_SOURCES.win.x86 += \ -
trunk/src/VBox/Additions/common/VBoxGuest/win/VBoxGuest.inf
r106208 r106321 43 43 ;edit-DriverVer=08/26/2008,2.00.0000 44 44 ;cat CatalogFile=VBoxGuest.cat 45 ;PnpLockdown=1 45 46 46 47 [SourceDisksNames] 47 1 = %VBoxGuest .MediaDesc%48 1 = %VBoxGuest_MediaDesc%,,, 48 49 49 50 [SourceDisksFiles] … … 53 54 54 55 [DestinationDirs] 55 DefaultDestDir= 12 ; drivers56 VBoxGuest_CopyFiles = 12 ; drivers 56 57 VBoxTray_CopyFiles = 11 ; system32 57 58 … … 64 65 [VBoxGuest_Install] 65 66 CopyFiles = VBoxGuest_CopyFiles, VBoxTray_CopyFiles 66 AddReg = VBoxTray_Add _Reg67 AddReg = VBoxTray_AddReg 67 68 68 69 [VBoxGuest_CopyFiles] … … 74 75 75 76 [VBoxGuest_Install.Services] 76 AddService = VBoxGuest, 0x00000002, VBoxGuest_ ServiceInstallSection77 AddService = VBoxGuest, 0x00000002, VBoxGuest_AddService 77 78 DelService = VBoxTray, 0x00000004 78 79 79 [VBoxGuest_ ServiceInstallSection]80 DisplayName = %VBoxGuest_ svcdesc%81 ServiceType = 0x00000001 ; kernel driver82 StartType = 0x00000000 ; boot start83 ErrorControl = 0x00000001 ; normal error handling80 [VBoxGuest_AddService] 81 DisplayName = %VBoxGuest_SvcDesc% 82 ServiceType = %SERVICE_TYPE_KERNEL_DRIVER% 83 StartType = %SERVICE_STARTTYPE_BOOT% 84 ErrorControl = %SERVICE_ERRORCTL_NORMAL% 84 85 LoadOrderGroup = Base 85 86 ServiceBinary = %12%\VBoxGuest.sys 86 87 87 [VBoxTray_Add _Reg]88 [VBoxTray_AddReg] 88 89 HKLM, SOFTWARE\Microsoft\Windows\CurrentVersion\Run, VBoxTray, 0x00020000, %%SystemRoot%%\system32\VBoxTray.exe 89 90 … … 94 95 ORACLE = "Oracle Corporation" 95 96 VBoxGuest.DeviceDesc = "VirtualBox Guest Device" 96 VBoxGuest_svcdesc = "VirtualBox Guest Driver" 97 VBoxTray_svcdesc = "VirtualBox Guest Tray" 98 VBoxGuest.MediaDesc = "VirtualBox Guest Driver Installation Disk" 97 VBoxGuest_SvcDesc = "VirtualBox Guest Driver" 98 VBoxTray_SvcDesc = "VirtualBox Guest Tray" 99 VBoxGuest_MediaDesc = "VirtualBox Guest Driver Installation Disk" 100 101 ; Useful constants 102 SERVICE_TYPE_KERNEL_DRIVER = 1 103 SERVICE_STARTTYPE_BOOT = 0 104 SERVICE_STARTTYPE_DEMAND = 3 105 SERVICE_ERRORCTL_IGNORE = 0 106 SERVICE_ERRORCTL_NORMAL = 1 107
Note:
See TracChangeset
for help on using the changeset viewer.