compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Can‘t set DMG file .VolumeIcon.icns

Open huiyh opened this issue 3 years ago • 3 comments

In gradle plugin org.jetbrains.compose:1.0.1,when invoke comand jpackage, lacks the parameter --icon

At AbstractJPackageTask

if (targetFormat != TargetFormat.AppImage) { XXXXXX }

huiyh avatar Apr 28 '22 12:04 huiyh

You can see jpackage parameters result in file: build/compose/tmp/packageDmg.args.txt

huiyh avatar Apr 28 '22 12:04 huiyh

--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"

huiyh avatar Apr 28 '22 12:04 huiyh

+1

xinkunZ avatar Aug 18 '22 02:08 xinkunZ

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/'

heytherewill avatar Jan 25 '23 07:01 heytherewill

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Jul 14 '24 16:07 okushnikov