-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_dmg.sh
More file actions
executable file
·57 lines (45 loc) · 1.3 KB
/
create_dmg.sh
File metadata and controls
executable file
·57 lines (45 loc) · 1.3 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Script to create a DMG installer for RVC-MacOS
# This creates a distributable disk image for easy installation
set -e
APP_NAME="RVC-MacOS"
DMG_NAME="${APP_NAME}-Installer"
VERSION="1.0.0"
APP_PATH="dist/${APP_NAME}.app"
DMG_PATH="dist/${DMG_NAME}.dmg"
VOLUME_NAME="${APP_NAME} ${VERSION}"
echo "Creating DMG installer for ${APP_NAME}..."
# Check if app bundle exists
if [ ! -d "$APP_PATH" ]; then
echo "Error: Application bundle not found at $APP_PATH"
echo "Please run ./build_app.sh first"
exit 1
fi
# Remove old DMG if it exists
if [ -f "$DMG_PATH" ]; then
echo "Removing old DMG..."
rm "$DMG_PATH"
fi
# Create temporary directory for DMG contents
DMG_TEMP="dist/dmg_temp"
rm -rf "$DMG_TEMP"
mkdir -p "$DMG_TEMP"
# Copy app to temp directory
echo "Copying application bundle..."
cp -R "$APP_PATH" "$DMG_TEMP/"
# Create symbolic link to Applications folder
echo "Creating Applications symlink..."
ln -s /Applications "$DMG_TEMP/Applications"
# Create DMG
echo "Creating disk image..."
hdiutil create -volname "$VOLUME_NAME" \
-srcfolder "$DMG_TEMP" \
-ov -format UDZO \
"$DMG_PATH"
# Clean up temp directory
rm -rf "$DMG_TEMP"
echo ""
echo "DMG created successfully!"
echo "Location: $DMG_PATH"
echo ""
echo "To install, open the DMG and drag ${APP_NAME}.app to Applications"