I have two builds of an application that I'm building into a .pkg for distribution using WhiteBox "packages".
The first one works fine but the second one doesn't. There are basically two difference between them - the second version is packaged with eight audio files, and a third-party tool.
The first one installs fine and I have no problems with permissions on an M1 Mac, the second one does not have microphone permissions, but it does have file permissions. I tried different variations of the following script:
# Set the path to the app
app_path="Applications/[my app name].app"
# Check if the user is running the script as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root or with sudo"
exit
fi
# Generate audio permissions for the app
sudo tccutil reset Microphone "[my.bundle.identifier]"
sudo xattr -r -d com.apple.quarantine " /Applications/[my app name].app"
sudo xattr -rc /Applications/[my app name].app
exit 0
where each individual sudo command was tested independently, then different combinations of them were all tested but none work. The app will also not appear in the 'security' section of 'system preferences'. The app does work when I package it in a .dmg, with the installer:
clear
echo -e "\033[0;31m"Installer is running ...
mv /Volumes/[installer name]/[my app name].app /Applications/[my app name].app;
open /Volumes/[my app name]/disclaimer.png
(sleep 1 && xattr -rc /Applications/[my app name].app;)
echo -e "Installation is finished... Enjoy [my app name]"
(Sleep 2)
killall Terminal
So I realised that the script is the problem, but I'm not really sure why one works and the other doesn't. I tried directly running the installer as a .sh file in the 'packages' build but it didn't work either.
I was wondering if anyone knew anything? Thanks!
I was expecting to give permissions to the use of audio by my application, but this didn't work