2
votes

We use install4j for our software and we have different languages for our application and for installer too. We are migrating from install4j 5.1.3 to install4j 6.1.6 . During check of installers we've found that "Replacement script for language code" doesn't work on MacOS. For verification I've just built simple installer that returns just "en" in the replacement script. Manual says that Language Selection Dialog should't be shown it that case, but on MacOS it is shown. With log output there is ClassNotFoundException:

[ERROR] java.lang.ClassNotFoundException: com.install4j.script.I4jScript_Internal_7
java.lang.ClassNotFoundException: com.install4j.script.I4jScript_Internal_7
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at com.install4j.runtime.installer.helper.Install4jClassLoader.loadClass(Install4jClassLoader.java:81)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:187)
    at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:182)
    at com.install4j.runtime.installer.controller.LanguageSelector.initLanguage(LanguageSelector.java:45)
    at com.install4j.runtime.installer.controller.Controller.start(Controller.java:60)
    at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:59)
    at com.install4j.runtime.installer.Installer.main(Installer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
    at com.install4j.runtime.launcher.MacLauncher.main(MacLauncher.java:67)

However, the I4jScript_Internal_7 class is contained in user.jar in archive and it is our script, but for some reason install4j couldn't load it.

1
I cannot reproduce that here . The ClassNotFoundException indicates that the installer is broken. Do any of the other scripts work for you? - Ingo Kegel
@IngoKegel Yes, the other scripts are working. In my test project I've verified this by putting configurationObject.setText("111"); in label initializing script - and label's text became '111'. Also I've build the test project on my colleague's PC - the result is the same. Please see archive drive.google.com/file/d/1weGcFXRoKuBBiNxsOekNjpR7DZcu2wzH/view with dmg and install4j project. - Dmitrii Kopylov
I do no execute downloaded binaries, but the config file looks OK. Does the same thing happen for you with a test project or with the latest version? - Ingo Kegel
Yes, the same thing (showing Language Selector Dialog in case of return "en"; in "Replacement script for language code") happens for 6.1.3, 6.1.6 and 7.0.4 . I checked with the project from the config above (from Google Drive). - Dmitrii Kopylov
But you don't get the exception? If you want to skip the language selection dialog, you have to select "Skip language selection dialog" on the General Settings->Laguages step. The script is only for changing the auto-detected language. - Ingo Kegel

1 Answers

0
votes

This is a bug that will be fixed in 7.0.5.