Trainz portable at an external harddrive

ek.skirl

Active member

The idea​

In my case I tried to have Trainz installations on a harddrive to use it on any fitting pc/notebook and of course to have all my works with me.

The use case​

On any pc/notebook there is a link to start the portable installation and the paths of this installation are added to the profile file inside the AppData folder of Trainz. This link works only if the fitting harddrive is available. Also there are two folders on the portable drive: one for the Trainz apps and one for the Trainz appdata.

The background informations​

Each Trainz installation consists of two file folders, a text file, containing the corresponding paths, and of course a link for the launcher on the desktop.
In its properties one will find the installation path of a Trainz installation. In the users appdata folder one will find the absolute path in the "userdata-redirect-map.txt" file as well as the absolute path to the users build folder.
One very important hint: Unlike the paths with backslashes ("\") that Windows uses, here the folders are separated by slashes ("/")!
The app-folder is the install folder of the Trainz core code, the data-folder cares about the user"s Trainz instance data and the profile file tells Trainz where the fitting folders are.
This knowledge makes it possible to make Trainz portable.

The solution draft​

The Trainz installation folder is that folder with the Trainz start file "TRS22.exe" in case of Trainz 22, in case of Trainz 19 it is "TRS19.exe". The builds of Trainz 22 and Trainz 19 reside in different subfolders inside the user appdata local N3V Games in the trs22, respective trs19 folder. Following this there are different "userdata-redirect-map.txt" files.
The appdata folders have names similar to "build xxxxxxxxx". The "xxxxxxxxx" is a cryptic looking, randomly created character array of letters and numbers. Every new or additional installation gets its own randomly created "xxxxxxxxx".
So very essential at all is to find the fitting folder pairs. Have a look into the "userdata-redirect-map.txt" file inside the user"s appdata folder "%AppData%\..\Local\N3V Games\trs22", respective "%AppData%\..\Local\N3V Games\trs19".
The fitting path pairs have to be written in the "userdata-redirect-map.txt" file, one pair per line. Firstly, the path to the Trains app and secondly, the path to the build folder.

Steps for the draft solution​

The following steps are to be done:
  1. Set your harddrive to a fixed drive letter (here: P for portable).
  2. Create two folders (here: "P:\TRAINZDATA" and "P:\TRAINZAPPS").
  3. Create in TRAINZDATA an initially empty text file called "userdata-redirect-map.add".
  4. Copy the fitting build folder content to "P:\TRAINZDATA" and the fitting installation folder content to "P:\TRAINZAPPS".
  5. Write into the "userdata-redirect-map.add" file, a line per portable installation path pair, adjusted to "P:\TRAINZAPPS" and "P:\TRAINZDATA". Remember using the slash instead of backslash. This file is for copy&past the fitting line to append it to the pc/notebook's "userdata-redirect-map.txt" file.
  6. Add per installation one starting link for the desktop with the absolute path to the Trainz start exe file in the copied Trainz app folder at drive P. This link is for copying too.

Use case pc/notebook without any earlier Trainz installation​

For now I don't know if our Trainz copies are running out of the box on a pc/notebook. If not it's necessary to install a Trainz version.
It looks like the calling of trains will generate the AppData folder, but with the content of the "userdata-redirect-map.txt" file, that has to be adapted to the portable drive.

Last but not least a very important hints​

Note the content of the original profile file and backup the build folder(s). Note the fitting Trainz version. Be careful.
The random parts of the build folder are useful to identify the Trainz installations.
Although I have tested the described procedure to the best of my knowledge, I do not provide any guarantee whatsoever.
Please, do the things at your own risk! I expressly disclaim any liability for this.
 
I have installed Linux together with T:ANE and with TRS19 on USB SSD's a number of times previously for use while away from home quite successfully, and while I haven't tried TRS22 I suspect it would be comparable to TRS19 having such similar OS requirements.

As for Windows 10/11 I would have thought using the likes of WinToUSB or Rufus or even an old copy of Windows to Go similar results could be achieved subject to the availability of a speedy USB port. Peter
 
I have installed Linux together with T:ANE and with TRS19 on USB SSD's a number of times previously for use while away from home quite successfully, and while I haven't tried TRS22 I suspect it would be comparable to TRS19 having such similar OS requirements.

As for Windows 10/11 I would have thought using the likes of WinToUSB or Rufus or even an old copy of Windows to Go similar results could be achieved subject to the availability of a speedy USB port. Peter
May I ask how you were able to set up Linux and Trainz on an external hard drive? As you know I've been running Trainz in Linux for some time now, but I didn't know it was possible run it from an external hard drive.
 
On a first fly I think you should mount the harddrive inside Wine environment and using the same principles than as above?

But Linux I didn't proove yet.
 
May I ask how you were able to set up Linux and Trainz on an external hard drive? As you know I've been running Trainz in Linux for some time now, but I didn't know it was possible run it from an external hard drive.
Connect the external drive and start your install process in the usual way from your bootable Linux media. When you get to the step where it asked for 'Installation Type' choose 'something else'. On the next window choose the external drive (with extreme care as not to wipe out the wrong drive) and delete any existing partitions by right clicking on them.

Next right click in the free space and create a new partition at the beginning of the space of 500MB and format it as an EFI System Partition.

If you wish you can now create an optional second partition as a Swap partition, people say between 2-10GB but if you have plenty of RAM they are seldom used and fewer distros are creating them by default.

In the remaining space create a final partition to Ext4 and set its mounting point to / .

You should now be able to select the external drive to install Liuux on and complete the installation process in the usual way with name, password etc.

I'm not a lover of boot-loaders as they go wrong too often and hence my preferred way of booting from external drives, USB sticks etc. is to use the computers boot menu via the relevant hot key at start-up. While booting and Trainz up and running all takes that bit longer, and performance will never be as good as if installed on the host machine as a portable option results can by quite respectable. Hope this helps, Peter
 
I've done it for years. I shortened the data folder to TRS22_DATA.

I installed TRS-PLUS on my laptop and then pointed the Install location to the data-folder located on the external drive. I didn't even have to do a database repair or log in. TRS-PLUS found everything right off the bat.

At one time, I tried a network share using a mapped network drive. This worked okay but it was way too slow, in T: ANE and now it doesn't work at all due to something changing in TRS-Plus or TRS22 that prevents the network share from working.
 
Back
Top