Pages: 1
  Print  
Author Topic: Externalizing LateralGM  (Read 2018 times)
Offline (Male) Goombert
Posted on: September 28, 2014, 01:33:21 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
I want to make the case for excluding several things from LateralGM's JAR and redistributing it as a zip file.

1) I want to externalize the file that configures all the keyboard shortcuts of the application to allow people to change the shortcuts.
https://github.com/IsmAvatar/LateralGM/issues/147
2) I want people to easily be able to add and change existing icon packs by placing them in a folder called icons and every top level folder will become a new icon pack.
3) I want to do the same thing I want to do for icons with languages and allow people to easily add new language packs.
4) I want to externalize all the LGL action libraries to a folder where LGM will load them to allow users the easy ability to add and remove action libraries as well as modify and utilize existing ones, even those made for GM since we already have the code to load them it doesn't make any sense not to offer the capability, obviously for legal purposes we use our own LGL format.

Anybody that knows me knows that I have never been one for creating applications that package everything into a single file, it has never been my thing and I strongly oppose it for several reasons. I like applications that you can easily modify without hassle or even having to know what you are doing, and I find this aspect of LateralGM to actually be against what makes LGM great, its free and open source nature.
« Last Edit: September 28, 2014, 01:44:58 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Female) IsmAvatar
Reply #1 Posted on: September 29, 2014, 09:53:24 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 886

View Profile Email
I totally understand and agree with having some files external to LateralGM in order to override LGM's default behavior in a user-friendly way. I could never figure out a good way to do that. One possible way is to provide the files (or even LateralGM) as a zip *alternative* to users who want that, but it might not be able to place the right files in the right places, since some files may belong in a different directory (and also limitations that I'll detail in the next paragraph).
Whatever the case, I do believe the single-file has value to many users, which is why I strongly continue to try to preserve it. First, it affords us the ability to easily store LateralGM on certain mediums without adding write permissions requirements to that medium (for example, a CD). Second, it's super convenient for users to download 1 file and run it. Even easier is moving it around - one file to move, without needing to worry about if it has any other file dependencies or if the registry is expecting it to be located in one location.

I've done a lot of work on trying to get LateralGM to honor external files in logical locations. For reference, please read the wiki page on LateralGM's WorkDir:
www.enigma-dev.org/docs/Wiki/LateralGM:Workdir
A little work still needs to be done in some spots, but most importantly, we need some way to increase the visibility of these locations.
A few solutions that I've seen other programs do that I like:
* Attempt to create those directories. An installer will often handle this, but I want to avoid requiring an installer. LGM could try to create those directories, probably with the user's permission, and if it's even possible.
* Give in-program easy links/access to those directories. Commonly a button or link will open the user's file browser pointed to the directory. You'd just need a good spot to put this button (or these buttons)

Whatever the solution, we should try to keep it as platform-independant as possible. If it doesn't work on one platform, that's fine, skip it and continue - and let LGM still continue to try and work on that platform.
« Last Edit: September 29, 2014, 10:01:54 AM by IsmAvatar » Logged
Offline (Unknown gender) TheExDeus
Reply #2 Posted on: September 29, 2014, 12:40:06 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
You can go the game modding route (starting with Half-life1 or Quake2) in that you can keep your files and folders inside the .jar, but if there is a file relative to the .jar in the right position, then it overrides the default one that is inside the jar. Like imagine having this file structure (so an icon inside the jar):
lateralGM.jar
>icon
>>icon.png

Now if a person created a folder icon at the same folder where .jar is, then put the .png in it, then LGM would try loading that instead. I think this is what Ism already though, but I just wasn't sure.
And to fix the problems of people having wrong folder structure, you could in fact do what Ism suggests and add a button in LGM settings, which would create that structure, or even create the files (like "install" or "unpack").
Logged
Offline (Female) IsmAvatar
Reply #3 Posted on: September 29, 2014, 07:22:26 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 886

View Profile Email
Quote
if there is a file relative to the .jar in the right position, then it overrides the default one that is inside the jar.
This should be what LateralGM already does. It's just not obvious because it's hard to tell:
* Which folders you can create
* Where to put them
* What they should be named
* What exactly goes inside them

So the challenge then is to just increase visibility of that somehow.
Logged
Offline (Male) Goombert
Reply #4 Posted on: September 29, 2014, 07:35:50 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Quote from: IsmAvatar
One possible way is to provide the files (or even LateralGM) as a zip *alternative* to users who want that,
Yes as a separate release, I may actually try that first and let everyone test it first before making more long term decisions on the matter.

Quote from: IsmAvatar
First, it affords us the ability to easily store LateralGM on certain mediums without adding write permissions requirements to that medium (for example, a CD).
Actually, I see what you mean and I agree, but none of the resources I am talking about actually require writing by the IDE unless the user manually wants to write to the files outside the IDE which they would have to do anyway. So either way you have a jar or a folder with a jar and all LGM's files on a non-writable disk. So I see what you are saying, but that really only is relevant for those of the resources LGM would write to which currently is none unless maybe we added a dialog for editing the keyboard shortcuts like Studio does, but I don't plan on that because editing the text file itself is likely to be a lot easier and quicker.

Thanks for the Wiki link, however most of it I was already aware of, I had already considered a dialog for LGM as well that would ask where enigma-dev is located on the first run.

Quote from: IsmAvatar
Attempt to create those directories. An installer will often handle this, but I want to avoid requiring an installer. LGM could try to create those directories, probably with the user's permission, and if it's even possible.
I agree, I do not want any installers either, but what Harri suggests seems like a relatively good idea as well, but I just always found it to be uncommon knowledge to the layman user. Having those directories already there gives them some degree of freedom in figuring out what does what without having to go the internet and come here and ask us how they can override internal files.

I will say that I have considered writing executables for LGM however, so that I can at least see an icon for LGM's attached process in Task Manager, which Eclipse does as well.

Quote from: IsmAvatar
This should be what LateralGM already does. It's just not obvious because it's hard to tell:
Yes exactly, so perhaps we could add an "Unpack" option underneath the two Explore menu options, and also delegate a callback to the ENIGMA plugin in case it wants to unpack anything. Then the question however does become, should LGM remove these files internally? Because we essentially end up with two copies of them then.

Quote from: IsmAvatar
* Give in-program easy links/access to those directories. Commonly a button or link will open the user's file browser pointed to the directory. You'd just need a good spot to put this button (or these buttons)
Actually, we already have one under the help menu that I added when Studio added theirs, it opens the executable working directory of LGM, so when you run from eclipse it just opens your project folder, if you run it with enigma-dev it will open that up in your file explorer, the button is "Explore LateralGM" and we also have the option "Explore Project" right underneath of it.
« Last Edit: September 29, 2014, 07:39:01 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #5 Posted on: September 30, 2014, 04:47:27 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
LGM is not that big for it to remove those files internally. It would also cause problems if the user deleted them. So I think they should always be kept as backup.
Logged
Offline (Male) Goombert
Reply #6 Posted on: September 30, 2014, 05:38:42 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Well I would first like to call attention to the failed experiment that was me trying to iterate the directories inside the jar, the code works when you look for resources at runtime in Eclipse, but you have to iterate Jars like a Zip file and they don't properly maintain their directory structure.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/subframes/PreferencesFrame.java#L106

Not only is the code way to verbose for looking for resources, it simply doesn't work for me to find just the directories in a folder inside the jar to get the name of icon packs.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Goombert
Reply #7 Posted on: December 09, 2014, 10:49:31 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Just an update to this, I figured out why isDirectory() was not working when iterating through a Jar, you have to export the directory structure info with the jar from the jardescription.

Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print