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

Unified Diff: chrome/installer/setup/install.cc

Issue 159618: Use alternate icon for Chrome shortcuts if specified in master preferences. (Closed)
Patch Set: fix merge errors Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/install.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install.cc
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index ba62f0c3e801d2b482faf2edb0c715315133d5ff..6b20d689b3c0911478a9969977cfd1eb1c2bb52b 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -142,6 +142,19 @@ void AddUninstallShortcutWorkItems(HKEY reg_root,
}
}
+// Copy master preferences file provided to installer, in the same folder
+// as chrome.exe so Chrome first run can find it. This function will be called
+// only on the first install of Chrome.
+void CopyPreferenceFileForFirstRun(bool system_level,
+ const std::wstring& prefs_source_path) {
+ std::wstring prefs_dest_path(
+ installer::GetChromeInstallPath(system_level));
+ file_util::AppendToPath(&prefs_dest_path,
+ installer_util::kDefaultMasterPrefs);
+ if (!file_util::CopyFile(prefs_source_path, prefs_dest_path))
+ LOG(ERROR) << "failed copying master profile";
+}
+
// This method creates Chrome shortcuts in Start->Programs for all users or
// only for current user depending on whether it is system wide install or
// user only install.
@@ -480,8 +493,9 @@ bool installer::InstallNewVersion(const std::wstring& exe_path,
installer_util::InstallStatus installer::InstallOrUpdateChrome(
const std::wstring& exe_path, const std::wstring& archive_path,
- const std::wstring& install_temp_path, const DictionaryValue* prefs,
- const Version& new_version, const Version* installed_version) {
+ const std::wstring& install_temp_path, const std::wstring& prefs_path,
+ const DictionaryValue* prefs, const Version& new_version,
+ const Version* installed_version) {
bool system_install = installer_util::GetDistroBooleanPreference(prefs,
installer_util::master_preferences::kSystemLevel);
std::wstring install_path(GetChromeInstallPath(system_install));
@@ -508,6 +522,7 @@ installer_util::InstallStatus installer::InstallOrUpdateChrome(
if (!installed_version) {
LOG(INFO) << "First install of version " << new_version.GetString();
result = installer_util::FIRST_INSTALL_SUCCESS;
+ CopyPreferenceFileForFirstRun(system_install, prefs_path);
} else if (new_version.GetString() == installed_version->GetString()) {
LOG(INFO) << "Install repaired of version " << new_version.GetString();
result = installer_util::INSTALL_REPAIRED;
« no previous file with comments | « chrome/installer/setup/install.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698