bug jpackage in JDK 15

Michael Hall mik3hall at gmail.com
Sat Jan 30 01:37:17 UTC 2021



> On Jan 26, 2021, at 7:16 PM, Michael Hall <mik3hall at gmail.com> wrote:
> 
>> 
>> 
>> When I open the built dmg there is an application icon, a drag to indicating arrow, but no application folder icon as the drag target.
>> 
>> Possibly related…
>> 
>> Running [osascript, /var/folders/dh/91wmrk0n6lzfmr4tjhjmcfp40000gn/T/jdk.incubator.jpackage15947685185521368596/config/BlackJack Blastoff-dmg-setup.scpt]
>> /var/folders/dh/91wmrk0n6lzfmr4tjhjmcfp40000gn/T/jdk.incubator.jpackage15947685185521368596/config/BlackJack Blastoff-dmg-setup.scpt:1112:1334: execution error: Finder got an error: Can’t make class alias file. (-2710)
>> java.io.IOException: Command [osascript, /var/folders/dh/91wmrk0n6lzfmr4tjhjmcfp40000gn/T/jdk.incubator.jpackage15947685185521368596/config/BlackJack Blastoff-dmg-setup.scpt] exited with 1 code
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Executor.executeExpectSuccess(Executor.java:75)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.IOUtils.exec(IOUtils.java:167)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.IOUtils.exec(IOUtils.java:135)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacDmgBundler.buildDMG(MacDmgBundler.java:393)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacDmgBundler.bundle(MacDmgBundler.java:91)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacDmgBundler.execute(MacDmgBundler.java:535)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:680)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:549)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:98)
>> 	at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:52)

This doesn’t necessarily seem to be security related. So possibly not related to my other problem.
I was going to try and re-open a bug report but that doesn’t appear currently possible for me.

It seems it could possibly be the path for the Applications folder. Say if you want something nice to get a name without a forward slash.
Based on DMGSetup.scpt…

tell application "Finder"
	set DEPLOY_VOLUME_PATH to "/Volumes/TestImage/"
	set DEPLOY_INSTALL_LOCATION to "Applications"
	set DEPLOY_INSTALL_NAME to "Applications"
	make new alias file at POSIX file DEPLOY_VOLUME_PATH to POSIX file DEPLOY_INSTALL_LOCATION with properties {name:DEPLOY_INSTALL_LOCATION}
end tell

tell application "Finder"
	make new alias file at file "TestImage:" to file ":Applications" with properties {name:"Applications"}
Result:
error "Finder got an error: Can’t make class alias file." number -2710 from alias file to class

You get the same error. Note INSTALL_LOCATION is used for both destination and name.

If you make that a correct path with forward slash but have a separate name variable without forward slash for the name.

tell application "Finder"
	make new alias file at file "TestImage:" to file "Macintosh HD:Applications:" with properties {name:"Applications"}
end tell
Result:
alias file "Applications" of disk "TestImage" of application “Finder”

It works. I’m not sure unless something changed why that would suddenly be broke but it does seem to be for DMG’s. 









More information about the core-libs-dev mailing list