MacOS .dmg artifact

Answered

Running 2021.3 I have created a .dmg artifact for my JDK 17 modular project that builds and runs very nicely except that I cannot find a way to get my icon file included in the .dmg . Is this possible?

0
5 comments

What IDE functionality do you use to build the .dmg?

I think for this you can check the related Apple documentation.

0

I used the Artifacts page of Project Settings, specifying an artifact of type 'Platform specific package'. In the .idea/artifacts directory this creates a project .xml file with this element:

    <properties id="jpackage-properties">
      <options>
        <option name="version" value="1.0" />
        <option name="copyright" value="" />
        <option name="description" value="" />
        <option name="vendor" value="" />
        <option name="mainClass" value="stuff.Main" />
      </options>
    </properties>

So I assume jpackage is being used under the hood. I even tried adding an "icon" option manually without success.

I could not find any relevant Apple documentation.

0

Yes for this option, IDE uses the jpackage tool from the project JDK (for JDKs>= 14 versions). So you can check the jpackage's documentation fro supported options.

Btw have you tried to place the icon into the resources directory?

As I've checked in these threads:

https://stackoverflow.com/a/62229069/2000323

https://github.com/beryx/badass-jlink-plugin/issues/118

it should be possible to set the application and DMG icon using the --icon command line option. Ad using the --resource-dir option to set the .app icon.

0

Thanks for your effort on this question, but I already have jpackage scripts that work. I was hoping for an IDE based solution, but I think the 'Platform specific package' artifact is not ready for prime time yet. There is no way to set jpackage options in the IDE, so it will need a lot more configurability to be really useful.

0

Thank you for your feedback. I've filled a request for an enhancement: https://youtrack.jetbrains.com/issue/IDEA-287861 Please vote and feel free to provide your feedback there. Thanks.

0

Please sign in to leave a comment.