Skip to content

Commit 0002da4

Browse files
committed
Create macOS desktop alias in installer
1 parent 3b1b5bb commit 0002da4

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

install.sh

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
APP_DIR="$(cd "$(dirname "$0")" && pwd)"
66
LAUNCHER="$APP_DIR/AI_Deck_Reconstructor.command"
77
DESKTOP_LINK="$HOME/Desktop/AI Deck Reconstructor.command"
8+
DESKTOP_ALIAS="$HOME/Desktop/AI Deck Reconstructor"
89

910
echo ""
1011
echo "AI Deck Reconstructor — Installer"
@@ -54,15 +55,32 @@ else
5455
fi
5556

5657
chmod +x "$LAUNCHER"
57-
ln -sf "$LAUNCHER" "$DESKTOP_LINK"
58+
59+
if [[ "$(uname)" == "Darwin" ]]; then
60+
rm -f "$DESKTOP_LINK"
61+
rm -f "$DESKTOP_ALIAS"
62+
63+
osascript <<APPLESCRIPT
64+
tell application "Finder"
65+
set targetFile to POSIX file "$LAUNCHER" as alias
66+
set desktopFolder to POSIX file "$HOME/Desktop" as alias
67+
make new alias file at desktopFolder to targetFile with properties {name:"AI Deck Reconstructor"}
68+
end tell
69+
APPLESCRIPT
70+
71+
DESKTOP_SHORTCUT="$DESKTOP_ALIAS"
72+
else
73+
ln -sf "$LAUNCHER" "$DESKTOP_LINK"
74+
DESKTOP_SHORTCUT="$DESKTOP_LINK"
75+
fi
5876

5977
echo ""
6078
echo "=================================="
6179
echo "✅ Installation complete"
6280
echo "=================================="
6381
echo ""
6482
echo "Desktop shortcut created:"
65-
echo "$DESKTOP_LINK"
83+
echo "$DESKTOP_SHORTCUT"
6684
echo ""
6785
echo "NDLOCR-Lite is required for OCR."
6886
echo "Recommended local layout:"
@@ -74,6 +92,6 @@ echo ""
7492
echo "If NDLOCR-Lite is placed at ../ndlocr-lite, the launcher will try to install it into the virtual environment automatically."
7593
echo ""
7694
echo "You can now double-click:"
77-
echo "AI Deck Reconstructor.command"
95+
echo "$(basename "$DESKTOP_SHORTCUT")"
7896
echo ""
7997
read -p "Press Enter to close..."

0 commit comments

Comments
 (0)