Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: cloud_print/virtual_driver/win/install/setup.cc

Issue 2577583003: Retry installing with UI if silent installation is unsuccessful. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/virtual_driver/win/install/setup.cc
diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc
index 3c4bcad27a2833a4fa4b959f31de4b394b78bf82..6b0cf616b7cd24ba86460cc923b9053f9c66806a 100644
--- a/cloud_print/virtual_driver/win/install/setup.cc
+++ b/cloud_print/virtual_driver/win/install/setup.cc
@@ -149,9 +149,21 @@ HRESULT InstallDriver(const base::FilePath& install_path) {
NULL, inf_file.value().c_str(), NULL,
UPDP_SILENT_UPLOAD | UPDP_UPLOAD_ALWAYS, NULL, package_path, &size);
if (FAILED(result)) {
- LOG(ERROR)
- << "Uploading the printer driver package to the driver cache failed.";
- return result;
+ LOG(WARNING)
+ << "Uploading the printer driver package to the driver cache silently "
+ << "failed. Will retry with user UI. HRESULT=0x" << std::setbase(16)
+ << result;
+
+ result = UploadPrinterDriverPackage(
+ NULL, inf_file.value().c_str(), NULL, UPDP_UPLOAD_ALWAYS,
+ GetForegroundWindow(), package_path, &size);
+
+ if (FAILED(result)) {
+ LOG(WARNING)
+ << "Uploading the printer driver package to the driver cache failed"
+ << "with user UI. Aborting.";
+ return result;
+ }
}
result = InstallPrinterDriverFromPackage(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698