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..fde855c8efd131810480552097136b3ee6376a18 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( |
| + 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,10 +165,8 @@ 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(); |
| } |
| @@ -188,7 +184,23 @@ void InstallerState::Initialize(const CommandLine& command_line, |
| // Chrome Frame is installed in Ready Mode. Remove it along with Chrome. |
| Product* p = AddProductFromPreferences( |
| BrowserDistribution::CHROME_FRAME, prefs, machine_state); |
| + VLOG(1) << "Uninstall distribution: " |
| + << p->distribution()->GetAppShortCutName(); |
| + } |
| + const ProductState* app_host_state = machine_state.GetProductState( |
|
gab
2012/11/16 22:20:26
Rename variable to make it explicit this is system
huangs
2012/11/17 00:15:41
Disregarding, per F2F.
|
| + system_install(), BrowserDistribution::CHROME_APP_HOST); |
| + |
| + if (app_host_state != NULL && |
| + !app_host_state->uninstall_command().HasSwitch( |
| + switches::kChromeAppLauncher) && |
| + !FindProduct(BrowserDistribution::CHROME_APP_HOST)) { |
| + // App Host (non-App Launcher) is installed. Remove it along with |
| + // Chrome. If we uninstall system-level Chrome, but user-level |
| + // (non-App Launcher) App Host exists, then app_host.exe remains. |
| + // When executed, orphaned app_host.exe prompts user for further action. |
|
gab
2012/11/16 22:20:26
What about when uninstalling user-level Chrome wit
huangs
2012/11/17 00:15:41
In this case, app_host_state will be NULL, and the
|
| + Product* p = AddProductFromPreferences( |
| + BrowserDistribution::CHROME_APP_HOST, prefs, machine_state); |
| VLOG(1) << "Uninstall distribution: " |
| << p->distribution()->GetAppShortCutName(); |
| } |
| @@ -236,9 +248,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(); |
| } |