Packager Images for Mac DMG and PKG Backgrounds

Scott Palmer swpalmer at gmail.com
Wed Sep 7 19:12:41 UTC 2016


Done.

https://bugs.openjdk.java.net/browse/JDK-8165630


> On Sep 7, 2016, at 12:35 PM, Chris Bensen <chris.bensen at oracle.com> wrote:
> 
> Hi Scott,
> 
> Please file a bug.
> 
> Thanks,
> Chris
> 
> 
>> On Sep 7, 2016, at 9:27 AM, Scott Palmer <swpalmer at gmail.com> wrote:
>> 
>> As I continued my search I gained a better understanding of the packager code and see that the file name is in fixed for both DMG and PKG bundlers to use the same “-background.png” suffix.
>> 
>> :-(
>> 
>> This is done in the getConfig_BackgroundImage method of the PKG bundler and the getConfig_VolumeBackground method of the DMG bundler.
>> 
>> It should be fixed as otherwise you can’t run all bundlers in a sane way with customizations.
>> 
>> Regards,
>> 
>> Scott
>> 
>> 
>>> On Sep 7, 2016, at 12:03 PM, Scott Palmer <swpalmer at gmail.com> wrote:
>>> 
>>> I’m packaging a Java application on Mac.  As I want to be able to install it as a service or run it as a regular application, I’m building both a .dmg and .pkg.  I'm trying to use two different custom images for my Disk Image and for my .pkg background.  I can’t seem to make that work.
>>> The packager seems to want a file named “{AppName}-background.png” for both cases.
>>> 
>>> I’m currently doing this through the javafx-gradle plugin from https://github.com/FibreFoX/javafx-gradle-plugin
>>> 
>>> 
>>> The source code for MacDmgBunder.java and MacPkgBundler.java have constants that indicate:
>>> 
>>> static final DEFAULT_BACKGROUND_IMAGE = “background_dmg.png”
>>> 
>>> and
>>> 
>>> static final DEFAULT_BACKGROUND_IMAGE = “background_pkg.png”
>>> 
>>> 
>>> However my attempts to name files with “{AppName}-background_dmg.png” and “{AppName}-background_pkg.png” did not have any effect. E.g.:
>>> 
>>> "{dropinResourcesRoot}/packager/macosx/Example Application-background_pkg.png”
>>> 
>>> doesn’t get used and instead I am told to customize it by placing a file named “Example Application-background.png” in that location:
>>> 
>>> "Using default package resource [pkg background image]  (add package/macosx/Example Application-background.png to the class path to customize)"
>>> 
>>> The build process only picks up the file with "-background.png" :
>>> 
>>> "Using custom package resource [pkg background image]  (loaded from package/macosx/Example Application-background.png)”
>>> 
>>> 
>>> I’m running Java 8u102.  I updated my OpenJFX source to that tag and double checked the MacPkgBundler.java code and it still has the background_pkg.png constant and it appears to use it on line 358, but something isn’t working properly it seems.
>>> 
>>> 
>>> Regards,
>>> 
>>> Scott
>>> 
>> 
> 



More information about the openjfx-dev mailing list