diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 21:08:42 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 21:08:42 +0000 |
commit | 856a8eedd555499c602eaf58b43d986a56f46512 (patch) | |
tree | 53d54ce951a0b0bc7056cafa6d2a5ad16e814326 /chrome | |
parent | 196b3a8fc8ad11e5bd645efcf3e3356573e7a2c7 (diff) | |
download | chromium_src-856a8eedd555499c602eaf58b43d986a56f46512.zip chromium_src-856a8eedd555499c602eaf58b43d986a56f46512.tar.gz chromium_src-856a8eedd555499c602eaf58b43d986a56f46512.tar.bz2 |
Make user level installs and machine level installs mutually exclusive.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/installer/setup/main.cc | 10 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc index f9bf767..d9b4bc6 100644 --- a/chrome/installer/setup/main.cc +++ b/chrome/installer/setup/main.cc @@ -293,6 +293,16 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, parsed_command_line.HasSwitch(installer_util::switches::kSystemInstall); LOG(INFO) << "system install is " << system_install; + // Check to avoid simultaneous per-user and per-machine installs. + scoped_ptr<installer::Version> + chrome_version(InstallUtil::GetChromeVersion(!system_install)); + if (chrome_version.get()) { + LOG(ERROR) << "Already installed version " << chrome_version->GetString() + << " conflicts with the current install mode."; + return system_install ? installer_util::USER_LEVEL_INSTALL_EXISTS : + installer_util::MACHINE_LEVEL_INSTALL_EXISTS; + } + // Check the existing version installed. scoped_ptr<installer::Version> installed_version(InstallUtil::GetChromeVersion(system_install)); diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index 9969fe2..e115787 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -16,6 +16,8 @@ enum InstallStatus { INSTALL_REPAIRED, // Same version reinstalled for repair NEW_VERSION_UPDATED, // Chrome successfully updated to new version HIGHER_VERSION_EXISTS, // Higher version of Chrome already exists + USER_LEVEL_INSTALL_EXISTS, // User level install already exists + MACHINE_LEVEL_INSTALL_EXISTS, // Machine level install already exists INSTALL_FAILED, // Install/update failed OS_NOT_SUPPORTED, // Current OS not supported OS_ERROR, // OS API call failed |