JDK-8275148 : Allow additional contents for DMG
  • Type: CSR
  • Component: tools
  • Sub-Component: jpackage
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 18
  • Submitted: 2021-10-12
  • Updated: 2021-10-21
  • Resolved: 2021-10-21
Related Reports
CSR :  
Description
Summary
-------

Create a macosx specific jpackage option to allow adding additional content to a dmg created by jpackage

Problem
-------

Jpackage will create a DMG consisting only of the app-image.

Customers have requested ability to add additional content to the DMG


Solution
--------

Add a jpackage option to allow adding arbitrary content (files and/or directory trees) to the dmg.

Specification
-------------
Add the new option:

    --mac-dmg-content <path to additional content>[,<path to additional content>...]
    Include all the referenced content in the dmg.
    This option can be used multiple times.

Only valid for Mac dmg type bundles, Usage with other bundle types is an error.

The mac-dmg-content argument is a comma separated list of paths to any content (presumably a runtime image or pkg, but can be anything)

The Disk Image created by jpackage will include the application plus all the mac-dmg-content. It's dmg script will show in finder the main app image and prompt to move it to the install-dir (as now) but will also show all the co-bundled items. 

Comments
Moving to Approved.
21-10-2021

There are not really analogous options for other platforms (or for other package types on macosx). DMG is a a disk image, not really an installer. The analogous for a real installer would be a GUI that showed various things that could be installed, or files that could be viewed, and that is beyond the scope of jpackage.
19-10-2021

Moving to Provisional. Are there analagous options for other platforms?
19-10-2021

Can you show example of how DMG will look like in finder with additional contents? We do resize DMG to fit background image and we do move app icon to specific location to align it with background image. Also, I assume that content from --mac-dmg-content will go to DMG root. What will happen if it contains file with same name as app?
14-10-2021

Looks good. You might consider adding a note to the Specification about what will happen if the `type` of the package is not `dmg`?
14-10-2021