UAC and multiple datadirs in Windows, pt 2

UAC and multiple datadirs in Windows, pt 2

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

UAC and multiple datadirs in Windows, pt 2

Post by Auswaschbar »

Hi,
I dug up this old topic http://spring.clan-sy.com/phpbb/viewtop ... =UAC+Vista
and ported springs UnixFileHandler to work with windows.

Now I need to know which directories should be searched for spring content. Also the order matters since spring will write everything (screenshots, demos) to the first existing writable directory.

I currently have the following (in this order):
  • the location of spring.exe (like it was before)
  • the directory configured in SpringData in the registry if this key exists, the users "My Documents" ("Eigene Dateien", dunno how its called in english versions) otherwise (in Spring-subdirectory)
  • all-users application-data ("Dokumente und Einstellungen\All Users\Anwendungsdaten\Spring")
  • environment variable SPRING_DATADIR
  • compiler flags SPRING_DATADIR and SPRING_DATADIR2
Discuss!
Attachments
patch.txt
Why are neither files without extension nor files with .diff or .patch allowed for upload?
(16.33 KiB) Downloaded 116 times
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: UAC and multiple datadirs in Windows, pt 2

Post by BrainDamage »

yay!

i think the dir setup is pretty much it, for the spring dir in the home of the users, m$ papers reccomends path\to\docs & settings\username\application data\spring (%appdata% env var)

the only trouble for users would be that such folder is invisible by default, but since windows users can just use the archivemover and springlobby's integrated downloads, i guess it would be as good as linux users :P

regarding unix settings format, do you allow global settings? i think many users would like to have a sorta "mobile install" on usb disk where spring only writes nowhere but the specified path
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: UAC and multiple datadirs in Windows, pt 2

Post by Auswaschbar »

Brain Damage wrote:the only trouble for users would be that such folder is invisible by default, but since windows users can just use the archivemover and springlobby's integrated downloads, i guess it would be as good as linux users :P
Thats why I have choosen "My Documents", because it is easy to find and not invisible (just the right dir for screenshots and stuff).

My intention was that the installer could install all engine-stuff in "Program Files", and maps and mods in $appdata. This would allow to have multiple versions of spring installed, while using the same maps / mods folders
Brain Damage wrote:regarding unix settings format, do you allow global settings? i think many users would like to have a sorta "mobile install" on usb disk where spring only writes nowhere but the specified path
If spring.exe is stored on usb-disk, and the spring directory is writable by the current user, it will write everything there (but will still look for content in the other directories).
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: UAC and multiple datadirs in Windows, pt 2

Post by LordMatt »

I am personally not sure of the benefits of spreading spring's files across multiple folders for windows users. I find this annoying for Linux (that I have to check 5 different places for conflicting files, some of which were the result of compile from source install, some which were the result of package install, and some that came from really old installs).
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: UAC and multiple datadirs in Windows, pt 2

Post by Peet »

Agreed, I'm all for everything being in /Spring/.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: UAC and multiple datadirs in Windows, pt 2

Post by BrainDamage »

LordMatt wrote:I am personally not sure of the benefits of spreading spring's files across multiple folders for windows users. I find this annoying for Linux (that I have to check 5 different places for conflicting files, some of which were the result of compile from source install, some which were the result of package install, and some that came from really old installs).
vista does it automatically per-se (putting them in millions of invisible nested folders), this actually allows to override the behaviour and puts the folder in a more visible place, ie, it's only an improvement, also as he said the program files folder will be used when possible
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: UAC and multiple datadirs in Windows, pt 2

Post by LordMatt »

Oh, I have zero experience with vista. :P
Radtoo
Posts: 50
Joined: 12 May 2006, 14:21

Re: UAC and multiple datadirs in Windows, pt 2

Post by Radtoo »

@LordMatt:
There's a lot of reasons to separe folders. Like that proper use of the recommended file hieararchies makes backups easier.
Or to ensure that only superusers put stuff into folders automatically accessed by all users.
Or to not have dozens of the same copy of a file all over the system when its easy enough to put that file into one shared folder.

The problem you have with unmanaged files is generally solved by the use of installers / package managers, not by putting every program into its own directory.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: UAC and multiple datadirs in Windows, pt 2

Post by AF »

Vista enforces read only access to program files as a security feature which they took from linux by default. Users should have the choice to use it as they currently do but the shared maps should reside in shared user space, not secure system space.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: UAC and multiple datadirs in Windows, pt 2

Post by LordMatt »

I'm sure there are reasons it's done the way it is. That doesn't make it any less annoying when you have 5 folders and have to search for the conflicting file. :P
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: UAC and multiple datadirs in Windows, pt 2

Post by Tobi »

Why have 5 anyway? Isn't system wide and user specific enough? Or maybe system, windows and user if you have content on partition shared between win & linux?

For windows it seems like it would be nice to have a folder like the Pictures/Music/Videos folders that exist by default. (ie. a windows standard location)
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: UAC and multiple datadirs in Windows, pt 2

Post by el_matarife »

All the user changeable stuff like maps, demos, config files, and whatever else gets written to by users should go into a file in the \users\ tree by default. I believe there's a few directories in there that allow access from all users on the PC which would be great for maps, but I think configs, demos, and logs and whatever else is more of a per user file should go into the My Games folder of the currently logged in user. If someone really feels the need to change the directories that's fine, but it should be the best practice by default. Anyway, as far as I know a portable USB Spring install won't work until we use XML config files instead of registry entries or something like that.

Also, there's going to be some nice benefits for fixing this on both XP and Vista, namely that backup solutions are going to be a lot more likely to work with Spring now, and you'll be able to transfer your install to new computers with the File & Settings transfer wizard. Also, administrator access will no longer be required on Spring, Archive Mover, TASClient, etc as long as they all only edit files in the /Users/ tree.
reivanen
Posts: 180
Joined: 12 Feb 2008, 15:52

Re: UAC and multiple datadirs in Windows, pt 2

Post by reivanen »

el_matarife wrote:All the user changeable stuff like maps, demos, config files, and whatever else gets written to by users should go into a file in the \users\ tree by default. I believe there's a few directories in there that allow access from all users on the PC which would be great for maps, but I think configs, demos, and logs and whatever else is more of a per user file should go into the My Games folder of the currently logged in user. If someone really feels the need to change the directories that's fine, but it should be the best practice by default. Anyway, as far as I know a portable USB Spring install won't work until we use XML config files instead of registry entries or something like that.

Also, there's going to be some nice benefits for fixing this on both XP and Vista, namely that backup solutions are going to be a lot more likely to work with Spring now, and you'll be able to transfer your install to new computers with the File & Settings transfer wizard. Also, administrator access will no longer be required on Spring, Archive Mover, TASClient, etc as long as they all only edit files in the /Users/ tree.
I dont think the users/public/ folder should be used, just users/username/documents/my games/spring and the actual (protected) install folder for engine core stuff.
Aside from that, i agree with your post!
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: UAC and multiple datadirs in Windows, pt 2

Post by imbaczek »

users/public would be good for shared data; maps especially tend to be big and duplicating them across users isn't a good idea IMHO.
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: UAC and multiple datadirs in Windows, pt 2

Post by el_matarife »

imbaczek wrote:users/public would be good for shared data; maps especially tend to be big and duplicating them across users isn't a good idea IMHO.
Yeah, that's why I suggested it. Also, I assume we should probably put mods and AI files there too. Everything else probably would benefit from being per user though, if you have multiple Spring players using one PC.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: UAC and multiple datadirs in Windows, pt 2

Post by smoth »

Peet wrote:Agreed, I'm all for everything being in /Spring/.
+1
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: UAC and multiple datadirs in Windows, pt 2

Post by FLOZi »

smoth wrote:
Peet wrote:Agreed, I'm all for everything being in /Spring/.
+1
And me.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: UAC and multiple datadirs in Windows, pt 2

Post by AF »

What I think people like smoth and flozi fail to realize is that this is not iron cast and can be changed arbitrarily, and that the insistence that things do not change for them is harmful to new users, while at the same time totally unnecessary as it wouldn't change for them anyway.

This is more about new users than meddling with existing setups. Its like stopping the enforcement of safety standards on houses because you dont want to do them, even though you live in a caravan.

We're discussing the default for new players not the default for all players, stop objecting to us changing your settings because thats not is being proposed.

However to those who insist on this despite it not affecting them, please offer an alternative solution rather than derailing the discussion.
Radtoo
Posts: 50
Joined: 12 May 2006, 14:21

Re: UAC and multiple datadirs in Windows, pt 2

Post by Radtoo »

I'm all for this patch. It's clever, maybe even necessary to enable the shared folders.

That doesn't mean that having a monolithic directory would be a problem after this patch! The UnixFileHandler covers for that just fine, because the Linux guys who nagged for this to be implemented (that includes me) wanted users to be able to install everything in their home folder or another designated folder on machines where they don't have access to any shared folders.

@Auswaschbar:
Explicitly set registry keys and environment variables should definitely have higher priority than spring.exe's location and such!
Such variables should override more "implicit" compiled in rules - this is also because it allows to override the default location order, not just to implement a new location.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: UAC and multiple datadirs in Windows, pt 2

Post by smoth »

so when a user tells me he wants to download gundam but cannot remember where to save it... blah blah blah.

I remember that you are all about this but I think it is colossally idiotic to use the windows user files. Those were designed for applications, you know like word or visual studio. Those things are different. Users storing maps and mods there is not a good idea. It complicates the install possibly even putting files on different hard drives.

Don't try and paint it like we stuck our heads in the sand and cried CHANGE BAD. You don't have to deal with content and the installation of said content past pulling the data into your lobby. We have to tell the users where to put it, help them figure out what the fuck their user directory is and then explain to them how it will not allow them to directly copy the spring directory over for lan parties. Because at said lanparty they will not only have to give their friends who are probably borederline computer ignorant what the fuck a user directory is. At which point people say the game is too hard to do at lans/install/figure out.

We already have to deal with DERP DERP where does I puts the mod when the mod directory is in the spring base dir.
Post Reply

Return to “Engine”