diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-02 23:02:44 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-02 23:02:44 +0000 |
commit | 67d279ffb58fd4739a6e946c72c62422c6c17492 (patch) | |
tree | 4999ccec00df7c84e7af0cf5b3cf47316bf0003f /cloud_print/virtual_driver | |
parent | 0cbb85c6a7ecf0e6c406e3d7762e8d16eb336e42 (diff) | |
download | chromium_src-67d279ffb58fd4739a6e946c72c62422c6c17492.zip chromium_src-67d279ffb58fd4739a6e946c72c62422c6c17492.tar.gz chromium_src-67d279ffb58fd4739a6e946c72c62422c6c17492.tar.bz2 |
Set system error code for Google Update.
TBR=noamsml
NOTRY=true
Review URL: https://codereview.chromium.org/183803007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/virtual_driver')
-rw-r--r-- | cloud_print/virtual_driver/win/install/setup.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc index 2ac07ed..8613f3a 100644 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ b/cloud_print/virtual_driver/win/install/setup.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <comdef.h> #include <iomanip> #include <windows.h> #include <winspool.h> @@ -271,8 +270,6 @@ HRESULT InstallDriver(const base::FilePath& install_path) { base::FilePath ui_help_path = temp_path.path().Append(kHelpName); if (!base::PathExists(xps_path)) { - SetGoogleUpdateError(kGoogleUpdateProductId, - LoadLocalString(IDS_ERROR_NO_XPS)); return HRESULT_FROM_WIN32(ERROR_BAD_DRIVER); } @@ -537,17 +534,26 @@ int WINAPI WinMain(__in HINSTANCE hInstance, __in HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nCmdShow) { + using namespace cloud_print; + base::AtExitManager at_exit_manager; CommandLine::Init(0, NULL); - HRESULT retval = cloud_print::ExecuteCommands(); - VLOG(0) << _com_error(retval).ErrorMessage() << " HRESULT=0x" << - std::setbase(16) << retval; + HRESULT retval = ExecuteCommands(); + + if (retval == HRESULT_FROM_WIN32(ERROR_BAD_DRIVER)) { + SetGoogleUpdateError(kGoogleUpdateProductId, + LoadLocalString(IDS_ERROR_NO_XPS)); + } else if (FAILED(retval)) { + SetGoogleUpdateError(kGoogleUpdateProductId, retval); + } + + VLOG(0) << GetErrorMessage(retval) + << " HRESULT=0x" << std::setbase(16) << retval; // Installer is silent by default as required by Google Update. if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { - cloud_print::DisplayWindowsMessage(NULL, retval, - cloud_print::LoadLocalString(IDS_DRIVER_NAME)); + DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); } return retval; } |