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 | |
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')
-rw-r--r-- | chrome/installer/util/google_chrome_distribution.cc | 2 | ||||
-rw-r--r-- | chrome/installer/util/install_util.cc | 20 | ||||
-rwxr-xr-x | chrome/installer/util/install_util.h | 6 | ||||
-rw-r--r-- | chrome/installer/util/prebuild/create_string_rc.py | 10 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 2 |
5 files changed, 37 insertions, 3 deletions
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index f5ea433..ceeac44 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -16,11 +16,9 @@ #include "base/registry.h" #include "base/string_util.h" #include "base/wmi_util.h" -#include "chrome/installer/util/install_util.h" #include "chrome/installer/util/l10n_string_util.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_settings.h" -#include "chrome/installer/util/logging_installer.h" #include "installer_util_strings.h" 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."; +} diff --git a/chrome/installer/util/install_util.h b/chrome/installer/util/install_util.h index ed63175..8bf8d2f 100755 --- a/chrome/installer/util/install_util.h +++ b/chrome/installer/util/install_util.h @@ -39,6 +39,12 @@ class InstallUtil { // This function checks if the current OS is supported for Chromium.
static bool IsOSSupported();
+
+ // This function sets installer error information in registry so that Google
+ // Update can read it and display to the user.
+ static void SetInstallerError(bool system_install,
+ installer_util::InstallStatus status,
+ int string_resource_id);
private:
DISALLOW_EVIL_CONSTRUCTORS(InstallUtil);
};
diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py index 5c29d4e..c0a91ba 100644 --- a/chrome/installer/util/prebuild/create_string_rc.py +++ b/chrome/installer/util/prebuild/create_string_rc.py @@ -39,6 +39,16 @@ kStringIds = [ 'IDS_PRODUCT_NAME', 'IDS_UNINSTALL_CHROME', 'IDS_ABOUT_VERSION_COMPANY_NAME', + 'IDS_INSTALL_HIGHER_VERSION', + 'IDS_INSTALL_USER_LEVEL_EXISTS', + 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', + 'IDS_INSTALL_FAILED', + 'IDS_INSTALL_OS_NOT_SUPPORTED', + 'IDS_INSTALL_OS_ERROR', + 'IDS_INSTALL_TEMP_DIR_FAILED', + 'IDS_INSTALL_UNCOMPRESSION_FAILED', + 'IDS_INSTALL_INVALID_ARCHIVE', + 'IDS_UNINSTALL_FAILED', ] # The ID of the first resource string. diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index 5994ef0..41f5a3ed 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -17,7 +17,7 @@ enum InstallStatus { NEW_VERSION_UPDATED, // Chrome successfully updated to new version HIGHER_VERSION_EXISTS, // Higher version of Chrome already exists USER_LEVEL_INSTALL_EXISTS, // User level install already exists - MACHINE_LEVEL_INSTALL_EXISTS, // Machine level install already exists + SYSTEM_LEVEL_INSTALL_EXISTS, // Machine level install already exists INSTALL_FAILED, // Install/update failed OS_NOT_SUPPORTED, // Current OS not supported OS_ERROR, // OS API call failed |