diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-20 19:01:13 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-20 19:01:13 +0000 |
commit | 452fc5418259b01cdd2d92c00e03780ef04b4be4 (patch) | |
tree | 597bc2da45d6cedcb366a2aea55ab3ce68eb8e3d /chrome/installer/util/install_util.cc | |
parent | 2ceafa3ddbaaa90ff73abf9941eae217c7808710 (diff) | |
download | chromium_src-452fc5418259b01cdd2d92c00e03780ef04b4be4.zip chromium_src-452fc5418259b01cdd2d92c00e03780ef04b4be4.tar.gz chromium_src-452fc5418259b01cdd2d92c00e03780ef04b4be4.tar.bz2 |
Now omaha supports displaying custom error string through registry keys.
Add error strings in Chrome installer.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/install_util.cc')
-rw-r--r-- | chrome/installer/util/install_util.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index 29bc51d..0374236 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -15,6 +15,8 @@ #include "base/win_util.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" +#include "chrome/installer/util/l10n_string_util.h" +#include "chrome/installer/util/work_item_list.h" bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe, const std::wstring& params, @@ -80,3 +82,21 @@ bool InstallUtil::IsOSSupported() { } return false; } + +void InstallUtil::SetInstallerError(bool system_install, + installer_util::InstallStatus status, + int string_resource_id) { + HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + std::wstring key(google_update::kRegPathClients); + key.append(L"\\"); + key.append(google_update::kChromeGuid); + scoped_ptr<WorkItemList> install_list(WorkItem::CreateWorkItemList()); + install_list->AddSetRegValueWorkItem(root, key, L"InstallerResult", 1, true); + install_list->AddSetRegValueWorkItem(root, key, L"InstallerError", + status, true); + std::wstring msg = installer_util::GetLocalizedString(string_resource_id); + install_list->AddSetRegValueWorkItem(root, key, L"InstallerResultUIString", + msg, true); + if (!install_list->Do()) + LOG(ERROR) << "Failed to record installer error information in registry."; +} |