OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <windows.h> | 5 #include <windows.h> |
6 #include <msi.h> | 6 #include <msi.h> |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 for (size_t i = 0; i < BrowserDistribution::kNumProductTypes; ++i) { | 151 for (size_t i = 0; i < BrowserDistribution::kNumProductTypes; ++i) { |
152 BrowserDistribution::Type type = BrowserDistribution::kProductTypes[i]; | 152 BrowserDistribution::Type type = BrowserDistribution::kProductTypes[i]; |
153 if (!installer_state->FindProduct(type)) { | 153 if (!installer_state->FindProduct(type)) { |
154 const ProductState* state = | 154 const ProductState* state = |
155 original_state.GetProductState(installer_state->system_install(), | 155 original_state.GetProductState(installer_state->system_install(), |
156 type); | 156 type); |
157 if ((state != NULL) && state->is_multi_install()) { | 157 if ((state != NULL) && state->is_multi_install()) { |
158 installer_state->AddProductFromState(type, *state); | 158 installer_state->AddProductFromState(type, *state); |
159 VLOG(1) << "Product already installed and must be included: " | 159 VLOG(1) << "Product already installed and must be included: " |
160 << BrowserDistribution::GetSpecificDistribution( | 160 << BrowserDistribution::GetSpecificDistribution( |
161 type)->GetApplicationName(); | 161 type)->GetAppShortCutName(); |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 // This function is called when --rename-chrome-exe option is specified on | 168 // This function is called when --rename-chrome-exe option is specified on |
169 // setup.exe command line. This function assumes an in-use update has happened | 169 // setup.exe command line. This function assumes an in-use update has happened |
170 // for Chrome so there should be a file called new_chrome.exe on the file | 170 // for Chrome so there should be a file called new_chrome.exe on the file |
171 // system and a key called 'opv' in the registry. This function will move | 171 // system and a key called 'opv' in the registry. This function will move |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 BrowserDistribution::CHROME_BROWSER); | 391 BrowserDistribution::CHROME_BROWSER); |
392 if (chrome_state != NULL) { | 392 if (chrome_state != NULL) { |
393 // Add Chrome to the set of products (making it multi-install in the | 393 // Add Chrome to the set of products (making it multi-install in the |
394 // process) so that it is updated, too. | 394 // process) so that it is updated, too. |
395 scoped_ptr<Product> multi_chrome(new Product( | 395 scoped_ptr<Product> multi_chrome(new Product( |
396 BrowserDistribution::GetSpecificDistribution( | 396 BrowserDistribution::GetSpecificDistribution( |
397 BrowserDistribution::CHROME_BROWSER))); | 397 BrowserDistribution::CHROME_BROWSER))); |
398 multi_chrome->SetOption(installer::kOptionMultiInstall, true); | 398 multi_chrome->SetOption(installer::kOptionMultiInstall, true); |
399 chrome = installer_state->AddProduct(&multi_chrome); | 399 chrome = installer_state->AddProduct(&multi_chrome); |
400 VLOG(1) << "Upgrading existing multi-install Chrome browser along with " | 400 VLOG(1) << "Upgrading existing multi-install Chrome browser along with " |
401 << chrome_frame->distribution()->GetApplicationName(); | 401 << chrome_frame->distribution()->GetAppShortCutName(); |
402 } else if (chrome_frame->HasOption(installer::kOptionReadyMode)) { | 402 } else if (chrome_frame->HasOption(installer::kOptionReadyMode)) { |
403 // Chrome Frame with ready-mode is to be installed, yet Chrome is | 403 // Chrome Frame with ready-mode is to be installed, yet Chrome is |
404 // neither installed nor being installed. Fail. | 404 // neither installed nor being installed. Fail. |
405 LOG(ERROR) << "Cannot install Chrome Frame in ready mode without " | 405 LOG(ERROR) << "Cannot install Chrome Frame in ready mode without " |
406 "Chrome."; | 406 "Chrome."; |
407 *status = installer::READY_MODE_REQUIRES_CHROME; | 407 *status = installer::READY_MODE_REQUIRES_CHROME; |
408 installer_state->WriteInstallerResult(*status, | 408 installer_state->WriteInstallerResult(*status, |
409 IDS_INSTALL_READY_MODE_REQUIRES_CHROME_BASE, NULL); | 409 IDS_INSTALL_READY_MODE_REQUIRES_CHROME_BASE, NULL); |
410 return false; | 410 return false; |
411 } | 411 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 BrowserDistribution* browser_dist = product->distribution(); | 472 BrowserDistribution* browser_dist = product->distribution(); |
473 | 473 |
474 // Check for an existing installation of the product. | 474 // Check for an existing installation of the product. |
475 const ProductState* product_state = | 475 const ProductState* product_state = |
476 original_state.GetProductState(system_level, browser_dist->GetType()); | 476 original_state.GetProductState(system_level, browser_dist->GetType()); |
477 if (product_state != NULL) { | 477 if (product_state != NULL) { |
478 is_first_install = false; | 478 is_first_install = false; |
479 // Block downgrades from multi-install to single-install. | 479 // Block downgrades from multi-install to single-install. |
480 if (!installer_state->is_multi_install() && | 480 if (!installer_state->is_multi_install() && |
481 product_state->is_multi_install()) { | 481 product_state->is_multi_install()) { |
482 LOG(ERROR) << "Multi-install " << browser_dist->GetApplicationName() | 482 LOG(ERROR) << "Multi-install " << browser_dist->GetAppShortCutName() |
483 << " exists; aborting single install."; | 483 << " exists; aborting single install."; |
484 *status = installer::MULTI_INSTALLATION_EXISTS; | 484 *status = installer::MULTI_INSTALLATION_EXISTS; |
485 installer_state->WriteInstallerResult(*status, | 485 installer_state->WriteInstallerResult(*status, |
486 IDS_INSTALL_MULTI_INSTALLATION_EXISTS_BASE, NULL); | 486 IDS_INSTALL_MULTI_INSTALLATION_EXISTS_BASE, NULL); |
487 return false; | 487 return false; |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 // Check to avoid attempting to lay down a user-level installation on top | 491 // Check to avoid attempting to lay down a user-level installation on top |
492 // of a system-level one. | 492 // of a system-level one. |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 if (!(installer_state.is_msi() && is_uninstall)) | 1387 if (!(installer_state.is_msi() && is_uninstall)) |
1388 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1388 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1389 // to pass through, since this is only returned on uninstall which is | 1389 // to pass through, since this is only returned on uninstall which is |
1390 // never invoked directly by Google Update. | 1390 // never invoked directly by Google Update. |
1391 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1391 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1392 | 1392 |
1393 VLOG(1) << "Installation complete, returning: " << return_code; | 1393 VLOG(1) << "Installation complete, returning: " << return_code; |
1394 | 1394 |
1395 return return_code; | 1395 return return_code; |
1396 } | 1396 } |
OLD | NEW |