diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-08-12 13:47:38 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-08-12 13:47:38 +0100 |
commit | 5f1c94371a64b3196d4be9466099bb892df9b88e (patch) | |
tree | 60a287ed27d1328d7806d12433d789b66ad91805 /chrome/installer | |
parent | 43165a58c6167882aabb62f470c4e4d21f807d79 (diff) | |
download | chromium_org-5f1c94371a64b3196d4be9466099bb892df9b88e.tar.gz |
Merge from Chromium at DEPS revision 288042
This commit was generated by merge_to_master.py.
Change-Id: I583602ff16d735199f1810565c9296e970ce2854
Diffstat (limited to 'chrome/installer')
29 files changed, 168 insertions, 429 deletions
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc index fdac65c658..9e9ba92604 100644 --- a/chrome/installer/launcher_support/chrome_launcher_support.cc +++ b/chrome/installer/launcher_support/chrome_launcher_support.cc @@ -5,20 +5,12 @@ #include "chrome/installer/launcher_support/chrome_launcher_support.h" #include <windows.h> -#include <tchar.h> -#include "base/command_line.h" #include "base/file_util.h" #include "base/files/file_path.h" -#include "base/logging.h" -#include "base/process/launch.h" #include "base/strings/string16.h" #include "base/win/registry.h" -#ifndef OFFICIAL_BUILD -#include "base/path_service.h" -#endif - namespace chrome_launcher_support { namespace { @@ -26,11 +18,6 @@ namespace { // TODO(huangs) Refactor the constants: http://crbug.com/148538 const wchar_t kGoogleRegClientStateKey[] = L"Software\\Google\\Update\\ClientState"; -const wchar_t kGoogleRegClientsKey[] = L"Software\\Google\\Update\\Clients"; -const wchar_t kRegVersionField[] = L"pv"; - -// Copied from binaries_installer_internal.cc -const wchar_t kAppHostAppId[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; // Copied from chrome_appid.cc. const wchar_t kBinariesAppGuid[] = L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}"; @@ -38,14 +25,8 @@ const wchar_t kBinariesAppGuid[] = L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}"; // Copied from google_chrome_distribution.cc. const wchar_t kBrowserAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; -// Copied frome google_chrome_sxs_distribution.cc. -const wchar_t kSxSBrowserAppGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; - // Copied from util_constants.cc. -const wchar_t kChromeAppHostExe[] = L"app_host.exe"; -const char kChromeAppLauncher[] = "app-launcher"; const wchar_t kChromeExe[] = L"chrome.exe"; -const wchar_t kUninstallArgumentsField[] = L"UninstallArguments"; const wchar_t kUninstallStringField[] = L"UninstallString"; // Reads a string value from the specified product's "ClientState" registry key. @@ -69,33 +50,6 @@ bool GetClientStateValue(InstallationLevel level, return false; } -// Determines whether the specified product has a key in "Clients". This -// indicates whether the product is installed at the given level. -bool IsProductInstalled(InstallationLevel level, const wchar_t* app_guid) { - HKEY root_key = (level == USER_LEVEL_INSTALLATION) ? - HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; - base::string16 subkey(kGoogleRegClientsKey); - subkey.append(1, L'\\').append(app_guid); - base::win::RegKey reg_key; - // Google Update always uses 32bit hive. - return reg_key.Open(root_key, subkey.c_str(), - KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS && - reg_key.HasValue(kRegVersionField); -} - -bool IsAppLauncherEnabledAtLevel(InstallationLevel level) { - base::string16 uninstall_arguments; - if (GetClientStateValue(level, - kAppHostAppId, - kUninstallArgumentsField, - &uninstall_arguments)) { - return CommandLine::FromString(L"dummy.exe " + uninstall_arguments) - .HasSwitch(kChromeAppLauncher) && - !GetAppHostPathForInstallationLevel(level).empty(); - } - return false; -} - // Reads the path to setup.exe from the value "UninstallString" within the // specified product's "ClientState" registry key. Returns an empty FilePath if // an error occurs or the product is not installed at the specified level. @@ -110,9 +64,22 @@ base::FilePath GetSetupExeFromRegistry(InstallationLevel level, return base::FilePath(); } -// Returns the path to an installed |exe_file| (e.g. chrome.exe, app_host.exe) -// at the specified level, given |setup_exe_path| from Omaha client state. -// Returns empty base::FilePath if none found, or if |setup_exe_path| is empty. +// Returns the path to an existing setup.exe at the specified level, if it can +// be found via Omaha client state. +base::FilePath GetSetupExeForInstallationLevel(InstallationLevel level) { + // Look in the registry for Chrome Binaries first. + base::FilePath setup_exe_path( + GetSetupExeFromRegistry(level, kBinariesAppGuid)); + // If the above fails, look in the registry for Chrome next. + if (setup_exe_path.empty()) + setup_exe_path = GetSetupExeFromRegistry(level, kBrowserAppGuid); + // If we fail again, then setup_exe_path would be empty. + return setup_exe_path; +} + +// Returns the path to an installed |exe_file| (e.g. chrome.exe) at the +// specified level, given |setup_exe_path| from Omaha client state. Returns +// empty base::FilePath if none found, or if |setup_exe_path| is empty. base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path, const wchar_t* exe_file) { if (!setup_exe_path.empty()) { @@ -134,50 +101,11 @@ base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path, } // namespace -void UninstallLegacyAppLauncher(InstallationLevel level) { - base::FilePath setup_exe(GetSetupExeFromRegistry(level, kAppHostAppId)); - if (setup_exe.empty()) - return; - base::string16 uninstall_arguments; - if (GetClientStateValue(level, - kAppHostAppId, - kUninstallArgumentsField, - &uninstall_arguments)) { - CommandLine uninstall_cmd = CommandLine::FromString( - L"\"" + setup_exe.value() + L"\" " + uninstall_arguments); - - VLOG(1) << "Uninstalling legacy app launcher with command line: " - << uninstall_cmd.GetCommandLineString(); - base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL); - } -} - -base::FilePath GetSetupExeForInstallationLevel(InstallationLevel level) { - // Look in the registry for Chrome Binaries first. - base::FilePath setup_exe_path( - GetSetupExeFromRegistry(level, kBinariesAppGuid)); - // If the above fails, look in the registry for Chrome next. - if (setup_exe_path.empty()) - setup_exe_path = GetSetupExeFromRegistry(level, kBrowserAppGuid); - // If we fail again, then setup_exe_path would be empty. - return setup_exe_path; -} - base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) { return FindExeRelativeToSetupExe( GetSetupExeForInstallationLevel(level), kChromeExe); } -base::FilePath GetAppHostPathForInstallationLevel(InstallationLevel level) { - return FindExeRelativeToSetupExe( - GetSetupExeFromRegistry(level, kAppHostAppId), kChromeAppHostExe); -} - -base::FilePath GetChromeSxSPathForInstallationLevel(InstallationLevel level) { - return FindExeRelativeToSetupExe( - GetSetupExeFromRegistry(level, kSxSBrowserAppGuid), kChromeExe); -} - base::FilePath GetAnyChromePath() { base::FilePath chrome_path; if (chrome_path.empty()) @@ -187,47 +115,4 @@ base::FilePath GetAnyChromePath() { return chrome_path; } -base::FilePath GetAnyAppHostPath() { - base::FilePath app_host_path; - if (app_host_path.empty()) { - app_host_path = GetAppHostPathForInstallationLevel( - SYSTEM_LEVEL_INSTALLATION); - } - if (app_host_path.empty()) - app_host_path = GetAppHostPathForInstallationLevel(USER_LEVEL_INSTALLATION); - return app_host_path; -} - -base::FilePath GetAnyChromeSxSPath() { - base::FilePath path = - GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION); - if (path.empty()) - path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION); - return path; -} - -bool IsAppHostPresent() { - base::FilePath app_host_exe = GetAnyAppHostPath(); - return !app_host_exe.empty(); -} - -InstallationState GetAppLauncherInstallationState() { - if (IsAppLauncherEnabledAtLevel(SYSTEM_LEVEL_INSTALLATION)) - return INSTALLED_AT_SYSTEM_LEVEL; - - if (IsAppLauncherEnabledAtLevel(USER_LEVEL_INSTALLATION)) - return INSTALLED_AT_USER_LEVEL; - - return NOT_INSTALLED; -} - -bool IsAppLauncherPresent() { - return GetAppLauncherInstallationState() != NOT_INSTALLED; -} - -bool IsChromeBrowserPresent() { - return IsProductInstalled(USER_LEVEL_INSTALLATION, kBrowserAppGuid) || - IsProductInstalled(SYSTEM_LEVEL_INSTALLATION, kBrowserAppGuid); -} - } // namespace chrome_launcher_support diff --git a/chrome/installer/launcher_support/chrome_launcher_support.h b/chrome/installer/launcher_support/chrome_launcher_support.h index 1a8847fa81..9cf14792b7 100644 --- a/chrome/installer/launcher_support/chrome_launcher_support.h +++ b/chrome/installer/launcher_support/chrome_launcher_support.h @@ -16,69 +16,18 @@ enum InstallationLevel { SYSTEM_LEVEL_INSTALLATION, }; -enum InstallationState { - NOT_INSTALLED, - INSTALLED_AT_USER_LEVEL, - INSTALLED_AT_SYSTEM_LEVEL, -}; - -// Returns the path to an existing setup.exe at the specified level, if it can -// be found via Omaha client state. -base::FilePath GetSetupExeForInstallationLevel(InstallationLevel level); - // Returns the path to an installed chrome.exe at the specified level, if it can // be found via Omaha client state. Prefers the installer from a multi-install, // but may also return that of a single-install of Chrome if no multi-install // exists. base::FilePath GetChromePathForInstallationLevel(InstallationLevel level); -// Returns the path to an installed app_host.exe at the specified level, if -// it can be found via Omaha client state. -base::FilePath GetAppHostPathForInstallationLevel(InstallationLevel level); - -// Returns the path to an installed SxS chrome.exe at the specified level, if -// it can be found via Omaha client state. -base::FilePath GetChromeSxSPathForInstallationLevel(InstallationLevel level); - // Returns the path to an installed chrome.exe, or an empty path. Prefers a // system-level installation to a user-level installation. Uses Omaha client // state to identify a Chrome installation location. // The file path returned (if any) is guaranteed to exist. base::FilePath GetAnyChromePath(); -// Returns the path to an installed app_host.exe, or an empty path. Prefers a -// system-level installation to a user-level installation. Uses Omaha client -// state to identify a App Host installation location. -// The file path returned (if any) is guaranteed to exist. -base::FilePath GetAnyAppHostPath(); - -// Returns the path to an installed SxS chrome.exe, or an empty path. Prefers a -// user-level installation to a system-level installation. Uses Omaha client -// state to identify a Chrome Canary installation location. -// The file path returned (if any) is guaranteed to exist. -base::FilePath GetAnyChromeSxSPath(); - -// Uninstalls the legacy app launcher by launching setup.exe with the uninstall -// arguments from the App Launcher ClientState registry key. The uninstall will -// run asynchronously. -void UninstallLegacyAppLauncher(InstallationLevel level); - -// Returns true if App Host is installed (system-level or user-level), -// or in the same directory as the current executable. -bool IsAppHostPresent(); - -// Returns the app launcher installation state. If the launcher is installed -// at both system level and user level, system level is returned. -InstallationState GetAppLauncherInstallationState(); - -// Returns true if App Launcher is installed (system-level or user-level). -bool IsAppLauncherPresent(); - -// Returns true if the Chrome browser is installed (system-level or user-level). -// If this is running in an official build, it will check if a non-canary build -// if installed. If it is not an official build, it will always return true. -bool IsChromeBrowserPresent(); - } // namespace chrome_launcher_support #endif // CHROME_INSTALLER_LAUNCHER_SUPPORT_CHROME_LAUNCHER_SUPPORT_H_ diff --git a/chrome/installer/linux/common/installer.include b/chrome/installer/linux/common/installer.include index a316906501..2f6b321c24 100644 --- a/chrome/installer/linux/common/installer.include +++ b/chrome/installer/linux/common/installer.include @@ -177,11 +177,6 @@ stage_install_common() { install -m 644 -s "${BUILDDIR}/lib/libpeerconnection.so" "${STAGEDIR}/${INSTALLDIR}/lib/" fi - # nacl pepper plugin - if [ -f "${BUILDDIR}/libppGoogleNaClPluginChrome.so" ]; then - install -m 644 -s "${BUILDDIR}/libppGoogleNaClPluginChrome.so" "${STAGEDIR}/${INSTALLDIR}/" - fi - # nacl_helper and nacl_helper_bootstrap # Don't use "-s" (strip) because this runs binutils "strip", which # mangles the special ELF program headers of nacl_helper_bootstrap. diff --git a/chrome/installer/linux/debian/build.sh b/chrome/installer/linux/debian/build.sh index 9f5c02ca3b..2bd4583705 100755 --- a/chrome/installer/linux/debian/build.sh +++ b/chrome/installer/linux/debian/build.sh @@ -216,9 +216,7 @@ fi # call cleanup() on exit trap cleanup 0 process_opts "$@" -if [ ! "$BUILDDIR" ]; then - BUILDDIR=$(readlink -f "${SCRIPTDIR}/../../../../../out/Release") -fi +BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} source ${BUILDDIR}/installer/common/installer.include diff --git a/chrome/installer/linux/rpm/build.sh b/chrome/installer/linux/rpm/build.sh index 6597b9961c..ff54b952cb 100755 --- a/chrome/installer/linux/rpm/build.sh +++ b/chrome/installer/linux/rpm/build.sh @@ -268,9 +268,7 @@ SPEC="${TMPFILEDIR}/chrome.spec" # call cleanup() on exit trap cleanup 0 process_opts "$@" -if [ ! "$BUILDDIR" ]; then - BUILDDIR=$(readlink -f "${SCRIPTDIR}/../../../../../out/Release") -fi +BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} source ${BUILDDIR}/installer/common/installer.include diff --git a/chrome/installer/linux/sysroot_scripts/packagelist.wheezy.arm b/chrome/installer/linux/sysroot_scripts/packagelist.wheezy.arm index 84bd91b841..c9c7b2fe96 100644 --- a/chrome/installer/linux/sysroot_scripts/packagelist.wheezy.arm +++ b/chrome/installer/linux/sysroot_scripts/packagelist.wheezy.arm @@ -8,15 +8,15 @@ main/c/cairo/libcairo2_1.12.2-3_armhf.deb main/c/cairo/libcairo2-dev_1.12.2-3_armhf.deb main/c/cairo/libcairo-gobject2_1.12.2-3_armhf.deb main/c/cairo/libcairo-script-interpreter2_1.12.2-3_armhf.deb -main/c/cups/libcups2_1.5.3-5+deb7u1_armhf.deb -main/c/cups/libcups2-dev_1.5.3-5+deb7u1_armhf.deb +main/c/cups/libcups2_1.5.3-5+deb7u2_armhf.deb +main/c/cups/libcups2-dev_1.5.3-5+deb7u2_armhf.deb main/d/dbus-glib/libdbus-glib-1-2_0.100.2-1_armhf.deb -main/d/dbus/libdbus-1-3_1.6.8-1+deb7u1_armhf.deb -main/d/dbus/libdbus-1-dev_1.6.8-1+deb7u1_armhf.deb +main/d/dbus/libdbus-1-3_1.6.8-1+deb7u3_armhf.deb +main/d/dbus/libdbus-1-dev_1.6.8-1+deb7u3_armhf.deb main/e/e2fsprogs/comerr-dev_2.1-1.42.5-1.1_armhf.deb main/e/e2fsprogs/libcomerr2_1.42.5-1.1_armhf.deb -main/e/eglibc/libc6_2.13-38+deb7u1_armhf.deb -main/e/eglibc/libc6-dev_2.13-38+deb7u1_armhf.deb +main/e/eglibc/libc6_2.13-38+deb7u2_armhf.deb +main/e/eglibc/libc6-dev_2.13-38+deb7u2_armhf.deb main/e/elfutils/libelf1_0.152-1+wheezy1_armhf.deb main/e/elfutils/libelf-dev_0.152-1+wheezy1_armhf.deb main/e/expat/libexpat1_2.1.0-1+deb7u1_armhf.deb @@ -37,10 +37,10 @@ main/g/gdk-pixbuf/libgdk-pixbuf2.0-0_2.26.1-1_armhf.deb main/g/gdk-pixbuf/libgdk-pixbuf2.0-dev_2.26.1-1_armhf.deb main/g/glib2.0/libglib2.0-0_2.33.12+really2.32.4-5_armhf.deb main/g/glib2.0/libglib2.0-dev_2.33.12+really2.32.4-5_armhf.deb -main/g/gnutls26/libgnutls26_2.12.20-8+deb7u1_armhf.deb -main/g/gnutls26/libgnutls-dev_2.12.20-8+deb7u1_armhf.deb -main/g/gnutls26/libgnutls-openssl27_2.12.20-8+deb7u1_armhf.deb -main/g/gnutls26/libgnutlsxx27_2.12.20-8+deb7u1_armhf.deb +main/g/gnutls26/libgnutls26_2.12.20-8+deb7u2_armhf.deb +main/g/gnutls26/libgnutls-dev_2.12.20-8+deb7u2_armhf.deb +main/g/gnutls26/libgnutls-openssl27_2.12.20-8+deb7u2_armhf.deb +main/g/gnutls26/libgnutlsxx27_2.12.20-8+deb7u2_armhf.deb main/g/gtk+2.0/libgtk2.0-0_2.24.10-2_armhf.deb main/g/gtk+2.0/libgtk2.0-dev_2.24.10-2_armhf.deb main/k/keyutils/libkeyutils1_1.5.5-3_armhf.deb @@ -115,12 +115,12 @@ main/m/mesa/libgl1-mesa-dev_8.0.5-4+deb7u2_armhf.deb main/m/mesa/libgl1-mesa-glx_8.0.5-4+deb7u2_armhf.deb main/m/mesa/libglapi-mesa_8.0.5-4+deb7u2_armhf.deb main/m/mesa/mesa-common-dev_8.0.5-4+deb7u2_armhf.deb -main/n/nspr/libnspr4_4.9.2-1+deb7u1_armhf.deb -main/n/nspr/libnspr4-dev_4.9.2-1+deb7u1_armhf.deb +main/n/nspr/libnspr4_4.9.2-1+deb7u2_armhf.deb +main/n/nspr/libnspr4-dev_4.9.2-1+deb7u2_armhf.deb main/n/nss/libnss3_3.14.5-1_armhf.deb main/n/nss/libnss3-dev_3.14.5-1_armhf.deb -main/o/openssl/libssl1.0.0_1.0.1e-2+deb7u7_armhf.deb -main/o/openssl/libssl-dev_1.0.1e-2+deb7u7_armhf.deb +main/o/openssl/libssl1.0.0_1.0.1e-2+deb7u11_armhf.deb +main/o/openssl/libssl-dev_1.0.1e-2+deb7u11_armhf.deb main/o/orbit2/liborbit2_2.14.19-0.1_armhf.deb main/p/p11-kit/libp11-kit0_0.12-3_armhf.deb main/p/pam/libpam0g_1.1.3-7.1_armhf.deb diff --git a/chrome/installer/mac/app_resource_rules.plist.in b/chrome/installer/mac/app_resource_rules.plist.in index d629044c21..6fc6246b4b 100644 --- a/chrome/installer/mac/app_resource_rules.plist.in +++ b/chrome/installer/mac/app_resource_rules.plist.in @@ -51,5 +51,42 @@ <real>50</real> </dict> </dict> + <key>rules2</key> + <dict> + <key>^PkgInfo$</key> + <true/> + <key>^MacOS/</key> + <true/> + <key>^Resources/</key> + <true/> + <key>^Versions/</key> + <dict> + <key>omit</key> + <true/> + <key>weight</key> + <real>10</real> + </dict> + <key>^Versions/@VERSION_REGEX@/</key> + <dict> + <key>nested</key> + <true/> + <key>weight</key> + <real>20</real> + </dict> + <key>^Resources/.+\.lproj/</key> + <dict> + <key>optional</key> + <true/> + <key>weight</key> + <real>30</real> + </dict> + <key>/\.DS_Store$</key> + <dict> + <key>omit</key> + <true/> + <key>weight</key> + <real>50</real> + </dict> + </dict> </dict> </plist> diff --git a/chrome/installer/mini_installer.gyp b/chrome/installer/mini_installer.gyp index 115e84767d..2fba2e0e28 100644 --- a/chrome/installer/mini_installer.gyp +++ b/chrome/installer/mini_installer.gyp @@ -198,7 +198,6 @@ ['disable_nacl==1', { 'inputs!': [ '<(PRODUCT_DIR)/nacl64.exe', - '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll', '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe', '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe', ], @@ -231,7 +230,6 @@ '<(PRODUCT_DIR)/chrome.exe', '<(PRODUCT_DIR)/chrome.dll', '<(PRODUCT_DIR)/nacl64.exe', - '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll', '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe', '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe', '<(PRODUCT_DIR)/locales/en-US.pak', diff --git a/chrome/installer/mini_installer.gypi b/chrome/installer/mini_installer.gypi index c43a3394d3..c5ae0b004c 100644 --- a/chrome/installer/mini_installer.gypi +++ b/chrome/installer/mini_installer.gypi @@ -185,7 +185,6 @@ '<(PRODUCT_DIR)/chrome.exe', '<@(chrome_dll_path)', '<(PRODUCT_DIR)/nacl64.exe', - '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll', '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe', '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe', '<(PRODUCT_DIR)/locales/en-US.pak', diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release index fcacc382a3..522980fee7 100644 --- a/chrome/installer/mini_installer/chrome.release +++ b/chrome/installer/mini_installer/chrome.release @@ -34,7 +34,6 @@ nacl64.exe: %(VersionDir)s\ nacl_irt_x86_32.nexe: %(VersionDir)s\ nacl_irt_x86_64.nexe: %(VersionDir)s\ pdf.dll: %(VersionDir)s\ -ppGoogleNaClPluginChrome.dll: %(VersionDir)s\ resources.pak: %(VersionDir)s\ syzyasan_rtl.dll: %(VersionDir)s\ xinput1_3.dll: %(VersionDir)s\ diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index 05e5b9bca6..5ba2608766 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -10,14 +10,12 @@ #include <string> -#include "base/command_line.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/numerics/safe_conversions.h" #include "base/path_service.h" -#include "base/process/launch.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -25,7 +23,6 @@ #include "base/win/windows_version.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" -#include "chrome/installer/launcher_support/chrome_launcher_support.h" #include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/setup_constants.h" #include "chrome/installer/util/auto_launch_util.h" @@ -691,15 +688,4 @@ void HandleActiveSetupForBrowser(const base::FilePath& installation_root, chrome_exe, chrome, prefs, CURRENT_USER, install_operation); } -bool InstallFromWebstore(const std::string& app_code) { - base::FilePath app_host_path(chrome_launcher_support::GetAnyAppHostPath()); - if (app_host_path.empty()) - return false; - - CommandLine cmd(app_host_path); - cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); - VLOG(1) << "App install command: " << cmd.GetCommandLineString(); - return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); -} - } // namespace installer diff --git a/chrome/installer/setup/install.h b/chrome/installer/setup/install.h index a700b3c8be..22f3c3d229 100644 --- a/chrome/installer/setup/install.h +++ b/chrome/installer/setup/install.h @@ -132,11 +132,6 @@ void HandleActiveSetupForBrowser(const base::FilePath& installation_root, const Product& chrome, bool force); -// Launches app_host.exe to install content from web store (non-blocking). -// Returns true on successful execution (although successful installation -// is not guaranteed). -bool InstallFromWebstore(const std::string& app_code); - } // namespace installer #endif // CHROME_INSTALLER_SETUP_INSTALL_H_ diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index ca39080071..727d4fe09c 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -20,7 +20,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" -#include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/version.h" @@ -819,16 +818,13 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, // Create Version key for a product (if not already present) and sets the new // product version as the last step. void AddVersionKeyWorkItems(HKEY root, - BrowserDistribution* dist, + const base::string16& version_key, + const base::string16& product_name, const Version& new_version, bool add_language_identifier, WorkItemList* list) { - // Create Version key for each distribution (if not already present) and set - // the new product version as the last step. - base::string16 version_key(dist->GetVersionKey()); list->AddCreateRegKeyWorkItem(root, version_key, KEY_WOW64_32KEY); - base::string16 product_name(dist->GetDisplayName()); list->AddSetRegValueWorkItem(root, version_key, KEY_WOW64_32KEY, @@ -1306,8 +1302,13 @@ void AddInstallWorkItems(const InstallationState& original_state, AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, product, install_list); - AddVersionKeyWorkItems(root, product.distribution(), new_version, - add_language_identifier, install_list); + BrowserDistribution* dist = product.distribution(); + AddVersionKeyWorkItems(root, + dist->GetVersionKey(), + dist->GetDisplayName(), + new_version, + add_language_identifier, + install_list); AddDelegateExecuteWorkItems(installer_state, target_path, new_version, product, install_list); @@ -1327,8 +1328,12 @@ void AddInstallWorkItems(const InstallationState& original_state, BrowserDistribution* shadow_app_launcher_dist = BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_APP_HOST); - AddVersionKeyWorkItems(root, shadow_app_launcher_dist, new_version, - add_language_identifier, install_list); + AddVersionKeyWorkItems(root, + shadow_app_launcher_dist->GetVersionKey(), + shadow_app_launcher_dist->GetDisplayName(), + new_version, + add_language_identifier, + install_list); } // Add any remaining work items that involve special settings for diff --git a/chrome/installer/setup/install_worker.h b/chrome/installer/setup/install_worker.h index 41d1b042d9..aadd588c6b 100644 --- a/chrome/installer/setup/install_worker.h +++ b/chrome/installer/setup/install_worker.h @@ -12,6 +12,8 @@ #include <vector> +#include "base/strings/string16.h" + class BrowserDistribution; class WorkItemList; @@ -40,7 +42,8 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, // product version as the last step. If |add_language_identifier| is true, the // "lang" value is also set according to the currently selected translation. void AddVersionKeyWorkItems(HKEY root, - BrowserDistribution* dist, + const base::string16& version_key, + const base::string16& product_name, const base::Version& new_version, bool add_language_identifier, WorkItemList* list); diff --git a/chrome/installer/setup/setup_constants.cc b/chrome/installer/setup/setup_constants.cc index 10b847952e..77c03a64ce 100644 --- a/chrome/installer/setup/setup_constants.cc +++ b/chrome/installer/setup/setup_constants.cc @@ -20,8 +20,4 @@ const wchar_t kInstallSourceChromeDir[] = L"Chrome-bin"; const wchar_t kMediaPlayerRegPath[] = L"Software\\Microsoft\\MediaPlayer\\ShimInclusionList"; -// Key names for values passed via the GoogleUpdateUntrustedData environment -// variable. -const char kInstallFromWebstore[] = "install-from-webstore"; - } // namespace installer diff --git a/chrome/installer/setup/setup_constants.h b/chrome/installer/setup/setup_constants.h index 376350a958..9e146b811e 100644 --- a/chrome/installer/setup/setup_constants.h +++ b/chrome/installer/setup/setup_constants.h @@ -20,8 +20,6 @@ extern const wchar_t kInstallSourceChromeDir[]; extern const wchar_t kMediaPlayerRegPath[]; -extern const char kInstallFromWebstore[]; - } // namespace installer #endif // CHROME_INSTALLER_SETUP_SETUP_CONSTANTS_H__ diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index c5b8c0fff2..eda79e57fa 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -1639,16 +1639,6 @@ InstallStatus InstallProductsHelper( RemoveChromeLegacyRegistryKeys(chrome->distribution(), chrome_exe); } } - - if (prefs.install_chrome_app_launcher() && - InstallUtil::GetInstallReturnCode(install_status) == 0) { - std::string webstore_item(google_update::GetUntrustedDataValue( - kInstallFromWebstore)); - if (!webstore_item.empty()) { - bool success = InstallFromWebstore(webstore_item); - VLOG_IF(1, !success) << "Failed to launch app installation."; - } - } } } diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index ac9484deff..ce02a20b79 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -26,7 +26,6 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_result_codes.h" -#include "chrome/installer/launcher_support/chrome_launcher_support.h" #include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/setup_constants.h" @@ -442,12 +441,12 @@ DeleteResult DeleteUserDataDir(const base::FilePath& user_data_dir, if (result == DELETE_REQUIRES_REBOOT) { ScheduleParentAndGrandparentForDeletion(user_data_dir); } else { - const base::FilePath user_data_dir(user_data_dir.DirName()); - if (!user_data_dir.empty() && - DeleteEmptyDir(user_data_dir) == DELETE_SUCCEEDED) { - const base::FilePath product_dir(user_data_dir.DirName()); - if (!product_dir.empty()) - DeleteEmptyDir(product_dir); + const base::FilePath product_dir1(user_data_dir.DirName()); + if (!product_dir1.empty() && + DeleteEmptyDir(product_dir1) == DELETE_SUCCEEDED) { + const base::FilePath product_dir2(product_dir1.DirName()); + if (!product_dir2.empty()) + DeleteEmptyDir(product_dir2); } } @@ -1281,24 +1280,18 @@ InstallStatus UninstallProduct(const InstallationState& original_state, // TODO(huangs): Implement actual migration code and remove the hack below. // Remove the "shadow" App Launcher registry keys. + // TODO(hunags): Management of this key should not be conditional on + // multi-install since the app list feature is available regardless of how + // chrome is installed. if (installer_state.is_multi_install()) { - // If we're not uninstalling the legacy App Launcher, and if it was - // not installed in the first place, then delete the "shadow" keys. - chrome_launcher_support::InstallationState level_to_check = - installer_state.system_install() ? - chrome_launcher_support::INSTALLED_AT_SYSTEM_LEVEL : - chrome_launcher_support::INSTALLED_AT_USER_LEVEL; - bool has_legacy_app_launcher = level_to_check == - chrome_launcher_support::GetAppLauncherInstallationState(); - if (!has_legacy_app_launcher) { - BrowserDistribution* shadow_app_launcher_dist = - BrowserDistribution::GetSpecificDistribution( - BrowserDistribution::CHROME_APP_HOST); - InstallUtil::DeleteRegistryKey( - reg_root, - shadow_app_launcher_dist->GetVersionKey(), - KEY_WOW64_32KEY); - } + // Delete the "shadow" keys. + BrowserDistribution* shadow_app_launcher_dist = + BrowserDistribution::GetSpecificDistribution( + BrowserDistribution::CHROME_APP_HOST); + InstallUtil::DeleteRegistryKey( + reg_root, + shadow_app_launcher_dist->GetVersionKey(), + KEY_WOW64_32KEY); } } diff --git a/chrome/installer/util/DEPS b/chrome/installer/util/DEPS new file mode 100644 index 0000000000..0148070b1a --- /dev/null +++ b/chrome/installer/util/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+components/metrics/client_info.h", +] diff --git a/chrome/installer/util/chrome_app_host_distribution.cc b/chrome/installer/util/chrome_app_host_distribution.cc index 85e50d5a3c..2f94f01386 100644 --- a/chrome/installer/util/chrome_app_host_distribution.cc +++ b/chrome/installer/util/chrome_app_host_distribution.cc @@ -21,17 +21,11 @@ #include "installer_util_strings.h" // NOLINT -namespace { - -const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; - -} // namespace - ChromeAppHostDistribution::ChromeAppHostDistribution() : BrowserDistribution( CHROME_APP_HOST, scoped_ptr<AppRegistrationData>( - new UpdatingAppRegistrationData(kChromeAppHostGuid))) { + new UpdatingAppRegistrationData(installer::kAppLauncherGuid))) { } base::string16 ChromeAppHostDistribution::GetBaseAppName() { @@ -127,8 +121,10 @@ void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status) { #if defined(GOOGLE_CHROME_BUILD) - GoogleUpdateSettings::UpdateInstallStatus(system_install, - archive_type, InstallUtil::GetInstallReturnCode(install_status), - kChromeAppHostGuid); + GoogleUpdateSettings::UpdateInstallStatus( + system_install, + archive_type, + InstallUtil::GetInstallReturnCode(install_status), + installer::kAppLauncherGuid); #endif } diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc index 80c0f1b230..431cf7b42e 100644 --- a/chrome/installer/util/google_update_constants.cc +++ b/chrome/installer/util/google_update_constants.cc @@ -45,6 +45,8 @@ const wchar_t kRegLastInstallerErrorField[] = L"LastInstallerError"; const wchar_t kRegLastInstallerExtraField[] = L"LastInstallerExtraCode1"; const wchar_t kRegLastRunTimeField[] = L"lastrun"; const wchar_t kRegMetricsId[] = L"metricsid"; +const wchar_t kRegMetricsIdEnabledDate[] = L"metricsid_enableddate"; +const wchar_t kRegMetricsIdInstallDate[] = L"metricsid_installdate"; const wchar_t kRegMSIField[] = L"msi"; const wchar_t kRegNameField[] = L"name"; const wchar_t kRegOemInstallField[] = L"oeminstall"; diff --git a/chrome/installer/util/google_update_constants.h b/chrome/installer/util/google_update_constants.h index 9f658ea31d..8718059799 100644 --- a/chrome/installer/util/google_update_constants.h +++ b/chrome/installer/util/google_update_constants.h @@ -55,6 +55,8 @@ extern const wchar_t kRegLastInstallerResultField[]; extern const wchar_t kRegLastInstallerErrorField[]; extern const wchar_t kRegLastInstallerExtraField[]; extern const wchar_t kRegMetricsId[]; +extern const wchar_t kRegMetricsIdEnabledDate[]; +extern const wchar_t kRegMetricsIdInstallDate[]; extern const wchar_t kRegMSIField[]; extern const wchar_t kRegNameField[]; extern const wchar_t kRegOemInstallField[]; diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 4d53ecac94..3c4cba6662 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -296,16 +296,43 @@ bool GoogleUpdateSettings::SetCollectStatsConsentAtLevel(bool system_install, return (result == ERROR_SUCCESS); } -bool GoogleUpdateSettings::LoadMetricsClientId(std::string* metrics_id) { - base::string16 metrics_id16; - bool rv = ReadGoogleUpdateStrKey(google_update::kRegMetricsId, &metrics_id16); - *metrics_id = base::UTF16ToUTF8(metrics_id16); - return rv; +scoped_ptr<metrics::ClientInfo> GoogleUpdateSettings::LoadMetricsClientInfo() { + base::string16 client_id_16; + if (!ReadGoogleUpdateStrKey(google_update::kRegMetricsId, &client_id_16) || + client_id_16.empty()) { + return scoped_ptr<metrics::ClientInfo>(); + } + + scoped_ptr<metrics::ClientInfo> client_info(new metrics::ClientInfo); + client_info->client_id = base::UTF16ToUTF8(client_id_16); + + base::string16 installation_date_str; + if (ReadGoogleUpdateStrKey(google_update::kRegMetricsIdInstallDate, + &installation_date_str)) { + base::StringToInt64(installation_date_str, &client_info->installation_date); + } + + base::string16 reporting_enbaled_date_date_str; + if (ReadGoogleUpdateStrKey(google_update::kRegMetricsIdEnabledDate, + &reporting_enbaled_date_date_str)) { + base::StringToInt64(reporting_enbaled_date_date_str, + &client_info->reporting_enabled_date); + } + + return client_info.Pass(); } -bool GoogleUpdateSettings::StoreMetricsClientId(const std::string& metrics_id) { - base::string16 metrics_id16 = base::UTF8ToUTF16(metrics_id); - return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id16); +void GoogleUpdateSettings::StoreMetricsClientInfo( + const metrics::ClientInfo& client_info) { + // Attempt a best-effort at backing |client_info| in the registry (but don't + // handle/report failures). + WriteGoogleUpdateStrKey(google_update::kRegMetricsId, + base::UTF8ToUTF16(client_info.client_id)); + WriteGoogleUpdateStrKey(google_update::kRegMetricsIdInstallDate, + base::Int64ToString16(client_info.installation_date)); + WriteGoogleUpdateStrKey( + google_update::kRegMetricsIdEnabledDate, + base::Int64ToString16(client_info.reporting_enabled_date)); } // EULA consent is only relevant for system-level installs. diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h index a8e43c426d..ca7fd7f3d3 100644 --- a/chrome/installer/util/google_update_settings.h +++ b/chrome/installer/util/google_update_settings.h @@ -8,10 +8,12 @@ #include <string> #include "base/basictypes.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "base/time/time.h" #include "base/version.h" #include "chrome/installer/util/util_constants.h" +#include "components/metrics/client_info.h" class AppRegistrationData; class BrowserDistribution; @@ -86,12 +88,15 @@ class GoogleUpdateSettings { bool consented); #endif - // Returns the metrics client id backed up in the registry. If none found, - // returns empty string. - static bool LoadMetricsClientId(std::string* metrics_id); + // Returns the metrics client info backed up in the registry. NULL + // if-and-only-if the client_id couldn't be retrieved (failure to retrieve + // other fields only makes them keep their default value). A non-null return + // will NEVER contain an empty client_id field. + static scoped_ptr<metrics::ClientInfo> LoadMetricsClientInfo(); - // Stores a backup of the metrics client id in the registry. - static bool StoreMetricsClientId(const std::string& metrics_id); + // Stores a backup of the metrics client info in the registry. Storing a + // |client_info| with an empty client id will effectively void the backup. + static void StoreMetricsClientInfo(const metrics::ClientInfo& client_info); // Sets the machine-wide EULA consented flag required on OEM installs. // Returns false if the setting could not be recorded. diff --git a/chrome/installer/util/google_update_util.cc b/chrome/installer/util/google_update_util.cc index c7de7a55c8..d3013bac30 100644 --- a/chrome/installer/util/google_update_util.cc +++ b/chrome/installer/util/google_update_util.cc @@ -4,28 +4,19 @@ #include "chrome/installer/util/google_update_util.h" -#include <algorithm> -#include <map> -#include <utility> -#include <vector> - #include "base/command_line.h" -#include "base/environment.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/process/kill.h" #include "base/process/launch.h" #include "base/strings/string16.h" -#include "base/strings/string_split.h" #include "base/time/time.h" #include "base/win/registry.h" #include "base/win/scoped_handle.h" #include "base/win/win_util.h" #include "base/win/windows_version.h" -#include "chrome/installer/launcher_support/chrome_launcher_support.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_settings.h" @@ -41,9 +32,6 @@ namespace { const int kGoogleUpdateTimeoutMs = 20 * 1000; -const char kEnvVariableUntrustedData[] = "GoogleUpdateUntrustedData"; -const int kUntrustedDataMaxLength = 4096; - // Returns true if Google Update is present at the given level. bool IsGoogleUpdatePresent(bool system_install) { // Using the existence of version key in the registry to decide. @@ -120,73 +108,6 @@ bool LaunchProcessAndWaitWithTimeout(const base::string16& cmd_string, return success; } -bool IsNotPrintable(unsigned char c) { - return c < 32 || c >= 127; -} - -// Returns whether or not |s| consists of printable characters. -bool IsStringPrintable(const std::string& s) { - return std::find_if(s.begin(), s.end(), IsNotPrintable) == s.end(); -} - -bool IsIllegalUntrustedDataKeyChar(unsigned char c) { - return !(c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || - c >= '0' && c <= '9' || c == '-' || c == '_' || c == '$'); -} - -// Returns true if |key| from untrusted data is valid. -bool IsUntrustedDataKeyValid(const std::string& key) { - return std::find_if(key.begin(), key.end(), IsIllegalUntrustedDataKeyChar) - == key.end(); -} - -// Parses |data_string| as key-value pairs and overwrites |untrusted_data| with -// the result. Returns true if the data could be parsed. -bool ParseUntrustedData( - const std::string& data_string, - std::map<std::string, std::string>* untrusted_data) { - DCHECK(untrusted_data); - if (data_string.length() > kUntrustedDataMaxLength || - !IsStringPrintable(data_string)) { - LOG(ERROR) << "Invalid value in untrusted data string."; - return false; - } - - VLOG(1) << "Untrusted data string: " << data_string; - - std::vector<std::pair<std::string, std::string> > kv_pairs; - if (!base::SplitStringIntoKeyValuePairs(data_string, '=', '&', &kv_pairs)) { - LOG(ERROR) << "Failed to parse untrusted data: " << data_string; - return false; - } - - untrusted_data->clear(); - std::vector<std::pair<std::string, std::string> >::const_iterator it; - for (it = kv_pairs.begin(); it != kv_pairs.end(); ++it) { - const std::string& key(it->first); - // TODO(huangs): URL unescape |value|. - const std::string& value(it->second); - if (IsUntrustedDataKeyValid(key) && IsStringPrintable(value)) - (*untrusted_data)[key] = value; - else - LOG(ERROR) << "Illegal character found in untrusted data."; - } - return true; -} - -// Reads and parses untrusted data passed from Google Update as key-value -// pairs, then overwrites |untrusted_data_map| with the result. -// Returns true if data are successfully read. -bool GetGoogleUpdateUntrustedData( - std::map<std::string, std::string>* untrusted_data) { - scoped_ptr<base::Environment> env(base::Environment::Create()); - std::string data_string; - if (!env || !env->GetVar(kEnvVariableUntrustedData, &data_string)) - return false; - - return ParseUntrustedData(data_string, untrusted_data); -} - } // namespace bool EnsureUserLevelGoogleUpdatePresent() { @@ -266,25 +187,4 @@ void ElevateIfNeededToReenableUpdates() { } } -std::string GetUntrustedDataValue(const std::string& key) { - std::map<std::string, std::string> untrusted_data; - if (GetGoogleUpdateUntrustedData(&untrusted_data)) { - std::map<std::string, std::string>::const_iterator data_it( - untrusted_data.find(key)); - if (data_it != untrusted_data.end()) - return data_it->second; - } - - return std::string(); -} - -std::string GetUntrustedDataValueFromTag(const std::string& tag, - const std::string& key) { - std::map<std::string, std::string> untrusted_data; - if (ParseUntrustedData(tag, &untrusted_data)) - return untrusted_data[key]; - - return std::string(); -} - } // namespace google_update diff --git a/chrome/installer/util/google_update_util.h b/chrome/installer/util/google_update_util.h index 4f240afb28..97edfada11 100644 --- a/chrome/installer/util/google_update_util.h +++ b/chrome/installer/util/google_update_util.h @@ -5,8 +5,6 @@ #ifndef CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ -#include <string> - namespace google_update { // If user-level Google Update is absent, calls the system-level @@ -27,18 +25,6 @@ bool UninstallGoogleUpdate(bool system_install); // GoogleUpdateSettings::ReenableAutoupdatesForApp() to do the work. void ElevateIfNeededToReenableUpdates(); -// Returns the value corresponding to |key| in untrusted data passed from -// Google Update. Returns an empty string if |key| is absent or if its value -// contains non-printable characters. -std::string GetUntrustedDataValue(const std::string& key); - -// Returns the value corresponding to |key| in untrusted data passed from -// |tag|. |tag| should be a printable list of key-value pairs, e.g. -// "key1=value1&key2=value2". Returns an empty string if |key| is absent or if -// its value contains non-printable characters. -std::string GetUntrustedDataValueFromTag(const std::string& tag, - const std::string& key); - } // namespace google_update #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc index 8800c5c461..67df18e4c4 100644 --- a/chrome/installer/util/util_constants.cc +++ b/chrome/installer/util/util_constants.cc @@ -212,6 +212,7 @@ const char kOutputFile[] = "output-file"; // TODO(gab): Rename setup.exe itself altogether and use the same binary for // Active Setup. const wchar_t kActiveSetupExe[] = L"chrmstp.exe"; +const wchar_t kAppLauncherGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; const wchar_t kChromeAppHostExe[] = L"app_host.exe"; const wchar_t kChromeDll[] = L"chrome.dll"; const wchar_t kChromeChildDll[] = L"chrome_child.dll"; diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index d2f648aa59..da54a38c43 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -201,6 +201,7 @@ extern const char kOutputFile[]; } // namespace switches extern const wchar_t kActiveSetupExe[]; +extern const wchar_t kAppLauncherGuid[]; extern const wchar_t kChromeAppHostExe[]; extern const wchar_t kChromeDll[]; extern const wchar_t kChromeChildDll[]; diff --git a/chrome/installer/util/work_item_list_unittest.cc b/chrome/installer/util/work_item_list_unittest.cc index 06719946f5..3e4a77afab 100644 --- a/chrome/installer/util/work_item_list_unittest.cc +++ b/chrome/installer/util/work_item_list_unittest.cc @@ -10,6 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string_util.h" +#include "base/test/test_reg_util_win.h" #include "base/win/registry.h" #include "chrome/installer/util/conditional_work_item_list.h" #include "chrome/installer/util/work_item.h" @@ -27,25 +28,16 @@ const wchar_t kName[] = L"name"; class WorkItemListTest : public testing::Test { protected: virtual void SetUp() { - // Create a temporary key for testing - RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS); - key.DeleteKey(kTestRoot); - ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kTestRoot, KEY_READ)); - ASSERT_EQ(ERROR_SUCCESS, - key.Create(HKEY_CURRENT_USER, kTestRoot, KEY_READ)); - ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"root_pit"); } virtual void TearDown() { logging::CloseLogFile(); - - // Clean up the temporary key - RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS); - ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kTestRoot)); } base::ScopedTempDir temp_dir_; + registry_util::RegistryOverrideManager registry_override_manager_; }; } // namespace |