Launch pkg installation programmatically from Java
Hello,
I'm stuck at delivering an update as a pkg file, and auto-opening it with ProcessBuilder in the main code.
Every attempt when I start the main application using double-click or the open command in a terminal just miserably fails when it comes to launch the downloaded pkg file either with "open" command or the "installer" one.
But directly launching the main jar using the java command provided by the Oracle JDK works fine !
The same command used by the JavaApplicationStub (retrieved from macOS Console).
The only thing I can extract from the macOS Console is a : -67062 (security issue: code is not signed at all)
But...when I check the ".app" and the ".pkg" everything seems fine:
A codesign verify on the app returns :
MyApp.app: valid on disk
MyApp.app: satisfies its Designated Requirement
A pkgutil signature check on the downloaded file (via HTTPS) returns :
Status: signed by a certificate trusted by Mac OS X
And the following certificate chain:
1. Developer ID Installer
2. Developer ID Certification Authority
3. Apple Root CA
On the other hand, the command 'spctl -a -v" returns :
MyApp.pkg: rejected
source=no usable signature
Unless it is used with the parameter "--type install" which gives:
MyApp.pkg: accepted
source=Developer ID
So...I'm just going arround in circles, and can't find any solution after digging for hours.
Using Sparkle or any other framework is not possible for the moment, as we must adapt the old auto update system as a first requirement...
Any ideas on how to overcome this one ?
Thank you for your help,
Victor D.
macOS High Sierra (10.13.4), null