@Odonis No problem. I opened https://github.com/triplea-game/dice-server/issues/33 to update the misleading error message. Hopefully that will get fixed soon.
Solved: How to use TripleA as a Portable App
-
I could be wrong but I believe you can set the locations of things like “user.home”, etc, using environmental variables in java. TripleA just uses system properties like user.home, it doesn’t have a “hard set location” for where to look for your user folder, etc.
Also, TripleA already is portable (the zip version).
If you are looking for portability to a computer that doesn’t have java installed, you should be able to get around that by doing the following:
Download the “all platforms zip” version.
Download the “windows version with java included”.
Install the windows version with java included.
Unzip the all platforms version to your usb disk.copy and paste the “JRE” (or jre) folder from the installed ‘windows version with java included’ to the usb disk
and then copy and paste the “triplea.exe” from the installed ‘windows version with java included’ to the usb disk (overwrite old exe)
(you could optionally do these things by copying and pasting from the “source code only zip” if you do not have windows)basically, to explain what is going on:
Because TripleA is a JAVA program, the real program is a .jar file, not the .exe
In fact, all the .exe has in it is an icon and simple batch like program that runs a single line: “run the GameRunner class inside the bin/triplea.jar file”The windows with java installer does not actually “install” java on your computer. Instead it comes with an already installed copy of the entire java install folder, which you see as the “jre” folder. Then the triplea.exe is slightly different because instead of just running the bin/triplea.jar file, it first qualifies this statement by telling it to run the jar file using the jre folder as the location of “java”.
To further explain, when you “install” java on your computer, it installs itself to a folder (usually program files/java/) and then it also sets a few environmental variables like JAVA_HOME, and also some “path” variables. Path variables (i may or may not be using the right terminology) tell your computer that when you run a terminal command (command line or batch file or script command) like “javac blah blah”, it will look for a program called “javac” in any of the folders in your path. If your path doesn’t include that, then you can not run such commands. What this means is that writing this command: java -version, is the same thing as specifying the full path for java, which would be something like “C:\Program Files\Java\jdk1.6.0_38\jre\bin\java” -version. So instead of relying on “path” which would only be set if you had installed java yourself, the “windows installer with java” has a “jre” folder containing a full copy of the latest java, and then the triplea.exe that specifies to specifically look in “…/jre/bin/java” instead of just calling “java”. Similarly, the linux and mac script files that run triplea could be modified to specify the /jre/ folder.
So, we should technically already be portable, even to a computer without java. Please let me know the results when you do the above things.
-
Thank you for your good explanation. I will try it out when I am at home this evening.
Additional questions before:
Following your instruction (jre folder on USB stick): Where are the downloaded maps and savegames stored, when there are no Java/system-related environmental variables?
I hope I can change Java related environmental variables via java.cpl in the Windows control panel. I never did that before. But how can I set environmental variables for Java when there is no Java installed on the System but only on the USB stick?
How can I force TripleA to save downloaded maps and savegames to a certain folder on the stick then?
Thank you again :-)
-
the maps can be put into the triplea/maps/ folder in the usb location of triplea
triplea always reads maps from 2 locations: the user folder, and the installed folder. so just put the maps you want with the installed folder and you’ll be fine
for savegames, you can put them anywhere. when you want to load them, just navigate there.
when you want to save, just navigate to where you want to save it tofor now, that is how it works
-
the maps can be put into the triplea/maps/ folder in the usb location of triplea
triplea always reads maps from 2 locations: the user folder, and the installed folder. so just put the maps you want with the installed folder and you’ll be fine
for savegames, you can put them anywhere. when you want to load them, just navigate there.
when you want to save, just navigate to where you want to save it tofor now, that is how it works
Right, I know that all. I try it with different words:
When I use the “Download Maps” feature of TripleA, the maps are saved in the user/maps folder. Automatic savegame-files are saved in the user/savegames folder when there is a Java installation with appropriate environmental variables.Now - following your approach having Java on the stick - where are the above mentioned files now?
Thank you again :-)
-
they are still where they normally go for now. you’ll have to move them over manually, or ignore them (like ignore the autosaves, or w/e)
in the future we can implement something better, but this is our portability right now
-
I could be wrong but I believe you can set the locations of things like “user.home”, etc, using environmental variables in java. TripleA just uses system properties like user.home, it doesn’t have a “hard set location” for where to look for your user folder, etc.
Right, but then isn’t that going to redirect every Java app that saves data to dump its files there, and not just TripleA?
-
As I was not able to find a way to change the environmental variable (for user/home) neither in Windows 7 nor in Java itself (on my win7 64 system),
I will try to use Triple A in a Portableapps-environment using jPortable and jLauncher on one of my Windows XP systems (without an installed JRE).
I will report what happens. -
I have found a solution and will edit the first post of this thread.
See
http://www.axisandallies.org/forums/index.php?topic=29595.msg1059900#msg1059900 -
@P@nther:
TripleA will now start. Download the maps you want using the “Download Maps” feature and start playing. You will find the downloaded maps as well as the automatic savegames on your USB-Stick in the following directory: Stick/PortableApps/JavaPortableLauncher/Data/AppData/triplea/
and NOT in any user/home directory on your system. So you can have your games on any windows machine without leaving data on the system itself.I got this far in the process before running into trouble. After I put in the SourceForge link to find the maps and hit
list games
, nothing further happens. I also can’t close out the dialogue box with the cancel button or theX
button. I have to use Task Manager to close TripleA if I want to try again.EDIT: I should note that if I skip trying to download a new map, I can launch and play a game successfully.
-
@Eggman:
@P@nther:
TripleA will now start. Download the maps you want using the “Download Maps” feature and start playing. You will find the downloaded maps as well as the automatic savegames on your USB-Stick in the following directory: Stick/PortableApps/JavaPortableLauncher/Data/AppData/triplea/
and NOT in any user/home directory on your system. So you can have your games on any windows machine without leaving data on the system itself.I got this far in the process before running into trouble. After I put in the SourceForge link to find the maps and hit
list games
, nothing further happens. I also can’t close out the dialogue box with the cancel button or theX
button. I have to use Task Manager to close TripleA if I want to try again.EDIT: I should note that if I skip trying to download a new map, I can launch and play a game successfully.
Hm, I just tested it again using my USB-stick - no problems.
Do you have a firewall/filter-rule that prevents javaw.exe from accessing the internet from your source?
Just to be sure about the download-link:
http://downloads.sourceforge.net/project/tripleamaps/triplea_maps.xml -
@P@nther:
Do you have a firewall/filter-rule that prevents javaw.exe from accessing the internet from your source?
Just to be sure about the download-link:
http://downloads.sourceforge.net/project/tripleamaps/triplea_maps.xmlI’m at a location where I can’t say what is happening exactly vis-a-vis filtering, but, I have been able to download maps via the TripleA install that is directly on the machine.
I had thought I could then just copy the map from PC to USB stick, but I can’t find it! Inside the
maps
folder that is in the same Windows user data area to which TripleA saves its data by default, there is a 1KbWorld War II Global.zip.properties
file, but there is no matchingWorld War II Global.zip
orWorld War II Global.xml
file in thatmaps
folder or themaps
folder in the directory where I installed TripleA right on the PC. -
I just downloaded a map directly so I’d know where the files were… I can get it recognized, when I try to start a game on that map Java crashes with a
too many files found
error. -
When installing a map directly from a “computer based” TripleA/Java the downloaded maps as well as the savegames are stored in a folder c:\Users"User"\triplea\…
You can easily verify this and/or access this directory using the TripleA “Open User Maps and Savegames Folder” button that is accessible via the “Engine Preferences” button in the starting dialogue.
From the stick installation - as mentioned above - you will find the downloads and savegames here:
Stick/PortableApps/JavaPortableLauncher/Data/AppData/triplea/You can easily verify this and/or access this directory using the TripleA “Open User Maps and Savegames Folder” button that is accessible via the “Engine Preferences” button in the starting dialogue, too.
Your problems sound like download errors. I would recommend to delete the maybe corrupt data from the above mentioned folders and try again.
You can of course download the map.zip directly from sourceforge and place them in any of the maps-folder:
As well in Stick/PortableApps/JavaPortableLauncher/Data/AppData/triplea/maps/
or in Stick/PortableApps/triplea_1_6_1_4/maps/Sidenote: The *.properties file is used to compare the map version installed with the map version provided via the triplea_maps.xml when using the built-in map downloader.
-
@Eggman:
I just downloaded a map directly so I’d know where the files were… I can get it recognized, when I try to start a game on that map Java crashes with a
too many files found
error.triplea hasn’t cared about “too many files found” since triplea 1.6. it was fixed with 1.6.1 I believe.
what version are you using, and what is the exact full error message? (copy and paste the whole message here, thank you)
-
triplea hasn’t cared about “too many files found” since triplea 1.6. it was fixed with 1.6.1 I believe.
what version are you using, and what is the exact full error message? (copy and paste the whole message here, thank you)
On a different machine I was able to have TripleA download and run the map successfully, so I don’t get the error anymore. My version is the latest, 1.6.1.4. I can try to fiddle with the install again to re-create the error if it’s important, but I’m just happy to have it working.
-
@Eggman:
On a different machine I was able to have TripleA download and run the map successfully, so I don’t get the error anymore. …
Good to hear!
-
For 64bit Windows Systems the 64bit JavaPortable and Java Portable Launcher can be installed, too.
Downloads:
http://www.axisandallies.org/forums/index.php?topic=29595.msg1059900#msg1059900 -
First posting updated to the new stable version of TripleA (1.7.0.3).