diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 01:59:15 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 01:59:15 +0000 |
commit | cdb70a70ad4c6076fff85effeb61cfaef2bac429 (patch) | |
tree | c685fa64707262a40d5f11cf67aea4f9ea1d120b /chrome/installer/setup | |
parent | b88a291b41a2232943116c95c215442be3d5f24e (diff) | |
download | chromium_src-cdb70a70ad4c6076fff85effeb61cfaef2bac429.zip chromium_src-cdb70a70ad4c6076fff85effeb61cfaef2bac429.tar.gz chromium_src-cdb70a70ad4c6076fff85effeb61cfaef2bac429.tar.bz2 |
Remove some deprecated file_util wstring functions.
death to the wstring
TEST=trybots
BUG=none
Review URL: http://codereview.chromium.org/276016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r-- | chrome/installer/setup/install.cc | 13 | ||||
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 7 |
2 files changed, 11 insertions, 9 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index 1bc8164..ce211fd1 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -157,12 +157,13 @@ void AddUninstallShortcutWorkItems(HKEY reg_root, // only on the first install of Chrome. void CopyPreferenceFileForFirstRun(bool system_level, const std::wstring& prefs_source_path) { - std::wstring prefs_dest_path( + FilePath prefs_dest_path = FilePath::FromWStringHack( installer::GetChromeInstallPath(system_level)); - file_util::AppendToPath(&prefs_dest_path, - installer_util::kDefaultMasterPrefs); - if (!file_util::CopyFile(prefs_source_path, prefs_dest_path)) + prefs_dest_path = prefs_dest_path.Append(installer_util::kDefaultMasterPrefs); + if (!file_util::CopyFile(FilePath::FromWStringHack(prefs_source_path), + prefs_dest_path)) { LOG(INFO) << "Failed to copy master preferences."; + } } // This method creates Chrome shortcuts in Start->Programs for all users or @@ -304,7 +305,7 @@ bool DoPostInstallTasks(HKEY reg_root, BrowserDistribution* dist = BrowserDistribution::GetDistribution(); std::wstring version_key = dist->GetVersionKey(); - if (file_util::PathExists(new_chrome_exe)) { + if (file_util::PathExists(FilePath::FromWStringHack(new_chrome_exe))) { // Looks like this was in use update. So make sure we update the 'opv' key // with the current version that is active and 'cmd' key with the rename // command to run. @@ -492,7 +493,7 @@ bool InstallNewVersion(const std::wstring& exe_path, installer_util::kChromeNewExe); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); RegKey chrome_key(reg_root, dist->GetVersionKey().c_str(), KEY_READ); - if (file_util::PathExists(new_chrome_exe)) + if (file_util::PathExists(FilePath::FromWStringHack(new_chrome_exe))) chrome_key.ReadValue(google_update::kRegOldVersionField, current_version); if (current_version->empty()) chrome_key.ReadValue(google_update::kRegVersionField, current_version); diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 3b5377d..f20e307 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -67,7 +67,7 @@ DWORD UnPackArchive(const std::wstring& archive, bool system_install, // Check if this is differential update and if it is, patch it to the // installer archive that should already be on the machine. We assume // it is a differential installer if chrome.7z is not found. - if (!file_util::PathExists(uncompressed_archive)) { + if (!file_util::PathExists(FilePath::FromWStringHack(uncompressed_archive))) { incremental_install = true; LOG(INFO) << "Differential patch found. Applying to existing archive."; if (!installed_version) { @@ -163,10 +163,11 @@ bool CheckPreInstallConditions(const installer::Version* installed_version, // either does not exist or can be deleted (i.e. is not locked by some other // process). if (!installed_version) { - std::wstring install_path(installer::GetChromeInstallPath(system_install)); + FilePath install_path = FilePath::FromWStringHack( + installer::GetChromeInstallPath(system_install)); if (file_util::PathExists(install_path) && !file_util::Delete(install_path, true)) { - LOG(ERROR) << "Installation directory " << install_path + LOG(ERROR) << "Installation directory " << install_path.value() << " exists and can not be deleted."; status = installer_util::INSTALL_DIR_IN_USE; int str_id = IDS_INSTALL_DIR_IN_USE_BASE; |