Solved: How to use TripleA as a Portable App

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    @initial:

    Veqryn, I am wondering if TripleA can be configured to run as a portable app.
    Is there a way a user can define the location of the “User Maps and Savegame”?

    I think with the option to define this it would be possible to run TripleA from a USB stick
    using jportable/jportable launcher without leaving files on the system.

    (Please see http://portableapps.com/news/2013-01-13–jportable-7-update-11-released
    and http://portableapps.com/apps/utilities/java_portable_launcher ).

    Or are there any other system relevant dependencies?

    And this is how to do it:

    This is a user guide to run TripleA as a “real” portable app on Windows.

    Following this guide you can run TripleA for example from an USB-stick even if Java is not installed on the system.

    Any files that are created by TripleA (for example automatic savegames or downloaded maps that were installed using the “Download Maps” feature) will
    NOT be saved to the system but on the USB-Stick, too.

    So you won’t leave any files on the system you are using with your USB-stick.

    This is what you need:

    1. The PortableApps.com Platform to be found here:
    http://portableapps.com/download

    2. The Java environment in a portable version to be found here (32bit as well as 64bit):
    http://portableapps.com/apps/utilities/java_portable

    3. The Java portable Launcher to be found here (32bit as well as 64bit):
    http://portableapps.com/apps/utilities/java_portable_launcher

    and of course

    4. Triple A - the “All Platforms” version to be found here:
    http://sourceforge.net/projects/triplea/files/TripleA/1_7_0_3/triplea_1_7_0_3_all_platforms.zip/download

    Using the Java environment in a portable version (2.) has the advantage, that it is useful for every portable app software that needs Java, for example LibreOffice portable or OpenOffice portable.

    I am not going to describe anything related to the portable apps suite as it is well known and widely used. See the instructions on www.portableapps.com if you need further help. Or ask here.

    When you have installed the Platform, Java portable and Java portable launcher on the stick you need to add TripleA to the suite, too. Just unpack the zip File into the “PortableApps” subfolder on your USB-stick in which all your portable apps are stored. You will have a “triplea_1_6_1_4” directory there now.

    Now start your PortableApps platform. Find “jPortable Launcher” (under “Tools”) and execute it. Now browse to the tripleA subdirectory. Find the “triplea.jar” in the “bin” subdirectory and open it. (Do NOT use the triplea.exe!)

    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.
    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.

    You can of course install all of this on any drive with the same effects. This way you can profit from the automatic updates of all Portable Apps you are using.

    You need to update TripleA manually when a new version is released - do it the same way as the initial install described above.

    I tested this on my two Windows XP systems and a Windows 7 64bit system without problems.
    Without guarantee of course, use it on your own risk 😉

    A big thank you to Veqryn for providing interesting background information. That helped me a lot to understand the mechanisms.

  • '12

    I second this.  Somebody already made a request for such a feature in the tracking system on Source Forge.  Aside from the portability issue, it would help a lot to avoid having to keep pointing the app to where I really save my games every time I start it.

  • Customizer

    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.

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    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 🙂

  • Customizer

    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 to

    for now, that is how it works

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    @Veqryn:

    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 to

    for 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 🙂

  • Customizer

    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

  • '12

    @Veqryn:

    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?

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    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.

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    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

  • '12

    @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 the X 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.

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    @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 the X 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

  • '12

    @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.xml

    I’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 1Kb World War II Global.zip.properties file, but there is no matching World War II Global.zip or World War II Global.xml file in that maps folder or the maps folder in the directory where I installed TripleA right on the PC.

  • '12

    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.

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    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.

  • Customizer

    @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)

  • '12

    @Veqryn:

    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.

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    @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!

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    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

  • 2021 2020 '19 '18 '17 '16 '15 '14 '13 Official Q&A TripleA Moderator

    First posting updated to the new stable version of TripleA (1.7.0.3).

Suggested Topics

I Will Never Grow Up Games
Axis & Allies Boardgaming Custom Painted Miniatures
Dean's Army Guys

57
Online

15.1k
Users

35.9k
Topics

1.5m
Posts