summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/install_util.cc
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 19:20:44 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 19:20:44 +0000
commitf3f9106c281f61e7ce7e343e7cea47ae112dff8e (patch)
tree04745113a78018eba5a6d096f8d476c91b82a16a /chrome/installer/util/install_util.cc
parentff3b21b38056a0697f4a6b1dbb33efb3721f9cd0 (diff)
downloadchromium_src-f3f9106c281f61e7ce7e343e7cea47ae112dff8e.zip
chromium_src-f3f9106c281f61e7ce7e343e7cea47ae112dff8e.tar.gz
chromium_src-f3f9106c281f61e7ce7e343e7cea47ae112dff8e.tar.bz2
Add command line option to suppress Chrome launch after successful install
BUG=1443250 Review URL: http://codereview.chromium.org/8644 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/install_util.cc')
-rw-r--r--chrome/installer/util/install_util.cc29
1 files changed, 19 insertions, 10 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index 0374236..a372070 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -83,20 +83,29 @@ bool InstallUtil::IsOSSupported() {
return false;
}
-void InstallUtil::SetInstallerError(bool system_install,
- installer_util::InstallStatus status,
- int string_resource_id) {
+void InstallUtil::WriteInstallerResult(bool system_install,
+ installer_util::InstallStatus status,
+ int string_resource_id,
+ const std::wstring* const launch_cmd) {
HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
- std::wstring key(google_update::kRegPathClients);
- key.append(L"\\");
- key.append(google_update::kChromeGuid);
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ std::wstring key = dist->GetVersionKey();
+ int installer_result = (dist->GetInstallReturnCode(status) == 0) ? 0 : 1;
scoped_ptr<WorkItemList> install_list(WorkItem::CreateWorkItemList());
- install_list->AddSetRegValueWorkItem(root, key, L"InstallerResult", 1, true);
+ install_list->AddSetRegValueWorkItem(root, key, L"InstallerResult",
+ installer_result, 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 (string_resource_id != 0) {
+ std::wstring msg = installer_util::GetLocalizedString(string_resource_id);
+ install_list->AddSetRegValueWorkItem(root, key, L"InstallerResultUIString",
+ msg, true);
+ }
+ if (launch_cmd != NULL) {
+ install_list->AddSetRegValueWorkItem(root, key,
+ L"InstallerSuccessLaunchCmdLine",
+ *launch_cmd, true);
+ }
if (!install_list->Do())
LOG(ERROR) << "Failed to record installer error information in registry.";
}