contrib: utilities for releasing a macOS application in a dmg

This was mostly inspired by (or outright stolen from) the Bitcoin Core
project. I think most contributions in this area were Michael Ford's
(fanquake), so credits to him.

This is everything that needs to be present in a dmg in order to have a
nice fancy installation drag-and-drop screen. Configuration contains
dummy values to be replaced with specifics at release time.
This commit is contained in:
Antoine Poinsot 2022-12-18 10:04:57 +01:00
parent aecb063a87
commit e7f43492f9
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304
4 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>LSMinimumSystemVersion</key>
<string>10.15.0</string>
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
</array>
<!-- TODO -->
<!--<key>CFBundleIconFile</key>-->
<!--<string></string>-->
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleShortVersionString</key>
<string>VERSION_PLACEHOLDER</string>
<key>CFBundleVersion</key>
<string>VERSION_PLACEHOLDER</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>Liana</string>
<key>CFBundleName</key>
<string>Liana</string>
<key>LSHasLocalizedDisplayName</key>
<true/>
<key>CFBundleIdentifier</key>
<string>org.wizardsardine.liana</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>org.wizardsardine.liana</string>
<key>CFBundleURLSchemes</key>
<array>
<string>liana</string>
</array>
</dict>
</array>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.finance</string>
</dict>
</plist>

View File

@ -0,0 +1 @@
APPL????

View File

@ -0,0 +1,51 @@
"""
Script to generate a .DS_Store within the dmg folder to have a neat fancy window
when installing the software on macOS.
This was taken and adapted from the Bitcoin Core 'macdeployqtplus' script.
https://github.com/bitcoin/bitcoin/blob/cb32328d1b80d0ccd6eb9532bd8fe4e0a4de385e/contrib/macdeploy/macdeployqtplus
"""
from ds_store import DSStore
from mac_alias import Alias
output_file = ".DS_Store"
ds = DSStore.open(output_file, "w+")
ds["."]["bwsp"] = {
"WindowBounds": "{{300, 280}, {500, 343}}",
"PreviewPaneVisibility": False,
}
icvp = {
"gridOffsetX": 0.0,
"textSize": 12.0,
"viewOptionsVersion": 1,
"backgroundImageAlias": b"\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07bitcoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00",
"backgroundColorBlue": 1.0,
"iconSize": 96.0,
"backgroundColorGreen": 1.0,
"arrangeBy": "none",
"showIconPreview": True,
"gridSpacing": 100.0,
"gridOffsetY": 0.0,
"showItemInfo": False,
"labelOnBottom": True,
"backgroundType": 2,
"backgroundColorRed": 1.0,
}
alias = Alias().from_bytes(icvp["backgroundImageAlias"])
alias.volume.name = "Liana"
alias.volume.posix_path = "/Volumes/Liana"
icvp["backgroundImageAlias"] = alias.to_bytes()
ds["."]["icvp"] = icvp
ds["."]["vSrn"] = ("long", 1)
ds["Applications"]["Iloc"] = (370, 156)
ds["Liana.app"]["Iloc"] = (128, 156)
ds.flush()
ds.close()