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

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

Issue 164390: Merge 22314 - Use alternate icon for Chrome shortcuts if specified in master ... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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
===================================================================
--- chrome/installer/setup/install.cc (revision 23179)
+++ chrome/installer/setup/install.cc (working copy)
@@ -142,6 +142,19 @@
}
}
+// 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.
@@ -486,8 +499,9 @@
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));
@@ -514,6 +528,7 @@
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;
Property changes on: chrome\installer\setup\install.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/installer/setup/install.cc:r22314
« 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