Chromium Code Reviews| Index: chrome/installer/util/installer_state.cc |
| diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc |
| index b7ab42ba04e7635808035d563462fb39292e7a5c..6b1303d74c00f8c2c47de172496cbdb1d15b33ab 100644 |
| --- a/chrome/installer/util/installer_state.cc |
| +++ b/chrome/installer/util/installer_state.cc |
| @@ -119,23 +119,21 @@ void InstallerState::Initialize(const CommandLine& command_line, |
| const bool is_uninstall = command_line.HasSwitch(switches::kUninstall); |
| if (prefs.install_chrome()) { |
| - Product* p = |
| - AddProductFromPreferences(BrowserDistribution::CHROME_BROWSER, prefs, |
| - machine_state); |
| + Product* p = AddProductFromPreferences( |
|
grt (UTC plus 2)
2012/11/16 21:01:46
reformatting like this makes it more difficult to
huangs
2012/11/16 21:32:02
Okay, will avoid in future.
|
| + BrowserDistribution::CHROME_BROWSER, prefs, machine_state); |
| VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| << " distribution: " << p->distribution()->GetAppShortCutName(); |
| } |
| if (prefs.install_chrome_frame()) { |
| - Product* p = |
| - AddProductFromPreferences(BrowserDistribution::CHROME_FRAME, prefs, |
| - machine_state); |
| + Product* p = AddProductFromPreferences( |
| + BrowserDistribution::CHROME_FRAME, prefs, machine_state); |
| VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| << " distribution: " << p->distribution()->GetAppShortCutName(); |
| } |
| + |
| if (prefs.install_chrome_app_host()) { |
| - Product* p = |
| - AddProductFromPreferences(BrowserDistribution::CHROME_APP_HOST, prefs, |
| - machine_state); |
| + Product* p = AddProductFromPreferences( |
| + BrowserDistribution::CHROME_APP_HOST, prefs, machine_state); |
| VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| << " distribution: " << p->distribution()->GetAppShortCutName(); |
| } |
| @@ -167,16 +165,32 @@ void InstallerState::Initialize(const CommandLine& command_line, |
| if (need_binaries && !FindProduct(BrowserDistribution::CHROME_BINARIES)) { |
| // Force binaries to be installed/updated. |
| - Product* p = |
| - AddProductFromPreferences(BrowserDistribution::CHROME_BINARIES, |
| - prefs, |
| - machine_state); |
| + Product* p = AddProductFromPreferences( |
| + BrowserDistribution::CHROME_BINARIES, prefs, machine_state); |
| VLOG(1) << "Install distribution: " |
| << p->distribution()->GetAppShortCutName(); |
| } |
| } |
| if (is_uninstall && prefs.is_multi_install()) { |
| + // Uninstall App Host if Chrome is being uninstalled, and (non-App Launcher) |
| + // App Host exists. If we uninstall system-level Chrome, but we have |
| + // user-level (non-App Launcher) App Host, then app_host.exe remains. |
| + // On next execution, app_host.exe prompts user for further action. |
| + if (is_uninstall && prefs.install_chrome() |
|
grt (UTC plus 2)
2012/11/16 21:01:46
- is_uninstall is tested on line 175, so please re
huangs
2012/11/16 21:32:02
Done.
|
| + && !prefs.install_chrome_app_host()) { |
| + const ProductState* app_host_state = machine_state.GetProductState( |
| + system_install(), BrowserDistribution::CHROME_APP_HOST); |
| + // If App Host (non-App Launcher) is installed. |
| + if (app_host_state && !app_host_state->uninstall_command() |
| + .HasSwitch(switches::kChromeAppLauncher)) { |
| + Product* p = AddProductFromPreferences( |
| + BrowserDistribution::CHROME_APP_HOST, prefs, machine_state); |
| + VLOG(1) << "Also uninstall distribution: " |
| + << p->distribution()->GetAppShortCutName(); |
| + } |
| + } |
| + |
| if (FindProduct(BrowserDistribution::CHROME_BROWSER)) { |
| const ProductState* chrome_frame_state = machine_state.GetProductState( |
| system_install(), BrowserDistribution::CHROME_FRAME); |
| @@ -236,9 +250,8 @@ void InstallerState::Initialize(const CommandLine& command_line, |
| // The product is being uninstalled. |
| } |
| if (!keep_binaries) { |
| - Product* p = |
| - AddProductFromPreferences(BrowserDistribution::CHROME_BINARIES, prefs, |
| - machine_state); |
| + Product* p = AddProductFromPreferences( |
| + BrowserDistribution::CHROME_BINARIES, prefs, machine_state); |
| VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| << " distribution: " << p->distribution()->GetAppShortCutName(); |
| } |