Commit 5cfa7ad0 authored by Michael Chang's avatar Michael Chang Committed by Commit Bot

Mac updater setup: fix failure if ~/Library/{COMPANYNAME} DNE

Bug: 1031293
Change-Id: I4858a8aa5eb37c3ce5268752efd87c80fcad43cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095846Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Michael Chang <donchan@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#748835}
parent 7f8b779a
...@@ -88,10 +88,19 @@ void TerminateUpdaterSetupMain() { ...@@ -88,10 +88,19 @@ void TerminateUpdaterSetupMain() {
} }
bool CopyBundle() { bool CopyBundle() {
// Copy bundle to "~/Library/Google/GoogleUpdate". // Copy bundle to ~/Library/COMPANY_SHORTNAME_STRING/PRODUCT_FULLNAME_STRING.
// e.g. ~/Library/Google/GoogleUpdater
const base::FilePath dest_path = const base::FilePath dest_path =
base::mac::GetUserLibraryPath().Append(GetUpdateFolderName()); base::mac::GetUserLibraryPath().Append(GetUpdateFolderName());
if (!base::PathExists(dest_path)) {
if (!base::CreateDirectory(dest_path)) {
LOG(ERROR) << "Failed to create directory at "
<< dest_path.value().c_str();
return false;
}
}
base::FilePath this_executable_path; base::FilePath this_executable_path;
base::PathService::Get(base::FILE_EXE, &this_executable_path); base::PathService::Get(base::FILE_EXE, &this_executable_path);
const base::FilePath src_path = const base::FilePath src_path =
...@@ -105,7 +114,9 @@ bool CopyBundle() { ...@@ -105,7 +114,9 @@ bool CopyBundle() {
} }
bool DeleteInstallFolder() { bool DeleteInstallFolder() {
// Delete the install folder - "~/Library/Google/GoogleUpdate". // Delete install folder
// ~/Library/COMPANY_SHORTNAME_STRING/PRODUCT_FULLNAME_STRING.
// e.g. ~/Library/Google/GoogleUpdater
const base::FilePath dest_path = const base::FilePath dest_path =
base::mac::GetUserLibraryPath().Append(GetUpdateFolderName()); base::mac::GetUserLibraryPath().Append(GetUpdateFolderName());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment