Commit 14ac470e authored by Michael Chang's avatar Michael Chang Committed by Commit Bot

A few fixes for macOS Updater

After the work to simplify the promotion and the install, there was work
needed to put the right version into the updater's Info.plist. Also
needed to alter the .install script's way of getting the product name to
account for channels. Also, getting the sequenced task runner handle
needed to happen in active duty as the AppServerMac ctor did not run on
a valid sequence.

Bug: 1105628
Change-Id: I75845700e78045cbe51e7c653ca479e060be0478
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2294569
Commit-Queue: Michael Chang <donchan@microsoft.com>
Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788664}
parent 64e61da4
......@@ -26,8 +26,7 @@
namespace updater {
AppServerMac::AppServerMac()
: main_task_runner_(base::SequencedTaskRunnerHandle::Get()) {}
AppServerMac::AppServerMac() = default;
AppServerMac::~AppServerMac() = default;
void AppServerMac::Uninitialize() {
......@@ -42,6 +41,11 @@ void AppServerMac::Uninitialize() {
void AppServerMac::ActiveDuty() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// TODO: crbug 1105506
// Move the initialization of the task runner into the ctor when work to set
// up the main thread of the updater as a sequnece is done.
main_task_runner_ = base::SequencedTaskRunnerHandle::Get();
@autoreleasepool {
// Sets up a listener and delegate for the CRUUpdateChecking XPC
// connection
......
......@@ -299,11 +299,13 @@ main() {
# The app directory, product name, etc. can all be gotten from the
# installed_app_path.
readonly APP_DIR="$(basename "${installed_app_path}")"
readonly PRODUCT_NAME="${APP_DIR%.*}"
readonly FRAMEWORK_NAME="${PRODUCT_NAME} Framework"
readonly FRAMEWORK_DIR="${FRAMEWORK_NAME}.framework"
readonly CONTENTS_DIR="Contents"
readonly APP_PLIST="${CONTENTS_DIR}/Info"
readonly BUNDLE_NAME_KEY="CFBundleDisplayName"
readonly PRODUCT_NAME=\
"$(infoplist_read ${APP_DIR}/${APP_PLIST} ${BUNDLE_NAME_KEY})"
readonly FRAMEWORK_NAME="${PRODUCT_NAME} Framework"
readonly FRAMEWORK_DIR="${FRAMEWORK_NAME}.framework"
readonly VERSIONS_DIR_NEW=\
"${CONTENTS_DIR}/Frameworks/${FRAMEWORK_DIR}/Versions"
readonly APP_VERSION_KEY="CFBundleShortVersionString"
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/apple/tweak_info_plist.gni")
import("//build/config/mac/rules.gni")
import("//build/util/version.gni")
import("//chrome/updater/branding.gni")
......@@ -46,8 +47,12 @@ source_set("updater_tests") {
]
}
mac_app_bundle("updater_bundle") {
tweak_info_plist("updater_plist") {
info_plist = "Info.plist"
}
mac_app_bundle("updater_bundle") {
info_plist_target = ":updater_plist"
output_name = updater_product_full_name
extra_substitutions =
[ "MAC_BUNDLE_IDENTIFIER=$mac_updater_bundle_identifier" ]
......
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