How make a portable version?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Belsagor
Engineer
Engineer
Posts: 5
Joined: 01 Nov 2009 09:31

How make a portable version?

Post by Belsagor »

Hi!

What keys are necessary to be set at compiling, that all files contain only in game folder? It's needed to copy this folder on a flash drive and play at any computer.

Thank you.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: How make a portable version?

Post by planetmaker »

Belsagor wrote:What keys are necessary to be set at compiling, that all files contain only in game folder? It's needed to copy this folder on a flash drive and play at any computer.
No special preparation is necessary. Just copy the openttd folder and you're set. Make sure that your base graphics, base sound and desired newgrfs are in <openttd-folder>/data and your desired ais in <openttd-folder>/ai
User avatar
lawton27
Tycoon
Tycoon
Posts: 1418
Joined: 03 Aug 2009 14:29
Location: Manchester

Re: How make a portable version?

Post by lawton27 »

I'm not 100% sure of what you mean, but if you want a running version on a flash drive go to program files and copy the folder called 'OpenTTD'.
Paste it wherever you feel like, it doesn't matter, I presume a flash drive, then on any computer to run it open the folder on you flash drive and run openttd.exe (it will just appear as a file called openttd with the OTTD log, double click on it).

Simple realy, have fun.
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: How make a portable version?

Post by Gremnon »

To simplify what they both just said:

Take your install of OpenTTD. Copy it to your USB Drive, which we'll call U (For USB).
Go to where your openttd.cfg is stored for your local game. Copy that into the same folder as the binary on U
Go into both AI and Data on your local copy, and copy any AIs and/or newGRFs to AI/Data (Whichever you got them from) on U
Done.

OPTIONAL: If you use OpenTTD on more than one OS (EG Windows and Linux, like I do) You may copy the binary for each to the same place on U, as they will not over-write each other. They will both use the same openttd.cfg, and other files on U.

Simples!
Belsagor
Engineer
Engineer
Posts: 5
Joined: 01 Nov 2009 09:31

Re: How make a portable version?

Post by Belsagor »

Thank you very much, indeed simply! :D

But, want to understand, as will make own patchpack.

How to do that at the first run a game did create configuration and work folders only in the own folder? As far as I remember, before it was just like this. Actually question, how to do that a game used the own folder only, and never read or write in other.
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: How make a portable version?

Post by Gremnon »

If the binary finds openttd.cfg in the same folder as it, it'll read from there before it reads anywhere else.

There's an entire section in the readme that comes with OpenTTD that explains the order in which it reads files, I think if you read it, it'll help you understand how and why a portable version works the way it does.
Belsagor
Engineer
Engineer
Posts: 5
Joined: 01 Nov 2009 09:31

Re: How make a portable version?

Post by Belsagor »

How to do portable version from binary I already understood and checked. A question is in other, how immediately make only portable version.

Here in a file cohfig.lib found a variable personal_dir="1", if to set 0, will ok or it not enough? Exist variable with_personal_dir, is it also needed to set in a zero? In a wikki answer did not find.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: How make a portable version?

Post by planetmaker »

As stated before: You don't need to (nor should for this reason) change anything wrt the default compile settings. It all works out of the box. Even the binaries downloaded from OpenTTD site do so. Just copy it from your HD onto your stick and you're done. No special compile, setting or anything else is needed.
zedd
Engineer
Engineer
Posts: 74
Joined: 13 Mar 2007 02:38

Re: How make a portable version?

Post by zedd »

But it does put the configurations and savegames in My documents/OpenTTD by default.
I think this is what he wants to chance ... and gl with it cause using My documents is retarded.
Well maybe not since it is impossible to use My documents for documents anyhow since every game and a bunch of apps insist on spamming everything in there so you will never find your work...
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: How make a portable version?

Post by Gremnon »

If you run it from a USB key, that has the openttd.cfg on it, it will save and load to the USB Key. I have tested this myself. Try it yourself, in exactly the same way.
zedd
Engineer
Engineer
Posts: 74
Joined: 13 Mar 2007 02:38

Re: How make a portable version?

Post by zedd »

Gremnon wrote:If you run it from a USB key, that has the openttd.cfg on it, it will save and load to the USB Key. I have tested this myself. Try it yourself, in exactly the same way.
Yeah, but you still need to move the config file there after launching the program first time.
I would think it easier to include the config file in this portable version distribution then to chance the code though, just launch once, move the file and make the copies after.
Unless you for some bizzare reason need to give out source code compile yourself portable versions to many people...
User avatar
bigos
Traffic Manager
Traffic Manager
Posts: 181
Joined: 13 Sep 2009 21:15
Location: Poland
Contact:

Re: How make a portable version?

Post by bigos »

I think he is looking for this:
"openttd.exe" -c openttd.cfg
Then game will not make default catalog in "my documents" only run all files from directory it is. Of course data, ai, scrits and gm folders should be where openttd.exe is.
Belsagor
Engineer
Engineer
Posts: 5
Joined: 01 Nov 2009 09:31

Re: How make a portable version?

Post by Belsagor »

Gremnon, thank you. I checked up this method already, he works. About what talked in post № 5.

bigos, not quite.

I simply wanted to build(make,compile) the program, which keeps all information only in one folder.

It's a pity that nobody can help. :(

Explain. I very dislike that games for storage of data use a folder "My Documents". Yet create the heap of subfolders there. And "My Documents" grow into a dump. I love when on my computer order. All lies on the places. Games on a HD with games. Program on a HD with program. Operating system on own HD. And when the program scatter the files on all disks, me it disorders. Yes, it is perfect me incomprehensible. Seems, times when a computer was rareness, passed a long ago. The personal computer is indeed personal now. And desire of all programs to keep all information in the single folder on a system disk, and main not asking permission for an user, very strange.

Heh, however it already offtop.
Belsagor
Engineer
Engineer
Posts: 5
Joined: 01 Nov 2009 09:31

Re: How make a portable version?

Post by Belsagor »

On the Russian forum found a man which knows as it to do!
Simply it is needed to set one key during configuration!

Happy!!! :D :D :D
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests