Linux style settings under windows
Moderator: Moderators
Linux style settings under windows
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.
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
)
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
For XP:
or
Also, should work on XP:
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
Code: Select all
%HOMEDRIVE%%HOMEPATH%\My DocumentsCode: Select all
c:\Documents and Settings\%username%\My DocumentsCode: Select all
int Result;
char pPath[512];
LPITEMIDLIST pIDL = NULL;
Result = SHGetSpecialFolderLocation( (HWND)100, 0x5, &pIDL );
if ( Result == 0 ){
Result = SHGetPathFromIDList(pIDL, pPath);
}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.
why not just use %userprofile% ? I'm sure %mydocuments% or some other variable for My Documents is ebing added in Vista.AF wrote:For XP:
orCode: Select all
%HOMEDRIVE%%HOMEPATH%\My Documents
Also, should work on XP:Code: Select all
c:\Documents and Settings\%username%\My Documents
- Ling_Lover
- Posts: 100
- Joined: 26 Sep 2006, 11:50
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
- Ling_Lover
- Posts: 100
- Joined: 26 Sep 2006, 11:50
Re: Linux style settings under windows
i dont play it on a CD, but thats what the OP suggested...AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Linux style settings under windows
read again.Ling_Lover wrote:i dont play it on a CD, but thats what the OP suggested...AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
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.
Put it on a virtual machine.
http://www.vmware.com
VMServer should do the trick; if not, VMWorkstation may be "bought" very easily.
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.
- Ling_Lover
- Posts: 100
- Joined: 26 Sep 2006, 11:50
Re: Linux style settings under windows
I read it fine the first time, and don't see how he implied what you are saying that he was talking about...Forboding Angel wrote:read again.Ling_Lover wrote:i dont play it on a CD, but thats what the OP suggested...AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
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.
but i do agree, it is a good idea to get away from the registry
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.
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.
