Skip to content

Commit 4aff2a3

Browse files
committed
Installer: extract Install & Launch.command + README.txt to installer/
Both build_macos.sh and CI now cp these files unchanged into the DMG. Byte-identical contents across local and CI builds means macOS keeps its Gatekeeper 'Open Anyway' approval cached across rebuilds — users won't see the 'Apple could not verify' warning again after the first time they approve.
1 parent bc22286 commit 4aff2a3

4 files changed

Lines changed: 76 additions & 114 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -39,64 +39,19 @@ jobs:
3939
main.py
4040
4141
- name: Stage DMG contents
42-
# Matches the local build_macos.sh layout: ship the .app alongside
43-
# an installer script that strips the Gatekeeper quarantine flag
44-
# and copies the app to /Applications, plus a short README so
45-
# first-time users know which file to double-click.
42+
# Mirror build_macos.sh exactly. Pull the installer script and
43+
# README from installer/ in the repo so the bytes are identical
44+
# whether you build locally or via CI — that preserves macOS's
45+
# content-hash Gatekeeper "Open Anyway" approval across rebuilds.
4646
run: |
4747
xattr -cr "dist/S1 Command Center.app"
4848
DMG_STAGE="dist/dmg_stage"
4949
rm -rf "$DMG_STAGE"
5050
mkdir -p "$DMG_STAGE"
5151
cp -R "dist/S1 Command Center.app" "$DMG_STAGE/"
52-
53-
cat > "$DMG_STAGE/Install & Launch.command" << 'SCRIPT'
54-
#!/bin/bash
55-
# S1 Command Center — macOS Setup
56-
# Removes the quarantine flag and launches the app.
57-
# Run this ONCE after downloading. After that, open the app
58-
# normally from /Applications.
59-
clear
60-
echo ""
61-
echo "═══════════════════════════════════════════════════"
62-
echo " 🛡️ S1 Command Center — Setup"
63-
echo "═══════════════════════════════════════════════════"
64-
echo ""
65-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
66-
APP_PATH="$SCRIPT_DIR/S1 Command Center.app"
67-
DEST="/Applications/S1 Command Center.app"
68-
if [ ! -d "$APP_PATH" ]; then
69-
echo "❌ Could not find 'S1 Command Center.app' next to this script."
70-
read -p "Press Enter to close..." _
71-
exit 1
72-
fi
73-
echo "📦 Copying to /Applications..."
74-
cp -R "$APP_PATH" "/Applications/" 2>/dev/null || sudo cp -R "$APP_PATH" "/Applications/"
75-
echo "🔓 Removing macOS quarantine flag..."
76-
xattr -cr "$DEST" 2>/dev/null
77-
sudo xattr -cr "$DEST" 2>/dev/null
78-
echo "🚀 Launching S1 Command Center..."
79-
echo ""
80-
echo "═══════════════════════════════════════════════════"
81-
echo " ✅ Setup complete! The app is now in /Applications."
82-
echo "═══════════════════════════════════════════════════"
83-
open "$DEST"
84-
sleep 2
85-
SCRIPT
52+
cp "installer/Install & Launch.command" "$DMG_STAGE/Install & Launch.command"
8653
chmod +x "$DMG_STAGE/Install & Launch.command"
87-
88-
cat > "$DMG_STAGE/README.txt" << 'README'
89-
S1 Command Center — Installation
90-
=================================
91-
92-
Double-click "Install & Launch.command" to:
93-
1. Copy the app to /Applications
94-
2. Remove the macOS quarantine flag
95-
3. Launch the app
96-
97-
After the first run, open the app normally from
98-
/Applications or Spotlight.
99-
README
54+
cp "installer/README.txt" "$DMG_STAGE/README.txt"
10055
10156
- name: Create DMG
10257
run: |

build_macos.sh

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -56,70 +56,13 @@ rm -rf "$DMG_STAGE"
5656
mkdir -p "$DMG_STAGE"
5757
cp -R "dist/S1 Command Center.app" "$DMG_STAGE/"
5858

59-
# create the installer script that removes quarantine + launches
60-
cat > "$DMG_STAGE/Install & Launch.command" << 'SCRIPT'
61-
#!/bin/bash
62-
# ─────────────────────────────────────────────────────
63-
# S1 Command Center — macOS Setup
64-
# Removes quarantine flag and launches the app.
65-
# Run this ONCE after downloading. After that, open
66-
# the app normally from /Applications.
67-
# ─────────────────────────────────────────────────────
68-
clear
69-
echo ""
70-
echo "═══════════════════════════════════════════════════"
71-
echo " 🛡️ S1 Command Center — Setup"
72-
echo "═══════════════════════════════════════════════════"
73-
echo ""
74-
75-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
76-
APP_PATH="$SCRIPT_DIR/S1 Command Center.app"
77-
DEST="/Applications/S1 Command Center.app"
78-
79-
if [ ! -d "$APP_PATH" ]; then
80-
echo "❌ Could not find 'S1 Command Center.app' next to this script."
81-
echo " Make sure both files are in the same folder."
82-
echo ""
83-
read -p "Press Enter to close..." _
84-
exit 1
85-
fi
86-
87-
echo "📦 Copying to /Applications..."
88-
cp -R "$APP_PATH" "/Applications/" 2>/dev/null || {
89-
echo "⚠️ Need admin permission to copy to /Applications."
90-
sudo cp -R "$APP_PATH" "/Applications/"
91-
}
92-
93-
echo "🔓 Removing macOS quarantine flag..."
94-
xattr -cr "$DEST" 2>/dev/null
95-
sudo xattr -cr "$DEST" 2>/dev/null
96-
97-
echo "🚀 Launching S1 Command Center..."
98-
echo ""
99-
echo "═══════════════════════════════════════════════════"
100-
echo " ✅ Setup complete! The app is now in /Applications."
101-
echo " You can open it normally from now on."
102-
echo "═══════════════════════════════════════════════════"
103-
echo ""
104-
105-
open "$DEST"
106-
sleep 2
107-
SCRIPT
59+
# Copy the installer script + README from the canonical source files.
60+
# Keeping them in installer/ on disk means both this script and CI get
61+
# byte-for-byte identical contents — important so macOS's content-hash
62+
# Gatekeeper approval ("Open Anyway") stays valid across rebuilds.
63+
cp "installer/Install & Launch.command" "$DMG_STAGE/Install & Launch.command"
10864
chmod +x "$DMG_STAGE/Install & Launch.command"
109-
110-
# create a README in the DMG
111-
cat > "$DMG_STAGE/README.txt" << 'README'
112-
S1 Command Center — Installation
113-
═════════════════════════════════
114-
115-
Double-click "Install & Launch.command" to:
116-
1. Copy the app to /Applications
117-
2. Remove the macOS quarantine flag
118-
3. Launch the app
119-
120-
After the first run, open the app normally
121-
from /Applications or Spotlight.
122-
README
65+
cp "installer/README.txt" "$DMG_STAGE/README.txt"
12366

12467
# create DMG
12568
echo "Creating DMG installer..."

installer/Install & Launch.command

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# ─────────────────────────────────────────────────────
3+
# S1 Command Center — macOS Setup
4+
# Removes quarantine flag and launches the app.
5+
# Run this ONCE after downloading. After that, open
6+
# the app normally from /Applications.
7+
# ─────────────────────────────────────────────────────
8+
clear
9+
echo ""
10+
echo "═══════════════════════════════════════════════════"
11+
echo " 🛡️ S1 Command Center — Setup"
12+
echo "═══════════════════════════════════════════════════"
13+
echo ""
14+
15+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
16+
APP_PATH="$SCRIPT_DIR/S1 Command Center.app"
17+
DEST="/Applications/S1 Command Center.app"
18+
19+
if [ ! -d "$APP_PATH" ]; then
20+
echo "❌ Could not find 'S1 Command Center.app' next to this script."
21+
echo " Make sure both files are in the same folder."
22+
echo ""
23+
read -p "Press Enter to close..." _
24+
exit 1
25+
fi
26+
27+
echo "📦 Copying to /Applications..."
28+
cp -R "$APP_PATH" "/Applications/" 2>/dev/null || {
29+
echo "⚠️ Need admin permission to copy to /Applications."
30+
sudo cp -R "$APP_PATH" "/Applications/"
31+
}
32+
33+
echo "🔓 Removing macOS quarantine flag..."
34+
xattr -cr "$DEST" 2>/dev/null
35+
sudo xattr -cr "$DEST" 2>/dev/null
36+
37+
echo "🚀 Launching S1 Command Center..."
38+
echo ""
39+
echo "═══════════════════════════════════════════════════"
40+
echo " ✅ Setup complete! The app is now in /Applications."
41+
echo " You can open it normally from now on."
42+
echo "═══════════════════════════════════════════════════"
43+
echo ""
44+
45+
open "$DEST"
46+
sleep 2

installer/README.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
S1 Command Center — Installation
2+
═════════════════════════════════
3+
4+
Double-click "Install & Launch.command" to:
5+
1. Copy the app to /Applications
6+
2. Remove the macOS quarantine flag
7+
3. Launch the app
8+
9+
After the first run, open the app normally
10+
from /Applications or Spotlight.
11+
12+
────────────────────────────────────────────
13+
If macOS shows "Apple could not verify":
14+
→ Right-click "Install & Launch.command"
15+
→ Choose "Open"
16+
→ Click "Open" on the dialog
17+
→ Done — macOS remembers this approval.
18+
────────────────────────────────────────────

0 commit comments

Comments
 (0)