Skip to content

Commit 5cf9833

Browse files
committed
Add macOS DMG build system for Retroworks RCBus
- Introduced `Info.plist.template` for app bundle metadata. - Created `README.md` detailing the DMG build process and requirements. - Implemented `build-dmg.sh` script for building the DMG installer. - Added `build-universal.sh` to build DMGs for both ARM64 and x64 architectures. - Developed `create-background.sh` for generating a DMG background image. - Added `test-setup.sh` to verify the DMG build system setup and requirements.
1 parent eda7810 commit 5cf9833

10 files changed

Lines changed: 671 additions & 2 deletions

File tree

.gitignore

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ bld/
3333
[Ll]og/
3434
[Ll]ogs/
3535

36+
# .NET Core build outputs
37+
publish/
38+
PublishProfiles/
39+
40+
# Additional .NET binary file patterns
41+
*.dll
42+
*.exe
43+
*.pdb
44+
*.lib
45+
*.a
46+
*.so
47+
*.dylib
48+
49+
# .NET specific build artifacts
50+
*.deps.json
51+
*.runtimeconfig.json
52+
*.runtimeconfig.dev.json
53+
3654
# Visual Studio 2015/2017 cache/options directory
3755
.vs/
3856
# Uncomment if you have tasks that create the project's static files in wwwroot
@@ -360,4 +378,40 @@ MigrationBackup/
360378
.ionide/
361379

362380
# Fody - auto-generated XML schema
363-
FodyWeavers.xsd
381+
FodyWeavers.xsd
382+
383+
# macOS DMG Build System
384+
Retroworks.RCBus.MacOS/build/
385+
Retroworks.RCBus.MacOS/dmg/
386+
Retroworks.RCBus.MacOS/dist/
387+
# Ignore dmg folders that might be created in wrong locations
388+
**/dmg/
389+
*.dmg
390+
*.pkg
391+
392+
# macOS system files
393+
.DS_Store
394+
.AppleDouble
395+
.LSOverride
396+
397+
# Icon must end with two \r
398+
Icon
399+
400+
# Thumbnails
401+
._*
402+
403+
# Files that might appear in the root of a volume
404+
.DocumentRevisions-V100
405+
.fseventsd
406+
.Spotlight-V100
407+
.TemporaryItems
408+
.Trashes
409+
.VolumeIcon.icns
410+
.com.apple.timemachine.donotpresent
411+
412+
# Directories potentially created on remote AFP share
413+
.AppleDB
414+
.AppleDesktop
415+
Network Trash Folder
416+
Temporary Items
417+
.apdisk

.vscode/tasks.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,63 @@
1414
"isDefault": true
1515
},
1616
"problemMatcher": "$msCompile"
17+
},
18+
{
19+
"label": "build-dmg-arm64",
20+
"type": "shell",
21+
"command": "${workspaceFolder}/Retroworks.RCBus.MacOS/build-dmg.sh",
22+
"args": ["arm64"],
23+
"group": "build",
24+
"options": {
25+
"cwd": "${workspaceFolder}/Retroworks.RCBus.MacOS"
26+
},
27+
"presentation": {
28+
"echo": true,
29+
"reveal": "always",
30+
"focus": false,
31+
"panel": "shared",
32+
"showReuseMessage": true,
33+
"clear": false
34+
},
35+
"problemMatcher": [],
36+
"dependsOn": "build"
37+
},
38+
{
39+
"label": "build-dmg-x64",
40+
"type": "shell",
41+
"command": "${workspaceFolder}/Retroworks.RCBus.MacOS/build-dmg.sh",
42+
"args": ["x64"],
43+
"group": "build",
44+
"options": {
45+
"cwd": "${workspaceFolder}/Retroworks.RCBus.MacOS"
46+
},
47+
"presentation": {
48+
"echo": true,
49+
"reveal": "always",
50+
"focus": false,
51+
"panel": "shared",
52+
"showReuseMessage": true,
53+
"clear": false
54+
},
55+
"problemMatcher": [],
56+
"dependsOn": "build"
57+
},
58+
{
59+
"label": "build-dmg",
60+
"dependsOrder": "sequence",
61+
"dependsOn": [
62+
"build-dmg-arm64",
63+
"build-dmg-x64"
64+
],
65+
"group": "build",
66+
"presentation": {
67+
"echo": true,
68+
"reveal": "always",
69+
"focus": false,
70+
"panel": "shared",
71+
"showReuseMessage": true,
72+
"clear": false
73+
}
1774
}
1875
]
1976
}
9.91 KB
Loading
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDisplayName</key>
6+
<string>Retroworks RCBus</string>
7+
<key>CFBundleExecutable</key>
8+
<string>Retroworks.RCBus</string>
9+
<key>CFBundleIconFile</key>
10+
<string>icon.png</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>com.capnode.retroworks.rcbus</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>Retroworks RCBus</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>0.1.0</string>
21+
<key>CFBundleVersion</key>
22+
<string>0.1.0</string>
23+
<key>LSMinimumSystemVersion</key>
24+
<string>10.15</string>
25+
<key>NSHighResolutionCapable</key>
26+
<true/>
27+
<key>NSHumanReadableCopyright</key>
28+
<string>© 2025 Capnode AB</string>
29+
<key>NSPrincipalClass</key>
30+
<string>NSApplication</string>
31+
<key>LSApplicationCategoryType</key>
32+
<string>public.app-category.developer-tools</string>
33+
<key>NSAppTransportSecurity</key>
34+
<dict>
35+
<key>NSAllowsArbitraryLoads</key>
36+
<true/>
37+
</dict>
38+
<key>NSAppleEventsUsageDescription</key>
39+
<string>Retroworks RCBus needs access to Apple Events for automation features.</string>
40+
<key>NSDesktopFolderUsageDescription</key>
41+
<string>Retroworks RCBus may need to access the Desktop folder for saving files.</string>
42+
<key>NSDocumentsFolderUsageDescription</key>
43+
<string>Retroworks RCBus may need to access the Documents folder for saving files.</string>
44+
<key>NSDownloadsFolderUsageDescription</key>
45+
<string>Retroworks RCBus may need to access the Downloads folder for loading files.</string>
46+
<key>CFBundleDocumentTypes</key>
47+
<array>
48+
<dict>
49+
<key>CFBundleTypeDescription</key>
50+
<string>Binary File</string>
51+
<key>CFBundleTypeExtensions</key>
52+
<array>
53+
<string>bin</string>
54+
<string>hex</string>
55+
<string>rom</string>
56+
</array>
57+
<key>CFBundleTypeName</key>
58+
<string>Binary File</string>
59+
<key>CFBundleTypeRole</key>
60+
<string>Editor</string>
61+
<key>LSTypeIsPackage</key>
62+
<false/>
63+
</dict>
64+
</array>
65+
<key>UTExportedTypeDeclarations</key>
66+
<array>
67+
<dict>
68+
<key>UTTypeConformsTo</key>
69+
<array>
70+
<string>public.data</string>
71+
</array>
72+
<key>UTTypeDescription</key>
73+
<string>ROM Binary File</string>
74+
<key>UTTypeIdentifier</key>
75+
<string>com.capnode.retroworks.rom</string>
76+
<key>UTTypeTagSpecification</key>
77+
<dict>
78+
<key>public.filename-extension</key>
79+
<array>
80+
<string>rom</string>
81+
</array>
82+
</dict>
83+
</dict>
84+
</array>
85+
</dict>
86+
</plist>

Retroworks.RCBus.MacOS/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Retroworks RCBus - macOS DMG Installer
2+
3+
This folder contains the macOS DMG installer build system for Retroworks RCBus.
4+
5+
## Contents
6+
7+
- `build-dmg.sh` - Main script to build the DMG installer
8+
- `create-background.sh` - Script to create/update the DMG background image
9+
- `Info.plist.template` - Template for the macOS app bundle Info.plist
10+
- `Assets/` - Assets for DMG packaging including background image
11+
12+
## Requirements
13+
14+
- macOS 10.15 or later
15+
- .NET 9.0 SDK
16+
- Xcode Command Line Tools (`xcode-select --install`)
17+
18+
## Building the DMG
19+
20+
1. Ensure you have the .NET 9.0 SDK installed
21+
2. Run the build script:
22+
```bash
23+
./build-dmg.sh
24+
```
25+
26+
The script will:
27+
1. Build the .NET application for the current macOS architecture
28+
2. Create a proper macOS app bundle
29+
3. Package everything into a DMG file with proper layout
30+
4. Output the DMG to the `dist/` folder
31+
32+
## Output
33+
34+
The DMG will be created as:
35+
- `dist/Retroworks-RCBus-{version}-{architecture}.dmg`
36+
37+
Where:
38+
- `{version}` is the version from the project file (e.g., 0.1.0)
39+
- `{architecture}` is either `osx-x64` or `osx-arm64`
40+
41+
## Customization
42+
43+
### Background Image
44+
- Replace `Assets/dmg-background.png` with your custom background (recommended size: 640x380)
45+
- Or modify `create-background.sh` to generate a custom background
46+
47+
### App Bundle Info
48+
- Edit `Info.plist.template` to customize app bundle metadata
49+
- The build script will automatically substitute version information
50+
51+
### Code Signing
52+
Uncomment the code signing section in `build-dmg.sh` if you have a valid Apple Developer certificate.
53+
54+
## Notes
55+
56+
- The app bundle includes entitlements for serial port and USB device access
57+
- The DMG includes an Applications folder shortcut for easy installation
58+
- The script automatically detects the current architecture (Intel or Apple Silicon)
59+
60+
## Troubleshooting
61+
62+
### Build Fails
63+
- Ensure .NET 9.0 SDK is installed: `dotnet --version`
64+
- Check that all dependencies are available
65+
66+
### DMG Creation Fails
67+
- Ensure you have sufficient disk space
68+
- Try running with `sudo` if permission errors occur
69+
- Verify Xcode Command Line Tools are installed

0 commit comments

Comments
 (0)