summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-05 19:59:05 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-05 19:59:05 +0000
commit0302e4ac5907fcdaafbf2a883b29496032c0db19 (patch)
tree1dc0581bfb318593416b8d872a0f5f528eabf8e4 /chrome/installer/setup
parentde17ab159c33d8a89dcccae69c167c5d4a6cda68 (diff)
downloadchromium_src-0302e4ac5907fcdaafbf2a883b29496032c0db19.zip
chromium_src-0302e4ac5907fcdaafbf2a883b29496032c0db19.tar.gz
chromium_src-0302e4ac5907fcdaafbf2a883b29496032c0db19.tar.bz2
Remove uses of deprecated version of PathService::Get() in the installer.
Review URL: http://codereview.chromium.org/109033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/setup.cc29
-rw-r--r--chrome/installer/setup/uninstall.cc10
2 files changed, 21 insertions, 18 deletions
diff --git a/chrome/installer/setup/setup.cc b/chrome/installer/setup/setup.cc
index ba40b6d..e2b5647 100644
--- a/chrome/installer/setup/setup.cc
+++ b/chrome/installer/setup/setup.cc
@@ -37,7 +37,6 @@ void AddChromeToMediaPlayerList() {
// if the operation fails we log the error but still continue
if (!work_item.get()->Do())
LOG(ERROR) << "Could not add Chrome to media player inclusion list.";
-
}
void RegisterChromeOnMachine(std::wstring install_path, int options) {
@@ -89,7 +88,7 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
const std::wstring& install_path,
const std::wstring& new_version) {
bool system_install = (options & installer_util::SYSTEM_LEVEL) != 0;
- std::wstring shortcut_path;
+ FilePath shortcut_path;
int dir_enum = (system_install) ? base::DIR_COMMON_START_MENU :
base::DIR_START_MENU;
if (!PathService::Get(dir_enum, &shortcut_path)) {
@@ -101,7 +100,7 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
const std::wstring& product_name = dist->GetApplicationName();
const std::wstring& product_desc = dist->GetAppDescription();
- file_util::AppendToPath(&shortcut_path, product_name);
+ shortcut_path = shortcut_path.Append(product_name);
// Create/update Chrome link (points to chrome.exe) & Uninstall Chrome link
// (which points to setup.exe) under this folder only if:
@@ -111,8 +110,8 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
// shortcuts since our install. So on updates we only update if shortcut
// already exists)
bool ret = true;
- std::wstring chrome_link(shortcut_path); // Chrome link (launches Chrome)
- file_util::AppendToPath(&chrome_link, product_name + L".lnk");
+ FilePath chrome_link(shortcut_path); // Chrome link (launches Chrome)
+ chrome_link = chrome_link.Append(product_name + L".lnk");
std::wstring chrome_exe(install_path); // Chrome link target
file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
@@ -121,19 +120,22 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
if (!file_util::PathExists(shortcut_path))
file_util::CreateDirectoryW(shortcut_path);
- LOG(INFO) << "Creating shortcut to " << chrome_exe << " at " << chrome_link;
- ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, chrome_link,
+ LOG(INFO) << "Creating shortcut to " << chrome_exe << " at "
+ << chrome_link.value();
+ ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe,
+ chrome_link.value(),
product_desc, true);
} else if (file_util::PathExists(chrome_link)) {
- LOG(INFO) << "Updating shortcut at " << chrome_link
+ LOG(INFO) << "Updating shortcut at " << chrome_link.value()
<< " to point to " << chrome_exe;
- ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, chrome_link,
+ ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe,
+ chrome_link.value(),
product_desc, false);
}
// Create/update uninstall link
- std::wstring uninstall_link(shortcut_path); // Uninstall Chrome link
- file_util::AppendToPath(&uninstall_link,
+ FilePath uninstall_link(shortcut_path); // Uninstall Chrome link
+ uninstall_link = uninstall_link.Append(
dist->GetUninstallLinkName() + L".lnk");
if ((install_status == installer_util::FIRST_INSTALL_SUCCESS) ||
(install_status == installer_util::INSTALL_REPAIRED) ||
@@ -151,9 +153,10 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
arguments.append(installer_util::switches::kSystemLevel);
}
- LOG(INFO) << "Creating/updating uninstall link at " << uninstall_link;
+ LOG(INFO) << "Creating/updating uninstall link at "
+ << uninstall_link.value();
ret = ret && file_util::CreateShortcutLink(setup_exe.c_str(),
- uninstall_link.c_str(),
+ uninstall_link.value().c_str(),
NULL,
arguments.c_str(),
NULL, setup_exe.c_str(), 0);
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 765561a..1203125 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -67,7 +67,7 @@ void CloseAllChromeProcesses() {
// to remove the alternate desktop shortcut. Only one of them should be
// present in a given install but at this point we don't know which one.
void DeleteChromeShortcut(bool system_uninstall) {
- std::wstring shortcut_path;
+ FilePath shortcut_path;
if (system_uninstall) {
PathService::Get(base::DIR_COMMON_START_MENU, &shortcut_path);
if (!ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER |
@@ -88,10 +88,10 @@ void DeleteChromeShortcut(bool system_uninstall) {
LOG(ERROR) << "Failed to get location for shortcut.";
} else {
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- file_util::AppendToPath(&shortcut_path, dist->GetApplicationName());
- LOG(INFO) << "Deleting shortcut " << shortcut_path;
+ shortcut_path = shortcut_path.Append(dist->GetApplicationName());
+ LOG(INFO) << "Deleting shortcut " << shortcut_path.value();
if (!file_util::Delete(shortcut_path, true))
- LOG(ERROR) << "Failed to delete folder: " << shortcut_path;
+ LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value();
}
}
@@ -235,7 +235,7 @@ installer_util::InstallStatus installer_setup::UninstallChrome(
// Since --force-uninstall command line option is used, we are going to
// do silent uninstall. Try to close all running Chrome instances.
CloseAllChromeProcesses();
- } else { // no --force-uninstall so lets show some UI dialog boxes.
+ } else { // no --force-uninstall so lets show some UI dialog boxes.
status = IsChromeActiveOrUserCancelled(system_uninstall);
if (status != installer_util::UNINSTALL_CONFIRMED &&
status != installer_util::UNINSTALL_DELETE_PROFILE)