Linux style settings under windows

Linux style settings under windows

Requests for features in the spring code.

Moderator: Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Linux style settings under windows

Post by AF »

Could it be possible to allow windows users to use the config file that Linux users have rather than the registry? It wouldn't require much to change, and it would allow proper portable copies of spring on usb and CD/DVD.
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Post by Michilus_nimbus »

Agree.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

+1 for minimizing registry dependence, but I seriously don't envy whoever'll get chosen to rewrite the source for the settings tool. ;)
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Windows Registry for the loose.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

A tdf file type replacement wouldnt require all that much effort tbh.

Is the linux config TDF or just a textfile of this=that this=that etc?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Just a variable=value textfile.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

ah, that'd be easy. Just yank the code in spring in confighandler.cpp out, and make the settings app call that instead of registry calls..
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

It isn't difficult to do, but you've missed something important: where to put the
config file? You'll probably want to have different config files for different users on
the same machine, but Windows does not have the same concept of $HOME as
does unix. A call to SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &idlist)
and SHGetPathFromIDList(idlist, dir) with an appended directory will probably do the
trick. I've also heard of there being problems using that location for when user dirs are
on network shares, but I forget the details (gladly, as I have no love for windows code ;-))
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

For XP:

Code: Select all

%HOMEDRIVE%%HOMEPATH%\My Documents
or

Code: Select all

c:\Documents and Settings\%username%\My Documents
Also, should work on XP:

Code: Select all

int Result;
char pPath[512];
LPITEMIDLIST pIDL = NULL;

Result = SHGetSpecialFolderLocation( (HWND)100, 0x5, &pIDL );

if ( Result == 0 ){
	Result = SHGetPathFromIDList(pIDL, pPath);
}
That way you'd load and save from a spring folder in my documents.... It might also be useful for the lobby to save logs there too.

Tho preferably I'd like to be able to tell spring to load from the spring folder....

also for a windows 98 and above compliant method:

http://msdn.microsoft.com/library/defau ... erpath.asp

Actualy if you ever want to have the windows xp logo on your product you MUST save your savegames inside the Documents and settings/application data folder otherwise microsoft will not qualify it as an nice windows application.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Post by ZellSF »

AF wrote:For XP:

Code: Select all

%HOMEDRIVE%%HOMEPATH%\My Documents
or

Code: Select all

c:\Documents and Settings\%username%\My Documents
Also, should work on XP:
why not just use %userprofile% ? I'm sure %mydocuments% or some other variable for My Documents is ebing added in Vista.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

we cant expect spring users to upgrade to vista.

Besides, the method linked ot by the msdn site seems to be the way togo, and doesnt require us to lookup the environment variables before passing them to the loading code.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Bah, just save it in the Spring folder under Spring\config\~username and be done with it. That way your portable copy also carries the configs for each user.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Indeed, have it be as self-contained as possible so the only API-call needed is to get the username; that way you also eliminate up-front any issues with '98 and Vista storing userdata in different places etc.
User avatar
Ling_Lover
Posts: 100
Joined: 26 Sep 2006, 11:50

Post by Ling_Lover »

but if it's on a CD then you cant save it in spring's directory...
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

Ling_Lover wrote:but if it's on a CD then you cant save it in spring's directory...
a 8 gig harddrive will only cost you 5 - 10 bucks.

get the hell outta here.
User avatar
Ling_Lover
Posts: 100
Joined: 26 Sep 2006, 11:50

Re: Linux style settings under windows

Post by Ling_Lover »

AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
i dont play it on a CD, but thats what the OP suggested...
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Linux style settings under windows

Post by Forboding Angel »

Ling_Lover wrote:
AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
i dont play it on a CD, but thats what the OP suggested...
read again.

he was talking about copying your spring to a dvd and taking it with you so that you could copy it onto another machine and play off of that, or inversely, you could have it all set up and play from the dvd anywhere.

The point is Registry independance, and it's a damn good idea.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Put it on a virtual machine.

http://www.vmware.com


VMServer should do the trick; if not, VMWorkstation may be "bought" very easily.
Last edited by Dragon45 on 27 Nov 2006, 12:28, edited 1 time in total.
User avatar
Ling_Lover
Posts: 100
Joined: 26 Sep 2006, 11:50

Re: Linux style settings under windows

Post by Ling_Lover »

Forboding Angel wrote:
Ling_Lover wrote:
AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
i dont play it on a CD, but thats what the OP suggested...
read again.

he was talking about copying your spring to a dvd and taking it with you so that you could copy it onto another machine and play off of that, or inversely, you could have it all set up and play from the dvd anywhere.

The point is Registry independance, and it's a damn good idea.
I read it fine the first time, and don't see how he implied what you are saying that he was talking about...

but i do agree, it is a good idea to get away from the registry
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

yuk, I have no intention of trying to use vmware.

I'm not running spring in a program I have to reboot to install only to find that C drive has been reset back to a pre-stored cache making it impossible to use.

And I ain't lugging around another 4GB of virtual HD, after spending several hours installing XP to it.

All the code to load and save to the spring directory is already in place and just needs moving around, the only new stuff needed would be the call to retrieve the windows user name.
Post Reply

Return to “Feature Requests”