Skip to content

Commit ee2827c

Browse files
VinDuvmarcan
authored andcommitted
Installer: Check macOS version in bootstrap script
On early macOS 11 versions (for instance 11.0.1), the `arch -arm64 ls` command fails (“Bad CPU type in executable” error), and the Python script cannot start in recoveryOS because the Python binary is not signed by Apple. To avoid these issues, add an early version check (version >= 12) in the bootstrap script. Fixes issue #114. Signed-off-by: Vincent Duvert <[email protected]>
1 parent 51346e8 commit ee2827c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ export SSL_CERT_FILE=$PWD/Frameworks/Python.framework/Versions/Current/etc/opens
1818
# so do it again for good measure.
1919
export PATH="$PWD/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
2020

21+
22+
set +e
23+
macos_ver=$(/usr/libexec/PlistBuddy -c "Print :ProductVersion" \
24+
/System/Library/CoreServices/SystemVersion.plist)
25+
res=$?
26+
set -e
27+
28+
if [ "$res" -ne 0 ] || [ -z "$macos_ver" ]; then
29+
echo "Unable to determine macOS version. Please report a bug."
30+
exit 1
31+
fi
32+
33+
if [ "${macos_ver%%.*}" -lt 12 ]; then
34+
echo "This installer requires macOS 12.3 or later."
35+
exit 1
36+
fi
37+
2138
if ! arch -arm64 ls >/dev/null 2>/dev/null; then
2239
echo
2340
echo "Looks like this is an Intel Mac!"

0 commit comments

Comments
 (0)