From 8bcdcbe8e59f804e03f75e86744211210c64484a Mon Sep 17 00:00:00 2001 From: "rahulk@google.com" Date: Mon, 18 Aug 2008 21:39:43 +0000 Subject: First set of changes to start separating Google specific branding from Chromium. This change mostly tries to modify installer to install Chromium or Google Chrome depending on a compile flag. The goal is to try to isolate all the differences in a single class that can be overridden for customization. There is also a lot of refactoring to make this happen. Some changes are yet to be done but I didn't want to make this change even bigger than it already is. With all these changes the default build should still work as it is (Google Chrome should get installed/uninstalled). The changes yet to be done: - Separating string resources (this is marked by TODO in one of the files) - Generate different chrome.7z (Chromium will not include rlz.dll) for mini_installer BUG=1296800 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@999 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/mini_installer_test/chrome_mini_installer.cc | 15 ++++++++++----- .../test/mini_installer_test/mini_installer_test.vcproj | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'chrome/test') diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index c8d67c3..2376271 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -34,6 +34,7 @@ #include "base/registry.h" #include "base/string_util.h" #include "chrome/installer/setup/setup_constants.h" +#include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/util_constants.h" @@ -48,7 +49,8 @@ void ChromeMiniInstaller::InstallMiniInstaller(bool over_install) { } LaunchExe(mini_installer_constants::kChromeMiniInstallerExecutable, mini_installer_constants::kChromeMiniInstallerExecutable); - ASSERT_TRUE(CheckRegistryKey(InstallUtil::GetChromeGoogleUpdateKey())); + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + ASSERT_TRUE(CheckRegistryKey(dist->GetVersionKey())); FindChromeShortcut(); WaitUntilProcessStartsRunning(installer_util::kChromeExe); if (!over_install) { @@ -77,7 +79,8 @@ void ChromeMiniInstaller::InstallChromeSetupDev() { chrome_google_update_state_key.append(L"\\"); chrome_google_update_state_key.append(google_update::kChromeGuid); ASSERT_TRUE(CheckRegistryKey(chrome_google_update_state_key)); - ASSERT_TRUE(CheckRegistryKey(InstallUtil::GetChromeGoogleUpdateKey())); + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + ASSERT_TRUE(CheckRegistryKey(dist->GetVersionKey())); FindChromeShortcut(); WaitUntilProcessStartsRunning(installer_util::kChromeExe); ASSERT_TRUE(CloseWindow(mini_installer_constants::kFirstChromeUI, WM_CLOSE)); @@ -110,7 +113,8 @@ void ChromeMiniInstaller::OverInstall() { // Deletes App dir. void ChromeMiniInstaller::UnInstall() { printf("Verifying if Chrome is installed...\n"); - if (!CheckRegistryKey(InstallUtil::GetChromeGoogleUpdateKey())) { + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + if (!CheckRegistryKey(dist->GetVersionKey())) { printf("Chrome is not installed.\n"); return; } @@ -129,7 +133,7 @@ void ChromeMiniInstaller::UnInstall() { mini_installer_constants::kConfirmDialog, WM_COMMAND)); WaitUntilProcessStopsRunning( mini_installer_constants::kChromeSetupExecutable); - ASSERT_FALSE(CheckRegistryKey(InstallUtil::GetChromeGoogleUpdateKey())); + ASSERT_FALSE(CheckRegistryKey(dist->GetVersionKey())); DeleteAppFolder(); FindChromeShortcut(); if (false == CloseWindow(mini_installer_constants::kChromeUninstallIETitle, @@ -235,7 +239,8 @@ std::wstring ChromeMiniInstaller::GetUninstallPath() { // Reads Chrome registry key. std::wstring ChromeMiniInstaller::GetRegistryKey() { std::wstring build_key_value; - RegKey key(HKEY_CURRENT_USER, InstallUtil::GetChromeGoogleUpdateKey().c_str()); + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + RegKey key(HKEY_CURRENT_USER, dist->GetVersionKey().c_str()); if (!key.ReadValue(L"pv", &build_key_value)) return false; return build_key_value; diff --git a/chrome/test/mini_installer_test/mini_installer_test.vcproj b/chrome/test/mini_installer_test/mini_installer_test.vcproj index 2a20087..e993140 100644 --- a/chrome/test/mini_installer_test/mini_installer_test.vcproj +++ b/chrome/test/mini_installer_test/mini_installer_test.vcproj @@ -18,7 +18,7 @@