Organizing librarys

Hi guys

I would like to organize my libraries a bit more then just putting them in a /lib subfolder. In particular I want to write an update and instead of putting it in /lib folder I want to place it in a /updater folder. Is there any way to do that other than working on the ant build files?

Thanks guys

When you use webstart and a signing key you only need to upload the libraries that changed and the user will only download the new ones. I will add splitting of the assets.jar too at some time, so you can update only parts of the assets or add a new package for a game extension or similar. No need really to clutter the users app folder with folders that are only relevant to the development structure, is it? :slight_smile:

It’s not a webstart project :wink:

I just want to create and autoupdater. I want it to have it’s own folder next to /lib. That way it could just download updates to it’s own folder and then just extract everything to the main folder without having to worry about what files it can and cannot delete.

But you can make it a webstart project and just get the updater part or free :wink: In any instance you should keep a list of what files you change, so as said I dont know if its a good idea doing that sorting on the users computer… What you would have to do is change the manifest of the main jar file to include another folder and libraries… But I am not sure if you can 100% safely expect that the library listed first in the manifest will be the one loaded first… Another argument for simply using only the lib folder :wink:

Oh well. I could keep the updater in the /lib folder. It just means I need to do a bit more work (which is what I always avoid and that laziness is a bit of a problem).

Basically what I would do is add a method update() in some class in the updater and make that the first thing called in the main method of my game. If it detects an update it would call System.exec() to start itself and then System.exit() to stop the game (and then the updater would call System.exec() to restart the game). When no update is detected the method should just return.

It doesn’t make a real difference when keeping it in the /lib folder but I wanted it in a different one because then it could just keep version info and temp files in that folder.

Yeah. Sounds good. But I’d really say in the end, when you say you’ll have version info as text files etc. programmatically it makes no difference if its the same folder and different names for the temp files or if its different folders, just a “" instead of a “/” in code, and the "” is even system-independent :wink: Maybe moving old files into lib/backup makes sense? This way the user only has the lib folder whose content shouldnt be of interest to the user anyway.