Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d4e1bff10 | |||
| 1c743053c6 | |||
| de1a9fa413 | |||
| 12a7deb15f | |||
| e6375b0919 | |||
| 029cb2f5f8 | |||
| 2ac8a1afd1 | |||
| 784bb249a9 | |||
| 51e1266532 | |||
| 4b7caeeb54 | |||
| 7e592ebb2b | |||
| 0aea54f0c5 | |||
| 9407ee36d2 | |||
| 9058e3c556 | |||
| a8f4ace099 | |||
| 610f15c556 | |||
| 62174be95e | |||
| 48bdcd1a64 | |||
| cb6f38821e | |||
| b96fcb7a47 | |||
| ad14e1b0a4 | |||
| 61be8bead4 | |||
| 8b2bf56eca |
@@ -22,7 +22,7 @@ assignees: ''
|
||||
|
||||
**Versions**
|
||||
> Please complete the following information.
|
||||
- Background Music: [e.g. "0.4.0" or "0.4.0-SNAPSHOT-c0ab98b". `Preferences > About Background Music`]
|
||||
- Background Music: [e.g. "0.4.3" or "0.4.0-SNAPSHOT-c0ab98b". `Preferences > About Background Music`]
|
||||
- macOS: [e.g. "11.3 Beta (20E5172i)" or "Big Sur". ` > About This Mac`]
|
||||
|
||||
**Hardware**
|
||||
@@ -43,8 +43,7 @@ assignees: ''
|
||||
> Tips
|
||||
> (Delete this section before posting.)
|
||||
> - https://github.com/kyleneideck/BackgroundMusic#troubleshooting
|
||||
> - Try the latest SNAPSHOT version from https://github.com/kyleneideck/BackgroundMusic/releases
|
||||
> - Especially if you're using macOS Big Sur.
|
||||
> - If your bug is one of common issues, consider leaving a comment or a +1 (👍) on an existing issue:
|
||||
> - Try the latest SNAPSHOT version from https://github.com/kyleneideck/BackgroundMusic/releases (if it's newer than the latest non-SNAPSHOT release).
|
||||
> - If your bug is one of these common issues, consider leaving a comment or a +1 (👍) on an existing issue:
|
||||
> - Background Music currently only supports audio devices with two channels. Bluetooth devices often only have one.
|
||||
> - Volumes having no effect for certain apps: Microsoft Teams ([workaround](https://github.com/kyleneideck/BackgroundMusic/issues/268#issuecomment-604977210)), Zoom ([workaround](https://github.com/kyleneideck/BackgroundMusic/issues/396#issuecomment-741992157)), Discord ([workaround](https://github.com/kyleneideck/BackgroundMusic/issues/210#issuecomment-507048957), [see also](https://github.com/kyleneideck/BackgroundMusic/issues/267#issuecomment-617327850)), Chrome (sometimes)
|
||||
|
||||
@@ -23,13 +23,11 @@
|
||||
// Sets up and tears down the app.
|
||||
//
|
||||
|
||||
// Local Includes
|
||||
#import "BGMAudioDeviceManager.h"
|
||||
#import "BGMAppVolumesController.h"
|
||||
|
||||
// System Includes
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class BGMAudioDeviceManager;
|
||||
@class BGMAppVolumesController;
|
||||
|
||||
// Tags for UI elements in MainMenu.xib
|
||||
static NSInteger const kVolumesHeadingMenuItemTag = 3;
|
||||
|
||||
@@ -57,6 +57,8 @@ BGMAudioDevice::~BGMAudioDevice()
|
||||
bool BGMAudioDevice::CanBeOutputDeviceInBGMApp() const
|
||||
{
|
||||
CFStringRef uid = CopyDeviceUID();
|
||||
assert(uid != nullptr);
|
||||
|
||||
bool isNullDevice = CFEqual(uid, CFSTR(kBGMNullDeviceUID));
|
||||
CFRelease(uid);
|
||||
|
||||
@@ -340,6 +342,9 @@ bool BGMAudioDevice::IsBGMDevice(bool inIncludeUISoundsInstance) const
|
||||
{
|
||||
// Check the device's UID to see whether it's BGMDevice.
|
||||
CFStringRef uid = CopyDeviceUID();
|
||||
if (uid == nullptr) {
|
||||
return isBGMDevice;
|
||||
}
|
||||
|
||||
isBGMDevice =
|
||||
CFEqual(uid, CFSTR(kBGMDeviceUID)) ||
|
||||
|
||||
@@ -243,7 +243,9 @@ BGMBackgroundMusicDevice::ResponsibleBundleIDsOf(CACFString inParentBundleID)
|
||||
// Google Chrome
|
||||
{ "com.google.Chrome", { "com.google.Chrome.helper" } },
|
||||
// Microsoft Edge
|
||||
{ "com.microsoft.edgemac", { "com.microsoft.edgemac.helper" } }
|
||||
{ "com.microsoft.edgemac", { "com.microsoft.edgemac.helper" } },
|
||||
// Arc
|
||||
{ "company.thebrowser.Browser", { "company.thebrowser.browser.helper" } }
|
||||
};
|
||||
|
||||
// Parallels' VM "dock helper" apps have bundle IDs like
|
||||
|
||||
@@ -894,7 +894,7 @@ void BGMPlayThrough::HandleBGMDeviceIsRunning(BGMPlayThrough* refCon)
|
||||
|
||||
DebugMsg("BGMPlayThrough::HandleBGMDeviceIsRunning: "
|
||||
"BGMDevice is %srunning somewhere other than BGMApp",
|
||||
isRunningSomewhereOtherThanBGMApp ? "" : " not");
|
||||
isRunningSomewhereOtherThanBGMApp ? "" : "not ");
|
||||
|
||||
if(isRunningSomewhereOtherThanBGMApp)
|
||||
{
|
||||
@@ -933,9 +933,8 @@ void BGMPlayThrough::HandleBGMDeviceIsRunningSomewhereOtherThanBGMApp(BGMPlay
|
||||
// static
|
||||
bool BGMPlayThrough::IsRunningSomewhereOtherThanBGMApp(const BGMAudioDevice& inBGMDevice)
|
||||
{
|
||||
return CFBooleanGetValue(
|
||||
static_cast<CFBooleanRef>(
|
||||
inBGMDevice.GetPropertyData_CFType(kBGMRunningSomewhereOtherThanBGMAppAddress)));
|
||||
auto type = inBGMDevice.GetPropertyData_CFType(kBGMRunningSomewhereOtherThanBGMAppAddress);
|
||||
return type && CFBooleanGetValue(static_cast<CFBooleanRef>(type));
|
||||
}
|
||||
|
||||
#pragma mark IOProcs
|
||||
|
||||
@@ -125,10 +125,17 @@ static CGFloat const kVolumeIconAdditionalVerticalPadding = 0.075;
|
||||
- (void) initIcons {
|
||||
// Load the icons.
|
||||
fermataIcon = [NSImage imageNamed:@"FermataIcon"];
|
||||
volumeIcon0SoundWaves = [NSImage imageNamed:@"Volume0"];
|
||||
volumeIcon1SoundWave = [NSImage imageNamed:@"Volume1"];
|
||||
volumeIcon2SoundWaves = [NSImage imageNamed:@"Volume2"];
|
||||
volumeIcon3SoundWaves = [NSImage imageNamed:@"Volume3"];
|
||||
if (@available(macOS 11.0, *)) {
|
||||
volumeIcon0SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.fill" accessibilityDescription:nil];
|
||||
volumeIcon1SoundWave = [NSImage imageWithSystemSymbolName:@"speaker.wave.1.fill" accessibilityDescription:nil];
|
||||
volumeIcon2SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.wave.2.fill" accessibilityDescription:nil];
|
||||
volumeIcon3SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.wave.3.fill" accessibilityDescription:nil];
|
||||
} else {
|
||||
volumeIcon0SoundWaves = [NSImage imageNamed:@"Volume0"];
|
||||
volumeIcon1SoundWave = [NSImage imageNamed:@"Volume1"];
|
||||
volumeIcon2SoundWaves = [NSImage imageNamed:@"Volume2"];
|
||||
volumeIcon3SoundWaves = [NSImage imageNamed:@"Volume3"];
|
||||
}
|
||||
|
||||
// Set the icons' sizes.
|
||||
NSRect statusBarItemFrame;
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" tag="1" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ekc-h0-I43">
|
||||
<rect key="frame" x="71" y="100" width="240" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Version 0.4.2" id="FDH-7l-wFf">
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Version 0.4.3" id="FDH-7l-wFf">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.4.2</string>
|
||||
<string>0.4.3</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#import "BGMAppDelegate.h"
|
||||
|
||||
// Local Includes
|
||||
#import "BGMAudioDeviceManager.h"
|
||||
#import "BGMAppVolumesController.h"
|
||||
|
||||
// Local Includes
|
||||
#import "BGMASOutputDevice.h"
|
||||
#import "BGMASApplication.h"
|
||||
|
||||
@@ -140,13 +140,13 @@ sleep 2
|
||||
# don't work with older versions of launchctl, so I figure there's no harm in trying a bunch of different ways until
|
||||
# one works.
|
||||
(sudo launchctl kickstart -k system/com.apple.audio.coreaudiod &>/dev/null || \
|
||||
sudo killall coreaudiod &>/dev/null || \
|
||||
sudo launchctl kill SIGTERM system/com.apple.audio.coreaudiod &>/dev/null || \
|
||||
sudo launchctl kill TERM system/com.apple.audio.coreaudiod &>/dev/null || \
|
||||
sudo launchctl kill 15 system/com.apple.audio.coreaudiod &>/dev/null || \
|
||||
sudo launchctl kill -15 system/com.apple.audio.coreaudiod &>/dev/null || \
|
||||
(sudo launchctl unload "${coreaudiod_plist}" &>/dev/null && \
|
||||
sudo launchctl load "${coreaudiod_plist}" &>/dev/null) || \
|
||||
sudo killall coreaudiod &>/dev/null)
|
||||
sudo launchctl load "${coreaudiod_plist}" &>/dev/null))
|
||||
|
||||
echo "..."
|
||||
sleep 3
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.4.2</string>
|
||||
<string>0.4.3</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -98,32 +98,6 @@ public:
|
||||
static bool IsCongruentElement(AudioObjectPropertyElement inElement1, AudioObjectPropertyElement inElement2) { return (inElement1 == inElement2) || (inElement1 == kAudioObjectPropertyElementWildcard) || (inElement2 == kAudioObjectPropertyElementWildcard); }
|
||||
static bool IsCongruentAddress(const AudioObjectPropertyAddress& inAddress1, const AudioObjectPropertyAddress& inAddress2) { return IsCongruentScope(inAddress1.mScope, inAddress2.mScope) && IsCongruentSelector(inAddress1.mSelector, inAddress2.mSelector) && IsCongruentElement(inAddress1.mElement, inAddress2.mElement); }
|
||||
static bool IsCongruentLessThanAddress(const AudioObjectPropertyAddress& inAddress1, const AudioObjectPropertyAddress& inAddress2) { bool theAnswer = false; if(!IsCongruentScope(inAddress1.mScope, inAddress2.mScope)) { theAnswer = inAddress1.mScope < inAddress2.mScope; } else if(!IsCongruentSelector(inAddress1.mSelector, inAddress2.mSelector)) { theAnswer = inAddress1.mSelector < inAddress2.mSelector; } else if(!IsCongruentElement(inAddress1.mElement, inAddress2.mElement)) { theAnswer = inAddress1.mElement < inAddress2.mElement; } return theAnswer; }
|
||||
|
||||
// STL Helpers
|
||||
public:
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
struct EqualTo : public std::binary_function<AudioObjectPropertyAddress, AudioObjectPropertyAddress, bool>
|
||||
{
|
||||
bool operator()(const AudioObjectPropertyAddress& inAddress1, const AudioObjectPropertyAddress& inAddress2) const { return IsSameAddress(inAddress1, inAddress2); }
|
||||
};
|
||||
|
||||
struct LessThan : public std::binary_function<AudioObjectPropertyAddress, AudioObjectPropertyAddress, bool>
|
||||
{
|
||||
bool operator()(const AudioObjectPropertyAddress& inAddress1, const AudioObjectPropertyAddress& inAddress2) const { return IsLessThanAddress(inAddress1, inAddress2); }
|
||||
};
|
||||
|
||||
struct CongruentEqualTo : public std::binary_function<AudioObjectPropertyAddress, AudioObjectPropertyAddress, bool>
|
||||
{
|
||||
bool operator()(const AudioObjectPropertyAddress& inAddress1, const AudioObjectPropertyAddress& inAddress2) const { return IsCongruentAddress(inAddress1, inAddress2); }
|
||||
};
|
||||
|
||||
struct CongruentLessThan : public std::binary_function<AudioObjectPropertyAddress, AudioObjectPropertyAddress, bool>
|
||||
{
|
||||
bool operator()(const AudioObjectPropertyAddress& inAddress1, const AudioObjectPropertyAddress& inAddress2) const { return IsCongruentLessThanAddress(inAddress1, inAddress2); }
|
||||
};
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@@ -160,11 +134,8 @@ public:
|
||||
const AudioObjectPropertyAddress* GetItems() const { return &(*mAddressList.begin()); }
|
||||
AudioObjectPropertyAddress* GetItems() { return &(*mAddressList.begin()); }
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
bool HasItem(const AudioObjectPropertyAddress& inAddress) const { AddressList::const_iterator theIterator = std::find_if(mAddressList.begin(), mAddressList.end(), std::bind1st(CAPropertyAddress::CongruentEqualTo(), inAddress)); return theIterator != mAddressList.end(); }
|
||||
bool HasExactItem(const AudioObjectPropertyAddress& inAddress) const { AddressList::const_iterator theIterator = std::find_if(mAddressList.begin(), mAddressList.end(), std::bind1st(CAPropertyAddress::EqualTo(), inAddress)); return theIterator != mAddressList.end(); }
|
||||
#pragma clang diagnostic pop
|
||||
bool HasItem(const AudioObjectPropertyAddress& inAddress) const { AddressList::const_iterator theIterator = std::find_if(mAddressList.begin(), mAddressList.end(), [&inAddress](const CAPropertyAddress& addr) { return CAPropertyAddress::IsCongruentAddress(addr, inAddress); }); return theIterator != mAddressList.end(); }
|
||||
bool HasExactItem(const AudioObjectPropertyAddress& inAddress) const { AddressList::const_iterator theIterator = std::find_if(mAddressList.begin(), mAddressList.end(), [&inAddress](const CAPropertyAddress& addr) { return CAPropertyAddress::IsSameAddress(addr, inAddress); }); return theIterator != mAddressList.end(); }
|
||||
|
||||
void AppendItem(const AudioObjectPropertyAddress& inAddress) { mAddressList.push_back(inAddress); }
|
||||
void AppendUniqueItem(const AudioObjectPropertyAddress& inAddress) { if(!HasItem(inAddress)) { mAddressList.push_back(inAddress); } }
|
||||
@@ -172,7 +143,7 @@ public:
|
||||
void InsertItemAtIndex(UInt32 inIndex, const AudioObjectPropertyAddress& inAddress) { if(inIndex < mAddressList.size()) { AddressList::iterator theIterator = mAddressList.begin(); std::advance(theIterator, static_cast<int>(inIndex)); mAddressList.insert(theIterator, inAddress); } else { mAddressList.push_back(inAddress); } }
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
void EraseExactItem(const AudioObjectPropertyAddress& inAddress) { AddressList::iterator theIterator = std::find_if(mAddressList.begin(), mAddressList.end(), std::bind1st(CAPropertyAddress::EqualTo(), inAddress)); if(theIterator != mAddressList.end()) { mAddressList.erase(theIterator); } }
|
||||
void EraseExactItem(const AudioObjectPropertyAddress& inAddress) { AddressList::iterator theIterator = std::find_if(mAddressList.begin(), mAddressList.end(), [&inAddress](const CAPropertyAddress& addr) { return CAPropertyAddress::IsSameAddress(addr, inAddress); }); if(theIterator != mAddressList.end()) { mAddressList.erase(theIterator); } }
|
||||
#pragma clang diagnostic pop
|
||||
void EraseItemAtIndex(UInt32 inIndex) { if(inIndex < mAddressList.size()) { AddressList::iterator theIterator = mAddressList.begin(); std::advance(theIterator, static_cast<int>(inIndex)); mAddressList.erase(theIterator); } }
|
||||
void EraseAllItems() { mAddressList.clear(); }
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.4.2</string>
|
||||
<string>0.4.3</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -68,16 +68,16 @@ You can download the current version of **Background Music** using the following
|
||||
|
||||
### Option 1
|
||||
|
||||
Download **version 0.4.0**:
|
||||
Download **version 0.4.3**:
|
||||
|
||||
<a href="https://github.com/kyleneideck/BackgroundMusic/releases/download/v0.4.0/BackgroundMusic-0.4.0.pkg"><img
|
||||
<a href="https://github.com/kyleneideck/BackgroundMusic/releases/download/v0.4.3/BackgroundMusic-0.4.3.pkg"><img
|
||||
src="Images/README/pkg-icon.png" width="32" height="32" align="absmiddle" />
|
||||
BackgroundMusic-0.4.0.pkg</a> (895 KB)
|
||||
BackgroundMusic-0.4.3.pkg</a> (771 KB)
|
||||
|
||||
> <sub>MD5: 0fc3c839939b1b55b799f3e00755d949</sub><br/>
|
||||
> <sub>SHA256: f170957702c48f96c0fa9706b72f6d6048bcc87be393eb1d01289c20e1111325</sub><br/>
|
||||
> <sub>MD5: 8c3bfe26c9cdf27365b9843f719ef188</sub><br/>
|
||||
> <sub>SHA256: c1c48a37c83af44ce50bee68879856c96b2f6c97360ce461b1c7d653515be7fd</sub><br/>
|
||||
> <sub>PGP:
|
||||
> [sig](https://github.com/kyleneideck/BackgroundMusic/releases/download/v0.4.0/BackgroundMusic-0.4.0.pkg.asc),
|
||||
> [sig](https://github.com/kyleneideck/BackgroundMusic/releases/download/v0.4.3/BackgroundMusic-0.4.3.pkg.asc),
|
||||
> [key (0595DF814E41A6F69334C5E2CAA8D9B8E39EC18C)](https://bearisdriving.com/kyle-neideck.gpg)</sub>
|
||||
|
||||
### Option 2
|
||||
@@ -88,13 +88,6 @@ Install using [Homebrew](https://brew.sh/) by running the following command in *
|
||||
brew install --cask background-music
|
||||
```
|
||||
|
||||
If you want the latest snapshot version, run:
|
||||
|
||||
```bash
|
||||
brew tap homebrew/cask-versions
|
||||
brew install --cask background-music-pre
|
||||
```
|
||||
|
||||
# Run / Configure
|
||||
|
||||
Just run `Applications > Background Music.app`! **Background Music** sets itself as your default output device under
|
||||
|
||||
+7
-1
@@ -21,6 +21,7 @@
|
||||
#
|
||||
# Copyright © 2017-2022 Kyle Neideck
|
||||
# Copyright © 2016, 2017 Takayama Fumihiko
|
||||
# Copyright © 2023 modue sp. z o.o.
|
||||
#
|
||||
# Builds Background Music and packages it into a .pkg file. Call this script with -d to use the
|
||||
# debug build configuration.
|
||||
@@ -141,7 +142,12 @@ fi
|
||||
echo "Compiling ListInputDevices"
|
||||
|
||||
if ! [[ $packaging_operation == "repackage" ]]; then
|
||||
swiftc pkg/ListInputDevices.swift -o pkg/ListInputDevices
|
||||
echo "Compiling ListInputDevices"
|
||||
swiftc pkg/ListInputDevices.swift -o pkg/ListInputDevices-x86_64 -target x86_64-apple-macos13.0
|
||||
swiftc pkg/ListInputDevices.swift -o pkg/ListInputDevices-arm64 -target arm64-apple-macos13.0
|
||||
# Combine the x86_64 and arm64 binaries into a universal binary.
|
||||
lipo -create pkg/ListInputDevices-x86_64 pkg/ListInputDevices-arm64 -output pkg/ListInputDevices
|
||||
rm pkg/ListInputDevices-x86_64 pkg/ListInputDevices-arm64
|
||||
fi
|
||||
|
||||
# --------------------------------------------------
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<volume-check>
|
||||
<allowed-os-versions>
|
||||
<!-- TODO: Get this from the Xcode project files instead of hardcoding it. -->
|
||||
<os-version min="10.9" />
|
||||
<os-version min="10.13" />
|
||||
</allowed-os-versions>
|
||||
</volume-check>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<pkg-ref id="com.bearisdriving.BGM"/>
|
||||
|
||||
<options customize="never" require-scripts="false" />
|
||||
<options customize="never" require-scripts="false" hostArchitectures="arm64,x86_64" />
|
||||
|
||||
<choices-outline>
|
||||
<line choice="default">
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
# postinstall
|
||||
#
|
||||
# Copyright © 2017-2022, 2024 Kyle Neideck
|
||||
# Copyright © 2023 modue sp. z o.o.
|
||||
#
|
||||
|
||||
# Make sure we use the built-in versions of programs, for consistency. Probably not necessary
|
||||
@@ -31,6 +32,13 @@ function log {
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
function log_output {
|
||||
while read line
|
||||
do
|
||||
log "$line"
|
||||
done < /dev/stdin
|
||||
}
|
||||
|
||||
coreaudiod_plist="/System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist"
|
||||
dest_volume="$3"
|
||||
xpc_helper_install_path="$(bash safe_install_dir.sh -y)"
|
||||
@@ -44,6 +52,17 @@ log "Installing BGMXPCHelper to $xpc_helper_install_path"
|
||||
rm -rf "${xpc_helper_install_path}/BGMXPCHelper.xpc"
|
||||
cp -Rf "BGMXPCHelper.xpc" "$xpc_helper_install_path"
|
||||
|
||||
# Remove the quarantine attribute from BGMXPCHelper. Since macOS 14.0, this is needed to keep
|
||||
# Gatekeeper from trying to show a permission prompt when BGMXPCHelper is launched. That would
|
||||
# fail because BGMXPCHelper is a daemon, and Gatekeeper would prevent it from launching.
|
||||
#
|
||||
# TODO: I think, ideally, we should use the new Service Management API to install BGMXPCHelper,
|
||||
# which would probably avoid this issue. See
|
||||
# <https://developer.apple.com/documentation/servicemanagement/updating_your_app_package_installer_to_use_the_new_service_management_api>.
|
||||
log "Removing com.apple.quarantine attribute from BGMXPCHelper."
|
||||
sudo xattr -dr com.apple.quarantine "${xpc_helper_install_path}/BGMXPCHelper.xpc" 2>&1 | log_output
|
||||
ls -lah@ "${xpc_helper_install_path}/BGMXPCHelper.xpc" 2>&1 | log_output
|
||||
|
||||
# TODO: Fail the install and show an error message if this fails.
|
||||
bash "post_install.sh" "$xpc_helper_install_path" "BGMXPCHelper.xpc/Contents/MacOS/BGMXPCHelper" "."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user