edvin / fxlauncher

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

Old versioned jars are not deleted #133

Open boopac opened 6 years ago

boopac commented 6 years ago

Hi, if i update a library (controlsfx-8.40.13 -> controlsfx-8.40.14) the old jar files are not deleted.

With maven i build the new app.xml which contain the tag for controlsfx-8.40.14.jar. I copy the new controlsfx-8.40.14.jar to the URL and delete controlsfx-8.40.13.jar.

But after using fxlauncher I have both files on the client: controlsfx-8.40.13.jar (not deleted) controlsfx-8.40.14.jar (new downloaded)

Is there a possibility to delete the fiels that are not in app.xml with fxlauncher?

King regards, Boris

mordechaim commented 6 years ago

No you can't but it will not be dynamically loaded onto the JVM if it is not present in the manifest.

if you really want, your artifacts should not have a version string so newer will overwrite older. In case it's already released, rename the new version to match the older.

edvin commented 6 years ago

Thanks @mordechaim - I agree. We could have added a feature to delete old artifacts, but that's a bit dangerous, and since we can remove the need for it by simply removing version numbers that's a safer approach IMO.

boopac commented 6 years ago

@mordechaim: that's right, but then you have a lot of garbage files, if the artifacts have new versions.

@edvin: if you remove the version number, you can't see on client site if there is the right versions of the artifacts.

Maybe in a later version of fxlauncher there is a parameter for "--remove-old-artifacts".

edvin commented 6 years ago

You can include a version number in your app perhaps? I agree, this could absolutely be added as a new feature :)

boopac commented 6 years ago

That's would be pretty cool :+1:

mordechaim commented 6 years ago

You will have to add more entries in the manifest, namely 'deletes'. Otherwise how would we know what's an old artifact?

Do you think it's still in the scope of this framework? One could easily do the deletes theirselves in the actual app; it doesn't need to be done anywhere before the launch process. Just my opinion.

edvin commented 6 years ago

We'd have to have a designated artifacts-folder so it would be safe for FXLauncher to delete any files not mentioned in the manifest. This could be done after the new version has been downloaded successfully.

mordechaim commented 6 years ago

You are right! It does fit the framework.

My mistake because I came from my update4j that doesn't have the concept of cachedir, instead you can save files anywhere on the user machine.