Index: chrome/installer/setup/setup_main.cc |
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc |
index 4c17a1cb95eb4ab9c91abf86b215af3c6603e476..27791790ba91abfe5436bc9c7b6cc792bf85e65a 100644 |
--- a/chrome/installer/setup/setup_main.cc |
+++ b/chrome/installer/setup/setup_main.cc |
@@ -361,6 +361,9 @@ bool CheckMultiInstallConditions(const InstallationState& original_state, |
const ProductState* chrome_state = |
original_state.GetProductState(system_level, |
BrowserDistribution::CHROME_BROWSER); |
+ const ProductState* app_host_state = |
+ original_state.GetProductState(system_level, |
+ BrowserDistribution::CHROME_APP_HOST); |
if (!binaries) { |
// This will only be hit if --multi-install is given with no products, or |
@@ -452,6 +455,20 @@ bool CheckMultiInstallConditions(const InstallationState& original_state, |
IDS_INSTALL_NON_MULTI_INSTALLATION_EXISTS_BASE, NULL); |
return false; |
} |
+ |
+ if (app_host) { |
+ // TODO(huangs): Revisit all these once App Launcher is default. |
+ if (app_host_state) { |
+ const installer::ChannelInfo& channel_info(app_host_state->channel()); |
grt (UTC plus 2)
2012/10/25 14:46:53
same here: don't use the channel info for this. c
huangs
2012/10/29 21:15:16
Done.
|
+ if (channel_info.IsAppLauncher() && |
+ !app_host->HasOption(installer::kOptionAppLauncher)) { |
+ LOG(ERROR) << "Cannot downgrade from App Launcher to App Host"; |
+ *status = installer::HIGHER_VERSION_EXISTS; |
grt (UTC plus 2)
2012/10/25 14:46:53
please introduce a new code rather than overloadin
huangs
2012/10/29 21:15:16
Not doing this anymore, so moot.
|
+ return false; |
+ } |
+ } |
+ } |
+ |
} else { |
// This is a non-multi installation. |
@@ -1431,7 +1448,11 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, |
original_state.Initialize(); |
InstallerState installer_state; |
- installer_state.Initialize(cmd_line, prefs, original_state); |
+ if (!installer_state.Initialize(cmd_line, prefs, original_state)) { |
+ LOG(ERROR) << "Conflicting options are found."; |
+ // TODO(huangs): Find better error code! |
+ return installer::INSTALL_FAILED; |
+ } |
const bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall); |
// Check to make sure current system is WinXP or later. If not, log |