diff options
author | huangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-01 03:18:35 +0000 |
---|---|---|
committer | huangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-01 03:18:35 +0000 |
commit | 60c8c0bbbdb7b9a9a222c3a2532e4a5f8c511bb9 (patch) | |
tree | 83a643ba8debfaa66c881285c5ffa05a60df4419 /chrome/installer/setup/install_worker.cc | |
parent | f5864911d8c71c4bd6585e6c6a42858a9c2155d0 (diff) | |
download | chromium_src-60c8c0bbbdb7b9a9a222c3a2532e4a5f8c511bb9.zip chromium_src-60c8c0bbbdb7b9a9a222c3a2532e4a5f8c511bb9.tar.gz chromium_src-60c8c0bbbdb7b9a9a222c3a2532e4a5f8c511bb9.tar.bz2 |
Implementing app command to query EULA acceptance state for Chrome.
There are 2 parts to this change:
1. Implement setup.exe switch --query-eula-acceptance, and return the result via exit code.
- Main use case is system-level, which requires the "--system-level" switch.
- Return code: 0 if "not accepted", 1 if "accepted", and -1 if failed.
2. Add the app command query-eula-acceptance to Chrome binary during installation to execute:
setup.exe --query-eula-acceptance [--system-level]
BUG=151303
TBR=ben
Review URL: https://chromiumcodereview.appspot.com/12035043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup/install_worker.cc')
-rw-r--r-- | chrome/installer/setup/install_worker.cc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index 81173a0..ef4fa36 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -211,7 +211,6 @@ void AddInstallerCopyTasks(const InstallerState& installer_state, void AddInstallAppCommandWorkItems(const InstallerState& installer_state, const InstallationState& machine_state, - const FilePath& setup_path, const Version& new_version, const Product& product, WorkItemList* work_item_list) { @@ -252,12 +251,16 @@ void AddProductSpecificWorkItems(const InstallationState& original_state, } if (p.is_chrome_app_host()) { AddInstallAppCommandWorkItems(installer_state, original_state, - setup_path, new_version, p, list); + new_version, p, list); } if (p.is_chrome()) { AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, list); } + if (p.is_chrome_binaries()) { + AddQueryEULAAcceptanceWorkItems(installer_state, setup_path, new_version, + p, list); + } } } @@ -1636,4 +1639,33 @@ void AddOsUpgradeWorkItems(const InstallerState& installer_state, } } +void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, + const FilePath& setup_path, + const Version& new_version, + const Product& product, + WorkItemList* work_item_list) { + const HKEY root_key = installer_state.root_key(); + string16 cmd_key(product.distribution()->GetVersionKey()); + cmd_key.append(1, FilePath::kSeparators[0]) + .append(google_update::kRegCommandsKey) + .append(1, FilePath::kSeparators[0]) + .append(kCmdQueryEULAAcceptance); + if (installer_state.operation() == InstallerState::UNINSTALL) { + work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> + set_log_message("Removing query EULA acceptance command"); + } else { + CommandLine cmd_line(installer_state + .GetInstallerDirectory(new_version) + .Append(setup_path.BaseName())); + cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); + if (installer_state.system_install()) + cmd_line.AppendSwitch(installer::switches::kSystemLevel); + if (installer_state.verbose_logging()) + cmd_line.AppendSwitch(installer::switches::kVerboseLogging); + AppCommand cmd(cmd_line.GetCommandLineString()); + cmd.set_is_web_accessible(true); + cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); + } +} + } // namespace installer |