Changeset 35703 in vbox
- Timestamp:
- Jan 25, 2011 11:16:27 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Installer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp
r35649 r35703 122 122 void LogCallback(DIFXAPI_LOG Event, DWORD dwError, PCWSTR pEventDescription, PVOID pCallbackContext) 123 123 { 124 #ifdef DEBUG125 124 if (dwError == 0) 126 125 _tprintf(_T("(%u) %ws\n"), Event, pEventDescription); 127 126 else 128 127 _tprintf(_T("(%u) ERROR: %u - %ws\n"), Event, dwError, pEventDescription); 129 #else130 if (dwError > 0)131 _tprintf(_T("ERROR: (%u) %u - %ws\n"), Event, dwError, pEventDescription);132 #endif133 128 134 129 if (pCallbackContext) … … 144 139 * @param fSilent Flag indicating a silent installation (TRUE) or not (FALSE). 145 140 */ 146 int VBoxInstallDriver(const BOOL fInstall, const _TCHAR *pszDriverPath, BOOL fSilent) 141 int VBoxInstallDriver(const BOOL fInstall, const _TCHAR *pszDriverPath, BOOL fSilent, 142 const _TCHAR *pszLogFile) 147 143 { 148 144 HRESULT hr = ERROR_SUCCESS; … … 188 184 { 189 185 FILE *fh = NULL; 190 #ifdef DEBUG 191 char szLogFile[MAX_PATH + 1]; 192 sprintf(szLogFile, VBOX_DRVINST_LOGFILE); 193 fh = fopen(szLogFile, "a"); 194 if (!fh) 195 _tprintf(_T("ERROR: Unable to create log file!\n")); 196 else 197 _tprintf(_T("Logging enabled ...\n")); 198 #endif 199 g_pfnDIFXAPISetLogCallback(LogCallback, fh); 186 if (pszLogFile) 187 { 188 fh = _wfopen(pszLogFile, _T("a")); 189 if (!fh) 190 _tprintf(_T("ERROR: Unable to create log file!\n")); 191 g_pfnDIFXAPISetLogCallback(LogCallback, fh); 192 } 200 193 201 194 INSTALLERINFO instInfo = … … 337 330 } 338 331 g_pfnDIFXAPISetLogCallback(NULL, NULL); 339 #ifdef DEBUG340 332 if (fh) 341 333 fclose(fh); 342 #endif343 334 if (SUCCEEDED(hr)) 344 335 { … … 1010 1001 _tprintf(_T("\n")); 1011 1002 _tprintf(_T("Drivers:\n")); 1012 _tprintf(_T("\tVBoxDrvInst driver install <inf-file> \n"));1013 _tprintf(_T("\tVBoxDrvInst driver uninstall <inf-file> \n"));1003 _tprintf(_T("\tVBoxDrvInst driver install <inf-file> [log file]\n")); 1004 _tprintf(_T("\tVBoxDrvInst driver uninstall <inf-file> [log file]\n")); 1014 1005 _tprintf(_T("\tVBoxDrvInst driver executeinf <inf-file>\n")); 1015 1006 _tprintf(_T("\n")); … … 1056 1047 { 1057 1048 _stprintf(szINF, _T("%ws"), argv[3]); 1058 rc = VBoxInstallDriver(!_tcsicmp(argv[2], _T("install")) ? TRUE : FALSE, szINF, FALSE); 1049 1050 _TCHAR szLogFile[_MAX_PATH] = { 0 }; 1051 if (argc > 4) 1052 _stprintf(szLogFile, _T("%ws"), argv[4]); 1053 rc = VBoxInstallDriver(!_tcsicmp(argv[2], _T("install")) ? TRUE : FALSE, szINF, 1054 FALSE /* Not silent */, szLogFile[0] != NULL ? szLogFile : NULL); 1059 1055 } 1060 1056 } -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh
r35700 r35703 345 345 ${If} $g_bNoGuestDrv == "false" 346 346 DetailPrint "Installing guest driver ..." 347 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxGuest.inf" '347 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxGuest.inf" "$INSTDIR\install_drivers.log"' 348 348 Pop $0 ; Ret value 349 349 LogText "Guest driver returned: $0" … … 356 356 ${If} $g_bWithWDDM == "true" 357 357 DetailPrint "Installing WDDM video driver ..." 358 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf" '358 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf" "$INSTDIR\install_drivers.log"' 359 359 ${Else} 360 360 DetailPrint "Installing video driver ..." 361 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideo.inf" '361 nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideo.inf" "$INSTDIR\install_drivers.log"' 362 362 ${EndIf} 363 363 Pop $0 ; Ret value
Note:
See TracChangeset
for help on using the changeset viewer.