edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
714 stars 110 forks source link

One file Installer #61

Closed TBK-Genius closed 7 years ago

TBK-Genius commented 7 years ago

Hello,

I started to use your project on a Windows OS, and I managed to create an installer .exe. But it needs dependencies (some .dll files are generated with the .exe file) to work well.

Is it possible to create a one file installer, like a msi package?

edvin commented 7 years ago

You basically have two options:

  1. Have javapackager generate an MSI for you (https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html#JSDPG601)
  2. Include the native resources inside the .exe. This is pretty easy to do, and that's the approach I'm using whenever I need to include platform native resources.

The manifest also has support for platform condspecific resources, so that those will only be downloaded for the correct platform.

See https://github.com/edvin/fxlauncher#platform-specific-resources for naming conventions.

To include dll's inside your installer, you can just copy them into target/app before you package, and they will be included inside the manifest. I usually create a folder called target/app/native for the native resources.

TBK-Genius commented 7 years ago

Hello edvin!

Thanks to your fast reply, I really appreciate it. I tried to include the native resources with your method. I specifed the --preload-native-libraries= parameters, I copied my native resources inside a folder target/app/native. Then I package my app, I tried to launch my .exe file, I diddn't get error but the installer did nothing.

May be I forgot a step, if you have an idea, thanks to your reply!

TBK-Genius commented 7 years ago

I would like to make a clarification. I talk about the resources generated near the .exe file (mscvp120.dll, msvcr100.dll, msvcr120.dll, packager.dll).

Well, I tried to use Wix, I managed to build a .msi file, install my application with, on my computer but when I tried to install it on an another pc (which has not built the .msi file), but I can't open it.

If you have any idea about my problem, if you need more information, please contact me,

Regards,

TBK-Genius

ronsmits commented 7 years ago

Arent those microsoft general dll's? I usually only see them when an installer says they need to be installed and it kicks off another installer?

edvin commented 7 years ago

There is no need to supply --preload-native-libraries for non-JNI/Java libraries you want to include. Those are just "files" for all FXLauncher cares about, but it can include them in the app if you need them.

I don't get why you'd want to include these libs with your app?

TBK-Genius commented 7 years ago

Thanks to your reply!

l need a one file installer. The .exe file seems not working when I try to run it out of its original folder.

And with the .msi file, I can only install my application on the computer which are built the .msi file.

edvin commented 7 years ago

MSI is one of the deployment options provided by javapackager. If it has prerequisites on installed software there is unfortunately nothing we can do about that from inside that installer. However, my experience with msi is that it either includes everything, or Windows is smart enough to figure out what's missing and asks you to install it.