edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
715 stars 107 forks source link

FXLauncher downloads corrupted JAR files #187

Closed PegasusMKD closed 4 years ago

PegasusMKD commented 4 years ago

Hi, We've made an app using TornadoFX and we wanted to use FXLauncher for deployment. But, it seems that fxlauncher.jar downloads corrupted jar files.

I've tried running the jar right after mvn package and it works, but, if i delete all the dependencies except fxlauncher.jar in target/app, it downloads all of the jars, but they are corrupted, they are all 22KB files.

We found this out by first having problems with the mvn install and mvn exec:exec@installer which creates the EXEs and MSIs, and when we tried to run the fxlauncher.jar inside of the installer or bundles folder, it would do the same thing. thus breaking the installers as well since (i think) that they depend on fxlauncher to download it's own packages. Either way, we had a problem with them as well.

When i manually overwrite/copy the jar files that are needed, it works like a charm, all the EXEs, MSIs & fxlauncher,jar

If you'd like me to upload the pom or manifest file, tell me, i will contact my superiors and try to get their permissions.

mordechaim commented 4 years ago

I'd suggest changing the file extension of those corrupt jars to .html and try opening them.

PegasusMKD commented 4 years ago

Will check up on that, will post an update

PegasusMKD commented 4 years ago

Any sites you could recommend for uploading the jar and manifest files? My superior is busy at the moment, so i don't have access to our server at the moment, and i would like to check my guess as soon as possible

mordechaim commented 4 years ago

Generally, fxlauncher requires the download link to have a common base path plus the filename, so sites like Google drive and Dropbox (although you can get a direct download link) will not work since they depend on file IDs. AWS s3 works best; or you might try your git repo, though it's generally discouraged to store binaries in git.

PegasusMKD commented 4 years ago

Thanks, the git repo did the trick, works like a charm!

AIGLEZMA commented 3 years ago

Sorry for bumping this but @PegasusMKD can you tell me how you got it work with git ?

PegasusMKD commented 3 years ago

Sorry for bumping this but @PegasusMKD can you tell me how you got it work with git ?

It's been quite a while since I last worked on this project, due to switching projects so my memory on the solution and how the dependency is used is a little fuzzy. But, hopefully whatever I remember is going to be of use.

One important thing which I remember is that the repository has to be public. At least when I tried it with a private repository, it wouldn't work due to needing authentication (which might be fixed by now, or there might be some authentication option available in the FXLauncher, haven't checked into that).

You can actually check that for yourself. In short, if I'm not mistaken, I could open up the "corrupted" jars as text files, which actually contained the HTML of the site on which the dependencies were being hosted (either it be GitHub or some other service)! I'd suggest you use this to debug whether it's an authentication issue or something else (if It's an authentication issue, the text inside the jar will be about the same with the HTML of the authentication page of the service you're using).

You might be able to have it work with a private repository, but I haven't looked into that, because once I checked what the issue was, we made adjustments to our hosting server to workaround that issue.

Also, I think that you have to have all of the jar's at the base level! They can't be in multiple different directories throughout the repository. You might be able to put them in a single folder and have the base path contain the path to that folder as well, but all the jars have to stay in one directory.

After making the repository public, I either used the URL with ".git" or just the plain URL of the repo as the source URL for the dependency. I can't really go and check it since I stopped working for the company in which we used the plugin and I've reformatted my PC a couple of times since my departure.

Again, take all of this with some grain of salt, since I've been on many other projects after it, so my memory is shaky on all of the details.

Will recheck if I did keep the code for that specific project, so If I find something, I will update this thread @AigleDev.