Hi All,

Have been having a problem trying to use jpackage to sign an app and submit it 
to the Apple Store.

Attached are the following:
— the script which invokes jpackage. Note that the attached ’…txt’ files show 
the values for all of the variables.
— the output of this script
— the output of the script running with —verbose

To try to summarize all of the attached:
Trying to create a signed DiskOrganizer-x.y.z.pkg to upload to the Apple Store.
The problem is with mac-sign and the attempt to load to the Apple Store. 
Otherwise, have successfully created .app, .pkg, and .dmg versions and they all 
execute/install as expected on my Mac (except as noted directly below in (4)).
This attempt used the jpackage in JDK 16-ea, build 31. Had essentially the same 
results using JDK 15.0.1
Not shown in the attached is that if you try to manually start by going to 
DiskOrganizer/Contents/MacOS and execute ./DiskOrganizer directly, it fails 
with — Error opening 
"/Applications/DiskOrganizer.app/Contents/Contents/app/DiskOrganizer.cfg" file: 
No such file or directory — Note the ../Contents/Contents/app… Can fix this 
after installation by putting in a symlink: ln -s . Contents within the 
Contents directory.

The last step of the pkg1.sh script invokes xcrun altool —validate-app to 
validate, comments on these specific errors:
jpackage generates the Info.plist - some errors from this follow. Tried to make 
a copy of Info.plist, fix it, and then copy back into the .app, but this then 
invalidates the signature from —mac-sign.
Key LSApplicationCategoryType contains Unknown. Probably need a jpackage 
—mac-category <type> to allow the user to set this.
Installer package may not include install scripts. No idea where such scripts 
may be located. There are no scripts in the ./inputs directory. Maybe in the 
runtime created by jlink?
The following executables must include the "com.apple.security.app-sandbox" 
entitlement with a Boolean value of true in the entitlements property list: [( 
"DiskOrganizer-app.pkg/Payload/DiskOrganizer.app/Contents/MacOS/DiskOrganizer", 
"DiskOrganizer-app.pkg/Payload/DiskOrganizer.app/Contents/runtime/Contents/Home/lib/jspawnhelper"
   Probably need an —mac-entitlements <file> option in order to add this, and 
any other app-specific entitlements, to the code signing step.
Ensure that it is signed with your "3rd Party Mac Developer Installer" 
certificate. Don’t understand this - have assumed that the default was to use 
the Developer ID Application and Developer ID Installer certs (which are in my 
keychain). Are the "3rd Party …" certs also needed?
Error in keyPath [product-metadata.product-identifier] — No idea where this 
resides. Do you know?   
Error in keyPath [product-metadata.product-version — Ditto
The lowest minimum system version [none] in the Product Definition Property 
List — .. does not equal 10.9 (from the Info.plist). Any idea where this gets 
set on the Apple side? Is it supposed to be somewhere within the .pkg? Maybe 
need a —mac-min-version <x.y.z> keyword?
Cannot find executable file that matches the value of CFBundleExecutable in the 
nested bundle DiskOrganizer 
[DiskOrganizer-app.pkg/Payload/DiskOrganizer.app/Contents/app] property list 
file.) — No idea what this means. The generated .pkg does in fact install OK on 
my machine, and /Applications/DiskOrganizer.app launches OK with a double-click.
For Apple Store you have a Version (<key>CFBundleShortVersionString</key>) 
which would be set by —app-version and is the version visible to the user. But 
can also have a <key>CFBundleVersion</key> which is really the build number. 
This must be 3 numbers separated by periods and must change for each upload to 
the store. So would be good to be able to set —app-version 1.0 and —app-build 
1.0.4 (or —mac-build) to be able to set both values. Otherwise the end user 
will see things like 1.0.23 (it took 23 uploads to make it through the Apple 
Store process) - which will be confusing.

Sorry for the length of this email, but have been messing around for well over 
a week with no success. Also tried using jpackage without the —mac-sign, 
running 'codesign' directly, etc. Still have not found the magic wand to make 
this all work.

Would appreciate any suggestions. Would love to hear "You’re doing it wrong, 
use this set of jpackage options"! 

Otherwise, suggestions or pointers to any on-line documents that would help 
would be great. (Have been Googling everything about this, but almost all of 
the "answers" assume that you are using Xcode and tell you what parameters to 
set - nothing about the resulting in-the-trenches process that Xcode then 
executes.)

Thanks,

John Crowley
Charlotte, NC
203-856-2396
j.crow...@computer.org





Reply via email to