bpo-39580: add check for CLI installation on macOS (GH-20271)
Adds a simple check for whether or not the package is being installed in the GUI or using installer on the command line. This addresses an issue where CLI-based software management tools (such as Munki) unexpectedly open Finder windows into a GUI session during installation runs.
diff --git a/Mac/BuildScript/scripts/postflight.documentation b/Mac/BuildScript/scripts/postflight.documentation
index 3cbbc1b..ec48599 100755
--- a/Mac/BuildScript/scripts/postflight.documentation
+++ b/Mac/BuildScript/scripts/postflight.documentation
@@ -12,7 +12,9 @@
# make link in /Applications/Python m.n/ for Finder users
if [ -d "${APPDIR}" ]; then
ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
- open "${APPDIR}" || true # open the applications folder
+ if [ "${COMMAND_LINE_INSTALL}" != 1 ]; then
+ open "${APPDIR}" || true # open the applications folder
+ fi
fi
# make share/doc link in framework for command line users