Never show warning dialog box in command-line pkg installs.

Also,
 - add Background Music Device.driver to the array of bundles in
   pkgbuild.plist, and
 - don't warn about the permissions of the install dir for BGMXPCHelper
   in build_and_install.sh if it's only building.
This commit is contained in:
Kyle Neideck
2017-06-13 23:18:10 +10:00
parent 45519a4d52
commit d322c3ac9b
3 changed files with 28 additions and 13 deletions
+4 -2
View File
@@ -123,7 +123,6 @@ APP_PATH="/Applications"
APP_DIR="Background Music.app"
DRIVER_PATH="/Library/Audio/Plug-Ins/HAL"
DRIVER_DIR="Background Music Device.driver"
XPC_HELPER_PATH="$(BGMApp/BGMXPCHelper/safe_install_dir.sh)"
XPC_HELPER_DIR="BGMXPCHelper.xpc"
GENERAL_ERROR_MSG="Internal script error. Probably a bug in this script."
@@ -252,7 +251,6 @@ parse_options() {
# The dirs xcodebuild will build in.
APP_PATH="./BGMApp/build"
DRIVER_PATH="./BGMDriver/build"
XPC_HELPER_PATH="${APP_PATH}"
;;
w)
# TODO: What if they also pass their own OTHER_CFLAGS with -x?
@@ -540,6 +538,8 @@ fi
# Print initial message.
if [[ "${XCODEBUILD_ACTION}" == "install" ]]; then
XPC_HELPER_PATH="$(BGMApp/BGMXPCHelper/safe_install_dir.sh)"
echo "$(bold_face About to install Background Music). Please pause all audio, if you can."
[[ "${CONFIGURATION}" == "Debug" ]] && echo "Debug build."
echo
@@ -550,6 +550,8 @@ if [[ "${XCODEBUILD_ACTION}" == "install" ]]; then
echo " - /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist"
echo
elif [[ "${XCODEBUILD_ACTION}" == "build" ]]; then
XPC_HELPER_PATH="${APP_PATH}"
echo "$(bold_face Building Background Music...)"
echo
fi
+7
View File
@@ -5,6 +5,13 @@
<dict>
<key>RootRelativeBundlePath</key> <string>Applications/Background Music.app</string>
<key>BundleHasStrictIdentifier</key> <false/>
<key>BundleIsRelocatable</key> <true/>
<key>BundleIsVersionChecked</key> <false/>
<key>BundleOverwriteAction</key> <string>upgrade</string>
</dict>
<dict>
<key>RootRelativeBundlePath</key> <string>Library/Audio/Plug-Ins/HAL/Background Music Device.driver</string>
<key>BundleHasStrictIdentifier</key> <false/>
<key>BundleIsRelocatable</key> <false/>
<key>BundleIsVersionChecked</key> <false/>
<key>BundleOverwriteAction</key> <string>upgrade</string>
+17 -11
View File
@@ -35,18 +35,24 @@ if [ "$(bash safe_install_dir.sh "$xpc_helper_path")" != "1" ]; then
msg+="group 'wheel', and have permissions 755 (rwxr-xr-x).\n\n"
msg+="Background Music will still work if you decide to continue."
if ! osascript <<EOT
tell application id "com.apple.systemuiserver"
display alert "Warning" \
message "$msg" \
buttons {"Cancel", "Install Anyway"} \
default button "Cancel" \
cancel button "Cancel" \
as warning
end tell
EOT
then
if [ "$COMMAND_LINE_INSTALL" == "1" ]; then
# As far as I can tell, we can't print anything the user is likely to see.
logger "WARNING: $msg"
exit 1
else
if ! osascript <<EOT
tell application id "com.apple.systemuiserver"
display alert "Warning" \
message "$msg" \
buttons {"Cancel", "Install Anyway"} \
default button "Cancel" \
cancel button "Cancel" \
as warning
end tell
EOT
then
exit 1
fi
fi
fi