install4j launcher issue on Mac OSX app store application - install4j

We’re using install4j to create installers for our Java application, PDF Studio.
We’re currently trying to submit our application to the Apple store and for this, need a pkg file. We’ve created a pkg file from the Application folder that is created after running the dmg installer created by install4j and are working on removing one by one all the warnings and errors reported by the Apple store.
One issue we are having is that symlinks are not allowed by the Apple store and the JRE contains a symlink for a file called libjli.dylib.
When we try to remove the symlink or replace it with the actual file, the i4j launcher for our application is broken.
When we remove the file from the install folder:
rm /Applications/PDF\ Studio\ 2018.app/Contents/PlugIns/jre.bundle/Contents/MacOS/libjli.dylib
We get an error message on launch saying "Java SE 8" couldn't be loaded because it's executable couldn't be located."
If we try to copy the file to the symlink location:
cp /Applications/PDF\ Studio\ 2018.app/Contents/PlugIns/jre.bundle/Contents/Home/jre/lib/jli/libjli.dylib /Applications/PDF\ Studio\ 2018.app/Contents/PlugIns/jre.bundle/Contents/MacOS
Then the launcher fails with no error message dialog.
If we run with install4j log enabled:
INSTALL4J_LOG=yes /Applications/PDF\ Studio\ 2018.app/Contents/MacOS/JavaApplicationStub
Then it will print "Error: could not find libjava.dylib."
Has anyone tried to do this and made it work?
It seems like the launcher is looking under /MacOS/libjli.dylib. We think it is the JavaApplicationStub executable file that decides where to look which is created by install4j.
Is there is a way to set where the launcher looks for the jre.bundle executable libjli.dylib?

You can extract the DMG and edit the Info.plist file so that it contains
<key>CFBundleExecutable</key>
<string>../Home/jre/lib/jli/libjli.dylib</string>
We will check if we can do this in general.

Related

Install4j is not keeping link in prebuild JREs for MacOS

in our install4j script we are using a prebuild jre. The tar.gz file contains a link for MacOS and Linux. When installing on linux, the link is kept. When installing on MacOS (in Version 8.0.8, it did work in 8.0.4), the link is replaced by a real file.
Contents/MacOS/libjli.dylib -> ../Home/jre/lib/jli/libjli.dylib
After installing, the file Contents/MacOS/libjli.dylib is not a link any more, but a real file. It seems that the Eclipse-launcher has a problem with this, it does not start with this error:
Error: could not find libjava.dylib
Failed to GetJREPath()
If the file Contents/MacOS/libjli.dylib is changed back to a link, the Eclipse-Launcher will start again.
I have a temporary solution in my setup.install4j script to remove that file and create a link (action for both exists), but it would be nice to to modify the links in the tar.gz of a prebuild jre.
To be able to fully sign and notarize a JDK bundle on macOS, the file Contents/MacOS/libjli.dylib cannot be a symlink.
See
https://bugs.openjdk.java.net/browse/JDK-8235687
These are new requirements from Apple that have been introduced by notarization.
However, recent JDK versions fix the problems introduced by that change:
https://bugs.openjdk.java.net/browse/JDK-8238225

Unity3d OSX "Application can't be opened"

I'm using a PC and I've created a build for Mac standalone.
I shared the file with my test user by zipping and emailing the build, but when he tries to run the application he sees this error:
The application "SomeApp.app" can't be opened.
After some searching, I learned that I need to do chmod to open the file. Can anyone tell me how to do that on a Mac?
The zip format doesn't have easy support for Unix-like file permissions, so your transfer process is stripping any permission flags that OSX uses to recognize files within that zip that are supposed to be executable. This can also happen with other file transfer solutions, so it's something to watch out for.
The best solution would be to create an archive which does keep those permissions, such as a tar archive.
Failing that, you can have a Mac user open a terminal and set the permission flag manually:
chmod a+x SomeApp.app/Contents/MacOS/*
(Replace SomeApp.app with whatever your .app folder is named)
I had the same issue, I left an answer here, at the bottom: https://forum.unity.com/threads/mac-build-breaking-when-uploaded-to-storage.1093330/
The problem was not with the .zip, but rather with the build itself. Ran fine on my Mac, did NOT run fine once I uploaded it and downloaded it again (or if anyone else downloaded it).
Edited 12/8/2021, as per EmiOB's suggestion, to add the text of my answer (same as in the link):
This worked for me on 2020.3.16f1:
In the Unity Editor: Build Settings, check the box that lets you make an XCode project (requires having XCode installed, I believe I have Xcode 11)
Open the XCode project
Build
That solved my problem :)

Create a DMG file with Installer

Hi i have created a dmg file. with the command.
hdiutil create -format UDZO -srcfolder folder_to_compress archive_name.dmg
The structure of the DMG is the following
--Install.app
--payloads
----Application.app
----com.application.helper.plist
I have created and Install.app with whom i can install the application as well as the helper file. When clicking on the installer Apple asks me to Install the Install file and not to launch it from disk image.
Can i prevent this somehow? Adobe also has an Install.app but apple is not asking. I checked the plist files but i could not find something indication that the application should be launched from disk image.

Can install4j 6 running on Linux correctly codesign an OS X app bundle?

I've installed install4j 6 on Linux. It creates and signs my OS X app bundle and creates a DMG. But whenever I open the DMG and run the created app inside, Gatekeeper says it is from an unidentified developer.
> codesign -vv /Volumes/pokercopilot/Poker\ Copilot.app
/Volumes/pokercopilot/Poker Copilot.app: unsupported resource found (something not a directory, file or symlink)
When I run the same install4j build on OS X, the app bundle is correctly signed.
> codesign -vv Poker\ Copilot.app/
Poker Copilot.app/: valid on disk
Poker Copilot.app/: satisfies its Designated Requirement
I'm trying to eliminate factors, and want to check that what I'm attempting is within the capability of install4j.
Update: install4j has created a file with an invalid filename:
cp -rf /Volumes/pokercopilot/Poker\ Copilot.app .
cp: /Volumes/pokercopilot/Poker Copilot.app/Contents/Resources/app/.install4j/icons/.install4j/${compiler:pcp.productShortName}Updater.icns: No such file or directory
It seems a variable reference hasn't been replaced with the value it has been assigned. When I use install4j on OS X, the folder ./Contents/Resources/app/.install4j/icons/.install4j/ is empty.
The code that signs the DMG is pure Java code without any external dependencies, so the operating system on which install4j is executed does not matter for this purpose.
When I run the same install4j build on OS X, the app bundle is correctly signed.
Since you did not download the DMG, it is not checked by gatekeeper. Probably the signature is invalid here as well. To check if the signature is valid, execute
codesign -vv application.app
One probable cause for an invalid signature is that you did not use the "Developer ID Application" certificate for signing.
Update:
This is actually a bug in install4j introduced by the fact that ICNS icons are now automatically compiled from cross-platform images. This only happens if you use compiler variables in the "Executable name" property of an installer application. This bug will be fixed in 6.0.1.
Workaround: In the "Executable icon" property of the installer application (the updater in this case), select "Use ICNS file" in the "Mac OS X" section and choose the file [instal4j installation directory]/resource/macos/app.icns.

How to properly force a Blackberry Java application to install using Loader.exe

I want to include the Application Loader process in a software installation, to ensure that users get our software installed on their Blackberry by the time our installer software finishes.
I know this is possible, because Aerize Card Loader (http://aerize.com/blackberry/software/loader/) does this. When you install their software, if your Blackberry is connected the Application Loader will come up and force the .COD file to install to the device.
I can't make it work. Looking at RIM's own documentation, I need to:
Place the ALX and COD files into a subfolder here: C:\Program Files\Common Files\Research In Motion\Shared\Applications\
Add a path to the ALX file in HKCU\Software\Research In Motion\Blackberry\Loader\Packages
Index the application, by executing this at the command line: loader.exe /index
Start the force load, by doing this: loader.exe /defaultUSB /forceload
When I execute that last command, the Application Loader comes up and says that all applications are up to date and nothing needs to be done.
If I execute loader.exe by double-clicking on it (or typing in the command with no parameters), I get the regular Application Loader wizard. It shows my program as listed, but un-checked. If I check it and click next, it will install to the Blackberry. (This is the part that I want to avoid, and that Aerize Card Loader's install process avoids.)
What am I missing? It appears that the Aerize installer is doing something different but I haven't been able to ascertain what.
You can do it easily with the following command:
C:\RIM\JDE_4.7.0\bin\JavaLoader.exe -u load <.cod file>
With this command you don't need an alx at all, just the cod file. Look at JavaLoader usage help to see full options.
JavaLoader.exe can upload one code file. What about two or more cod files?