Page 1 of 1
How make a portable version?
Posted: 01 Nov 2009 09:56
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.
Re: How make a portable version?
Posted: 01 Nov 2009 10:08
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
Re: How make a portable version?
Posted: 01 Nov 2009 10:10
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.
Re: How make a portable version?
Posted: 01 Nov 2009 10:35
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!
Re: How make a portable version?
Posted: 01 Nov 2009 11:52
by Belsagor
Thank you very much, indeed simply!
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.
Re: How make a portable version?
Posted: 01 Nov 2009 11:56
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.
Re: How make a portable version?
Posted: 01 Nov 2009 13:07
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.
Re: How make a portable version?
Posted: 01 Nov 2009 13:31
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.
Re: How make a portable version?
Posted: 01 Nov 2009 17:44
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...
Re: How make a portable version?
Posted: 01 Nov 2009 20:55
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.
Re: How make a portable version?
Posted: 01 Nov 2009 22:08
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...
Re: How make a portable version?
Posted: 01 Nov 2009 23:33
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.
Re: How make a portable version?
Posted: 02 Nov 2009 09:27
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.
Re: How make a portable version?
Posted: 02 Nov 2009 11:54
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!!!
