gluonhq / substrate

Create native Java(FX) apps for desktop, mobile and embedded
GNU General Public License v2.0
390 stars 52 forks source link

DMG installer background image misconfiguration #1219

Closed credmond closed 1 year ago

credmond commented 1 year ago

\<appname>-background.tiff is copied to one directory, but the .scpt (AppleScript) is configured to look for it in another, resulting in the image being ignored.

Expected Behavior

AppleScript should point to an existing DMG installer background file as expected.

Current Behavior

AppleScript does not point to an existing DMG installer background file and therefore no background image is displayed.

Steps to Reproduce

Build any DMG and observe no background image is visible when attempting to install the app. Also, look in tmpDmg folder and view the .scpt file and note it is pointing to images/.background/\<appName>-background.tiff, but this file actually exists in a config folder, never referenced by anything.

Here's the offending code (Packager.java) (see asterisk'd comments):

        // copy to config
        backgroundPath = FileOps.copyFile(backgroundPath, config.resolve(backgroundPath.getFileName())); // *******
        Path volumeIconPath = FileOps.copyFile(rootApp.resolve("Contents").resolve("Resources").resolve("AppIcon.icns"), config.resolve(appName + "-volume.icns"));

        // setup script
        Logger.logDebug("Setting up applescript");
        Path volumePath = images.resolve(appName);
        String volumeUrl = volumePath.toUri() + File.separator;
        Path backgroundFile = Path.of(images.toString(), appName, ".background", backgroundPath.getFileName().toString()); /********

There should ideally be proper tests for the installers -- there's actually a few issues and inconsistencies with them (for the MSIs too).

Your Environment

MacOs Monterey, in this instance. Substrate 0.0.59-SNAPSHOT.

credmond commented 1 year ago

Oops, I apologise. This not a bug after-all; the image is (eventually) copied to the correct folder (the layout and flow of the code is a bit confusing).

My issue was that the background image was slightly too large, and I'm guessing in that situation, the image gets ignored completely by the DMG building tool (no warning or failure).

Closing...