Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/installer/setup/setup_main.cc

Issue 10446111: Abstract suffixing logic away from GetApplicationName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2012 Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 10 #include <string>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 for (size_t i = 0; i < BrowserDistribution::kNumProductTypes; ++i) { 152 for (size_t i = 0; i < BrowserDistribution::kNumProductTypes; ++i) {
153 BrowserDistribution::Type type = BrowserDistribution::kProductTypes[i]; 153 BrowserDistribution::Type type = BrowserDistribution::kProductTypes[i];
154 if (!installer_state->FindProduct(type)) { 154 if (!installer_state->FindProduct(type)) {
155 const ProductState* state = 155 const ProductState* state =
156 original_state.GetProductState(installer_state->system_install(), 156 original_state.GetProductState(installer_state->system_install(),
157 type); 157 type);
158 if ((state != NULL) && state->is_multi_install()) { 158 if ((state != NULL) && state->is_multi_install()) {
159 installer_state->AddProductFromState(type, *state); 159 installer_state->AddProductFromState(type, *state);
160 VLOG(1) << "Product already installed and must be included: " 160 VLOG(1) << "Product already installed and must be included: "
161 << BrowserDistribution::GetSpecificDistribution( 161 << BrowserDistribution::GetSpecificDistribution(
162 type)->GetApplicationName(); 162 type)->GetBaseAppName();
grt (UTC plus 2) 2012/06/08 19:54:21 At some point I had started using the shortcut nam
gab 2012/06/11 16:04:40 Done.
163 } 163 }
164 } 164 }
165 } 165 }
166 } 166 }
167 } 167 }
168 168
169 // This function is called when --rename-chrome-exe option is specified on 169 // This function is called when --rename-chrome-exe option is specified on
170 // setup.exe command line. This function assumes an in-use update has happened 170 // setup.exe command line. This function assumes an in-use update has happened
171 // for Chrome so there should be a file called new_chrome.exe on the file 171 // for Chrome so there should be a file called new_chrome.exe on the file
172 // system and a key called 'opv' in the registry. This function will move 172 // 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
392 BrowserDistribution::CHROME_BROWSER); 392 BrowserDistribution::CHROME_BROWSER);
393 if (chrome_state != NULL) { 393 if (chrome_state != NULL) {
394 // Add Chrome to the set of products (making it multi-install in the 394 // Add Chrome to the set of products (making it multi-install in the
395 // process) so that it is updated, too. 395 // process) so that it is updated, too.
396 scoped_ptr<Product> multi_chrome(new Product( 396 scoped_ptr<Product> multi_chrome(new Product(
397 BrowserDistribution::GetSpecificDistribution( 397 BrowserDistribution::GetSpecificDistribution(
398 BrowserDistribution::CHROME_BROWSER))); 398 BrowserDistribution::CHROME_BROWSER)));
399 multi_chrome->SetOption(installer::kOptionMultiInstall, true); 399 multi_chrome->SetOption(installer::kOptionMultiInstall, true);
400 chrome = installer_state->AddProduct(&multi_chrome); 400 chrome = installer_state->AddProduct(&multi_chrome);
401 VLOG(1) << "Upgrading existing multi-install Chrome browser along with " 401 VLOG(1) << "Upgrading existing multi-install Chrome browser along with "
402 << chrome_frame->distribution()->GetApplicationName(); 402 << chrome_frame->distribution()->GetBaseAppName();
403 } else if (chrome_frame->HasOption(installer::kOptionReadyMode)) { 403 } else if (chrome_frame->HasOption(installer::kOptionReadyMode)) {
404 // Chrome Frame with ready-mode is to be installed, yet Chrome is 404 // Chrome Frame with ready-mode is to be installed, yet Chrome is
405 // neither installed nor being installed. Fail. 405 // neither installed nor being installed. Fail.
406 LOG(ERROR) << "Cannot install Chrome Frame in ready mode without " 406 LOG(ERROR) << "Cannot install Chrome Frame in ready mode without "
407 "Chrome."; 407 "Chrome.";
408 *status = installer::READY_MODE_REQUIRES_CHROME; 408 *status = installer::READY_MODE_REQUIRES_CHROME;
409 installer_state->WriteInstallerResult(*status, 409 installer_state->WriteInstallerResult(*status,
410 IDS_INSTALL_READY_MODE_REQUIRES_CHROME_BASE, NULL); 410 IDS_INSTALL_READY_MODE_REQUIRES_CHROME_BASE, NULL);
411 return false; 411 return false;
412 } 412 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 BrowserDistribution* browser_dist = product->distribution(); 473 BrowserDistribution* browser_dist = product->distribution();
474 474
475 // Check for an existing installation of the product. 475 // Check for an existing installation of the product.
476 const ProductState* product_state = 476 const ProductState* product_state =
477 original_state.GetProductState(system_level, browser_dist->GetType()); 477 original_state.GetProductState(system_level, browser_dist->GetType());
478 if (product_state != NULL) { 478 if (product_state != NULL) {
479 is_first_install = false; 479 is_first_install = false;
480 // Block downgrades from multi-install to single-install. 480 // Block downgrades from multi-install to single-install.
481 if (!installer_state->is_multi_install() && 481 if (!installer_state->is_multi_install() &&
482 product_state->is_multi_install()) { 482 product_state->is_multi_install()) {
483 LOG(ERROR) << "Multi-install " << browser_dist->GetApplicationName() 483 LOG(ERROR) << "Multi-install " << browser_dist->GetBaseAppName()
484 << " exists; aborting single install."; 484 << " exists; aborting single install.";
485 *status = installer::MULTI_INSTALLATION_EXISTS; 485 *status = installer::MULTI_INSTALLATION_EXISTS;
486 installer_state->WriteInstallerResult(*status, 486 installer_state->WriteInstallerResult(*status,
487 IDS_INSTALL_MULTI_INSTALLATION_EXISTS_BASE, NULL); 487 IDS_INSTALL_MULTI_INSTALLATION_EXISTS_BASE, NULL);
488 return false; 488 return false;
489 } 489 }
490 } 490 }
491 491
492 // Check to avoid attempting to lay down a user-level installation on top 492 // Check to avoid attempting to lay down a user-level installation on top
493 // of a system-level one. 493 // of a system-level one.
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 if (!(installer_state.is_msi() && is_uninstall)) 1386 if (!(installer_state.is_msi() && is_uninstall))
1387 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1387 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1388 // to pass through, since this is only returned on uninstall which is 1388 // to pass through, since this is only returned on uninstall which is
1389 // never invoked directly by Google Update. 1389 // never invoked directly by Google Update.
1390 return_code = InstallUtil::GetInstallReturnCode(install_status); 1390 return_code = InstallUtil::GetInstallReturnCode(install_status);
1391 1391
1392 VLOG(1) << "Installation complete, returning: " << return_code; 1392 VLOG(1) << "Installation complete, returning: " << return_code;
1393 1393
1394 return return_code; 1394 return return_code;
1395 } 1395 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698