diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 19:54:02 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 19:54:02 +0000 |
commit | 36b6f4f462adc4ff57d65acef4c60939c2dfd8fe (patch) | |
tree | 38f40e2fa1773ff67ccb6b2283bf722fa54c9ab5 /chrome/installer/util/product.cc | |
parent | 15e7eba9c74140f4e976c0d152ba738c36f14bb5 (diff) | |
download | chromium_src-36b6f4f462adc4ff57d65acef4c60939c2dfd8fe.zip chromium_src-36b6f4f462adc4ff57d65acef4c60939c2dfd8fe.tar.gz chromium_src-36b6f4f462adc4ff57d65acef4c60939c2dfd8fe.tar.bz2 |
Support for GCF ready-mode.
The installer can now be run in a way that installs both Chrome and Chrome Frame
at the same time, into a shared directory. The command line to do this is:
mini_installer.exe --multi-install --chrome --chrome-frame --ready-mode
--system-level --verbose-logging
This installs both products although only Chrome will have an entry in the
add/remove programs dialog that serves as an uninstallation command for both
products. Chrome Frame will be installed in ready-mode, which means that the
user will have to opt-in or opt-out of using it. The installer will create a
REG_DWORD value to indicate this mode, here:
HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\ClientState\{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}
Value name: ChromeFrameReadyMode
Value: 1
If the user opts-in to use GCF, setup will be run again to remove this value,
update Chrome's uninstallation commands to only uninstall Chrome, and add an
entry to the Add/Remove Programs dialog for GCF. To do this, the installer
needs to be run with this switch:
--multi-install --chrome-frame --system-level --ready-mode-opt-in --verbose-logging
If the user opts-out, Chrome Frame will be uninstalled by running the installer
with these arguments:
--uninstall --chrome-frame --ready-mode --system-level --multi-install --verbose-logging
In addition to uninstalling GCF, this updates Chrome's uninstallation commands
accordingly and sets the ChromeFrameReadyMode value to 0 to avoid enabling ready
mode again.
Requirements that must currently be met in order to install Chrome and Chrome
Frame into the same shared location:
- Chrome Frame must not already be installed
OR
- Chrome Frame must be already installed as multi, into the shared location
**** other changes ****
The installer does no use the ap value for detecting other multi-install
products anymore. Instead we inspect the uninstallation switches to see if
--multi-install is present. Updated unit tests accordingly.
When uninstalling Chrome Frame along with Chrome, the Chrome Frame
uninstallation prompt is not shown.
Added safeguards:
If we attempt to install Chrome Frame multi over a single, install aborts and returns an error.
If we attempt to install Chrome Frame single over a multi, install aborts and returns an error.
TEST=See description above.
BUG=61609
Review URL: http://codereview.chromium.org/5989007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70083 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/product.cc')
-rw-r--r-- | chrome/installer/util/product.cc | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/chrome/installer/util/product.cc b/chrome/installer/util/product.cc index 8d4617a..43f371a 100644 --- a/chrome/installer/util/product.cc +++ b/chrome/installer/util/product.cc @@ -117,8 +117,7 @@ bool Product::IsMsi() const { if ((cache_state_ & MSI_STATE) == 0) { msi_ = false; // Covers failure cases below. - const MasterPreferences& prefs = - installer::MasterPreferences::ForCurrentProcess(); + const MasterPreferences& prefs = MasterPreferences::ForCurrentProcess(); bool is_msi = false; prefs.GetBool(installer::master_preferences::kMsi, &is_msi); @@ -177,6 +176,15 @@ bool Product::IsInstalled() const { return GetInstalledVersion() != NULL; } +bool Product::ShouldCreateUninstallEntry() const { + if (IsMsi()) { + // MSI installations will manage their own uninstall shortcuts. + return false; + } + + return distribution_->ShouldCreateUninstallEntry(); +} + /////////////////////////////////////////////////////////////////////////////// ProductPackageMapping::ProductPackageMapping(bool multi_install, bool system_level) @@ -202,7 +210,22 @@ bool ProductPackageMapping::AddDistribution(BrowserDistribution* distribution) { // Each product type can be added exactly once. DCHECK(FindProduct(products_, distribution->GetType()) == NULL); - FilePath install_package(GetChromeInstallPath(system_level_, distribution)); + FilePath install_package; + if (distribution->GetType() == BrowserDistribution::CHROME_BROWSER) { + install_package = GetChromeInstallPath(system_level_, distribution); + } else { + DCHECK_EQ(BrowserDistribution::CHROME_FRAME, distribution->GetType()); + install_package = GetChromeFrameInstallPath(multi_install_, system_level_, + distribution); + } + + if (install_package.empty()) { + LOG(ERROR) << "Got an empty installation path for " + << distribution->GetApplicationName() + << ". It's likely that there's a conflicting " + "installation present"; + return false; + } scoped_refptr<Package> target_package; for (size_t i = 0; i < packages_.size(); ++i) { @@ -234,7 +257,7 @@ bool ProductPackageMapping::AddDistribution(BrowserDistribution* distribution) { bool ProductPackageMapping::AddDistribution( BrowserDistribution::Type type, - const installer::MasterPreferences& prefs) { + const MasterPreferences& prefs) { BrowserDistribution* distribution = BrowserDistribution::GetSpecificDistribution(type, prefs); if (!distribution) { |