-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·43 lines (34 loc) · 1.51 KB
/
install.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Build iQualize and install to /Applications
set -e
cd "$(dirname "$0")"
echo "Building iQualize..."
swift build -c release 2>&1 | tail -5
APP=/Applications/iQualize.app
BIN="$APP/Contents/MacOS/iQualize"
SRC="$(swift build -c release --show-bin-path)/iQualize"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
# Only replace binary if it actually changed — preserves TCC permissions (cdhash stays the same)
if [ -f "$BIN" ] && cmp -s "$SRC" "$BIN"; then
echo "Binary unchanged — skipping copy (TCC permissions preserved)"
else
cp -f "$SRC" "$BIN"
# Codesign with stable identity
SIGN_ID="Apple Development"
if [ -n "$SIGN_ID" ]; then
codesign --force --sign "$SIGN_ID" --entitlements iQualize.entitlements "$APP" 2>/dev/null && echo "Signed with: $SIGN_ID"
fi
echo "Binary updated"
fi
# Copy app icon
cp -f Sources/iQualize/AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
# Always update Info.plist — then re-sign if it changed (plist change invalidates signature)
if ! cmp -s Sources/iQualize/Info.plist "$APP/Contents/Info.plist"; then
cp -f Sources/iQualize/Info.plist "$APP/Contents/Info.plist"
codesign --force --sign "Apple Development" --entitlements iQualize.entitlements "$APP" 2>/dev/null && echo "Re-signed (Info.plist changed)"
else
cp -f Sources/iQualize/Info.plist "$APP/Contents/Info.plist"
fi
# Strip provenance xattr to prevent macOS security policy launch blocks
xattr -rc "$APP" 2>/dev/null
echo "Installed to /Applications/iQualize.app"