Can‘t set DMG file .VolumeIcon.icns
In gradle plugin org.jetbrains.compose:1.0.1,when invoke comand jpackage, lacks the parameter --icon
At AbstractJPackageTask
if (targetFormat != TargetFormat.AppImage) { XXXXXX }
You can see jpackage parameters result in file: build/compose/tmp/packageDmg.args.txt
--app-image "/Users/xxx/Projects/Compose/XXXX/build/compose/binaries/main/app" --resource-dir "/Users/xxx/Projects/Compose/XXXX/build/compose/tmp/resources" --type "dmg" --dest "/Users/xxx/Projects/Compose/XXXX/build/compose/binaries/main/dmg" --name "XXXX" --description "XXXX" --copyright "©2022 XX" --app-version "1.0.0" --vendor "XXX" --mac-package-name "XXXImporter" --mac-package-identifier "com.xx.devops.xxx"
+1
The (disgusting) but solid workaround that I found is to patch it up myself with a nasty bash script, something among the lines of this:
#Creates a .dmg we can write to
hdiutil convert -format UDRW -o rw_your_app.dmg "./build/compose/binaries/main/dmg/your_app-1.0.0.dmg"
# Changes the .dmg file icon
cp ./src/main/resources/app_icon.icns icon.icns
sips -i ./icon.icns
DeRez -only icns ./icon.icns > icns.rsrc
Rez -append icns.rsrc -o rw_your_app.dmg
SetFile -a C rw_your_app.dmg
# Changes the volume icon
hdiutil attach rw_your_app.dmg
sudo cp ./src/main/resources/app_icon.icns '/Volumes/your_app/.VolumeIcon.icns'
SetFile -a C '/Volumes/your_app/'
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.