What is the .install4j/user directory good for when the installation is finished? - install4j

When I install my Java application on Windows using Install4J 9.0.5, I'll find a .install4j\user directory inside my installation directory. It contains several jar files and some other files used by the installer.
Do I still need this directory when the installation is finished? Maybe for uninstalling? And is there a built-in way for Install4J to delete this directory if it is not needed anymore?

The .install4j directory contains the runtime for the generated launchers and for installer applications like the uninstaller.
You can only delete it if you only have external installers, no installer applications and if you do not use the install4j API from your code.

Related

Install4J - hide .jar file from installation directory?

I am currently working on turning my java application into a windows installer, converting the .jar into and .exe file.
Have chosen Install4J because of the ability to bundle JDK with the application, as well as recognizing previous installations when deploying updates.
Only problem I have, is the fact that the jar file for the application, is saved in the installation directory as well.
Does anyone know how to fix this? I don't want the original jar file in the directory, just the converted exe file.
The .exe file is just a launcher for the JVM, it does not contain natively compiled Java code.
The best way to protect your code is to use an obfuscator like ProGuard.

install4j: Force a launcher (EXE) to use DLLs from bundled JRE folder

We use install4j 8.0.8 in our application. Since a new release of the application we use JRE 11.0.10 from Azul and found out that small amount of users under Windows 10 were unable to load the application with exception: java.lang.UnsatisfiedLinkError: C:\Users\user\AppData\Local\thinkorswim\jre\bin\awt.dll: Can't find dependent libraries. We were unable to reproduce the issue on our machines.
We've found in Internet some similar issues with other applications and it was said there could be a broken Windows installation (may be some DLLs were corrupted). Many pages contain mentioning of msvcp140.dll.
With Windows Resource Monitor we found out that our application (started with install4j native EXE launcher) loads msvcp140.dll from c:\windows\system32, but JRE 11 contains the DLL inside bin folder. Then we ran our application without the native launcher (just java -jar) and Resource Monitor showed that msvcp140.dll has been loaded from jre\bin folder.
We've asked a user to repeat and they said that the application can be launched with java -jar.
I've played with PATH environment variable and java.library.path via a .vmoptions file and I was unable to force the launcher to use DLLs from the bundled JRE.
Is it possible to tune the native launcher to make it load DLLs from the JRE bin folder?
On Windows, executables always try to load DLLs from their directory first. That is why java.exe will load DLL dependencies from the bin directory before looking in the system32 directory,
The install4j launcher does not call java.exe, but starts the JVM via JNI so it's not the bin directory of the JRE but the directory of the launcher that is looked at first. Unfortunately, it is not possible to change this behavior.

JRE for installator created in Install4j

I have application with structure:
/data
/docs
/j64
app.exe
etc.
and I need to wrap structure this into install4j installer.
There is a problem that on customer's pc is not installed java. I know that I can bundle JRE into installation package (this will be installed into target folder or into user's folder in case of shared jre). But my application already constains JRE in j64 folder, which is used for executing application. Is there any way how to use this folder for installation too? Thanks
No that is not possible with install4j, you have to configure a JRE bundle.

install4j deploy no jar file

I'm new to install4j.
So I hope this question is easy to answer and not obvios.
I involved to an Java-development-project.
We decided to use install4j to create a nice installer for our customers.
Now i've got an install4j license and testing to create an installer.
I Use the install4j Launcher Wizard to make a .exe file out of my .jar file.
Now the Problem: If I remove the .jar file from the installer, the .exe file doesn't work anymore.
So the question: Is it possible to deploy with install4j an .exe file without the .jar file ?
WebStart is not an option in this project.
The .exe is just a launcher to start the JVM. Your Java code is not compiled into native code by install4j. If you want to protect your code, you have to use an obfuscator, for example yguard.
I think install4j can package the Jar inside the executable, as shown in this blog post:
http://blog.ej-technologies.com/2010/12/my-first-try-with-install4j-tutorial.html

Do you need to include older versions in a clickonce deployment folder for automatic updates?

Say clients have v1.0.0.0 of my VSTO addin installed and I want to deploy v1.0.0.1.
If I deploy to a new folder and copy to my update location (only v1.0.0.1 will be in the Application Files folder), will automatic updates still work or do I need to have the old version in the Application Files folder too?
I would say it will work. the setup.exe located under the installation root points to the latest version