Jump to content

Installation Directory Of The Game


ribez
 Share

Recommended Posts

Just a curiosity: searching for the folder to install user created maps, i've discovered that the installer install the game in this directory:

C:\Users\RiBeZ\AppData\Local\0 A.D. alpha\

and not in the Program directory. Why?

I've Windows 7 64 bit.

thanks

Link to comment
Share on other sites

The Program Files directory requires admin access to modify, and the game's installer tries to avoid asking for admin access (because that's inconvenient and insecure) - it's like when programs offer an option of "install for everyone" or "install for this user", but (for simplicity) it only supports the "install for this user" option. As far as I'm aware, %localappdata% is then where per-user installation is meant to go (on Vista / Win7).

Link to comment
Share on other sites

  • 3 months later...

The Program Files directory requires admin access to modify, and the game's installer tries to avoid asking for admin access (because that's inconvenient and insecure) - it's like when programs offer an option of "install for everyone" or "install for this user", but (for simplicity) it only supports the "install for this user" option. As far as I'm aware, %localappdata% is then where per-user installation is meant to go (on Vista / Win7).

Ok... That's nice and all... Prob is that for many win7 users that C:\Users\...\AppData\... dir is hidden and unreachable in the normal user mode... The right place to put ANY program is in the Program Files dir, and user files such as config's can be auto writen by the prog in the /appdata/. User data as mod's etc. should be written to the user's /My docs/ dir. As far as I know, that is how Win7 want's it.

Link to comment
Share on other sites

Ok... That's nice and all... Prob is that for many win7 users that C:\Users\...\AppData\... dir is hidden and unreachable in the normal user mode... The right place to put ANY program is in the Program Files dir, and user files such as config's can be auto writen by the prog in the /appdata/. User data as mod's etc. should be written to the user's /My docs/ dir. As far as I know, that is how Win7 want's it.

I agree, the user data should be more accessible than it currently is :)

Link to comment
Share on other sites

I am happy to change our "appdata" directory to any standard Windows location.

Please see the documentation for SHGetFolderPath:

http://msdn.microsoft.com/en-us/library/bb762181(v=vs.85).aspx

We are currently asking for CSIDL_APPDATA - see wutil.cpp:294.

Which one would be preferable?

(Although this function is "deprecated", note that the

newer known-folder functionality is only available

starting with Vista, which is unacceptable for us.)

Link to comment
Share on other sites

I am happy to change our "appdata" directory to any standard Windows location.

Please see the documentation for SHGetFolderPath:

http://msdn.microsoft.com/en-us/library/bb762181(v=vs.85).aspx

We are currently asking for CSIDL_APPDATA - see wutil.cpp:294.

Which one would be preferable?

(Although this function is "deprecated", note that the

newer known-folder functionality is only available

starting with Vista, which is unacceptable for us.)

How about CSIDL_PERSONAL aka My Documents? I think that's the best location for games to store data because it's easily accessible from several locations (start menu, any explorer window, etc.)

Link to comment
Share on other sites

That or My Document\My Games imho :) They seems to be used about as commonly as far as I can tell looking in my folders :) (Though on the other hand most games I have installed are Steam games which have their user files in all kinds of places, mostly in the Steam folder in Program Files. Not a good choice imho though, so let's not follow their example. Especially since we intend to have the game moddable :) )

Link to comment
Share on other sites

Requirements for the Windows Vista Logo Program for Software says

Applications should be installed to Program Files or the user’s AppData folder by default.

Windows 7 Client Software Logo Technical Requirements & Program Eligibility says

Applications should be installed to the Program Files folder by default. User data or application data must never be stored in this location because of the security permissions configured for this folder

All application data that must be shared among users on the computer should be stored within ProgramData

All application data exclusive to a specific user and not to be shared with other users of the computer must be stored in Users\<username>\AppData

Some guy says

The most important difference between My Documents and Application Data is that My Documents is where users store their files, whereas Application Data is where programs store their files.

I think:

* cache should go in LOCALAPPDATA

* config should go in APPDATA (users shouldn't need to edit it manually)

* logs should probably go in LOCALAPPDATA since it doesn't need to support roaming

* screenshots should go somewhere under MYDOCUMENTS (don't know exactly where)

* If we used "MYDOCUMENTS\My Games", does "My Games" need to be localised into other languages to be consistent with what other games do?

* Saved games should go somewhere under MYDOCUMENTS

* A user's local mod (with their saved maps etc) should go somewhere under MYDOCUMENTS

* Mods installed from remote sources should go in APPDATA

* I don't like the installer asking for admin privileges simply to install in Program Files (and if we have an auto-updater that'd need to ask for admin privileges too), so still install the game into APPDATA

or something like that.

If we make any changes to paths, remember to update source/tools/dist/0ad.nsi appropriately.

Link to comment
Share on other sites

A quick search reveals:

As of 2010 "My Games" (or "Saved Games" since Windows Vista) is becoming an increasingly common place for games (especially those published by Microsoft Game Studios) to store a player's saved game and settings files
(http://en.wikipedia.org/wiki/My_Documents)
More generally: PERSONAL\My Games\Oblivion

Note that "My Games" does not localize.

Programmers can use the aforementioned SHGetFolderPath API function to get the value of PERSONAL.

(http://www.uesp.net/wiki/Oblivion:Directories)

I agree that PERSONAL (i.e. My Documents) is more appropriate for anything the user would want to see, and IMO that includes log files (especially crashdump) and at least for the moment config, because people are indeed changing them.

As per the above, we can gladly tack on a non-localized "My Games".

However, it would be nice to simplify your suggestion.

The current interface for returning paths requires a bit of boilerplate

to safely handle being called before static ctors, so adding interfaces for

both localAppData AND Personal would be a bit onerous.

Do we really care about the distinction between local and roaming? Does anyone actually use that? (Ever since we switched to a group policy at work whereby the desktop and my documents are stored on a server, Windows is rather slow to start unless I keep both of them very much empty ;) )

I'm also not sure why saved games need to go in My Documents, since those are managed by the game. I imagine the only use for putting them in My Documents is being able to delete them easily. However, I don't see any harm in putting them in My Documents.

Here's a revised proposal:

Appdata: installation, cache, maybe remote mods (unclear who writes it there, though)

My Documents/My Games/0ad: config, logs, screenshots, saved games, local_mod

Sound good?

(@Philip: I hope this topic doesn't distract you for more than 5 minutes ;) )

Link to comment
Share on other sites

I agree that PERSONAL (i.e. My Documents) is more appropriate for anything the user would want to see, and IMO that includes log files (especially crashdump)

I don't agree that that's agreeing :P. "My Documents is where users store their files" is not saying it's where applications store files that users want to see. I think My Documents is appropriate when the user has taken an explicit action to create a file (and so they won't be surprised when a file appears in My Documents), and that doesn't include log files since the user has never chosen to save a log file.

When the problem is that we want users to find some files (and in this case only a tiny proportion of users, since most should never get crashes and most of the rest won't bother reporting them anyway), simply telling them "open %appdata%\0ad\logs\ in Explorer" is no more complex than telling them "open My Documents (or Documents if on Vista/Win7, or the equivalent in your language) then My Games then 0 A.D. then logs". (Users will never want to look for these files on their own initiative, it'll only be in response to us telling them to look for them, so there's no value in the location being intuitive.)

and at least for the moment config, because people are indeed changing them.

I'm assuming a hypothetical future in which we have a working config system and users will never edit them by hand. Don't have much of an opinion on what we should do before then, since that's only temporary :)

However, it would be nice to simplify your suggestion. The current interface for returning paths requires a bit of boilerplate to safely handle being called before static ctors, so adding interfaces for both localAppData AND Personal would be a bit onerous.

It only looks like about 20 lines of code per path, so I think it's more important to choose whatever's the optimal file layout from a user/platform-convention/etc perspective without caring about whether it saves a trivial amount of implementation complexity.

Do we really care about the distinction between local and roaming? Does anyone actually use that? (Ever since we switched to a group policy at work whereby the desktop and my documents are stored on a server, Windows is rather slow to start unless I keep both of them very much empty ;) )

If we stored cache data in (roaming) appdata then Windows would take even longer to start, so isn't that a good reason to keep the distinction?

I'm also not sure why saved games need to go in My Documents, since those are managed by the game. I imagine the only use for putting them in My Documents is being able to delete them easily.

People might want to share them with other people online, or back them up, I guess. Probably not very often, but they seem to match the desired semantics of being files that the user actively chose to store.

(I forgot about recorded games; those should go in My Documents too.)

My Documents/My Games/0ad

Ought to be written "0 A.D.", as long as the trailing "." doesn't cause problems. (It caused problems with NSIS at least, hence the use of "0 A.D. alpha" for the installation directory and start menu folder.)

Link to comment
Share on other sites

I think the advantage of My Documents is that it's a.) accessible for Windows users who are used to thinking in these terms (many don't so much know or care what a folder even is), and b.) it's portable, so it should be possible to copy it all over to a USB flash drive and onto another computer or back again, and not be broken, even if 0 A.D. needs (re-)installing. App data by comparison is very obscure, even if we could spoon-feed instructions on how to access it, why should we have to?

I don't agree that that's agreeing :P. "My Documents is where users store their files" is not saying it's where applications store files that users want to see. I think My Documents is appropriate when the user has taken an explicit action to create a file (and so they won't be surprised when a file appears in My Documents), and that doesn't include log files since the user has never chosen to save a log file.

To use the example of another free open source multiplatform game, OpenTTD, they install the game in Program Files (minding whether it's the 32- or 64-bit build), and then My Documents\OpenTTD is used for all content downloaded in the game, crash dumps, logs, saved games, scenarios/maps, and config files - anything created while the user plays the game. Not that we have to copy what others do, but it's a least some precedent.

People might want to share them with other people online, or back them up, I guess. Probably not very often, but they seem to match the desired semantics of being files that the user actively chose to store. (I forgot about recorded games; those should go in My Documents too.)

This is a very good point, and I back up My Documents every week :)

I'm assuming a hypothetical future in which we have a working config system and users will never edit them by hand. Don't have much of an opinion on what we should do before then, since that's only temporary :)

So shouldn't we make it easy to back up config too? Nothing worse than having to change all your settings after losing everything...

Link to comment
Share on other sites

Given that "nothing endures longer than temporary measures", I suggest we make config visible (i.e. storing in PERSONAL) for now, and I don't see any harm in making it permanent.

(Users will never want to look for these files on their own initiative, it'll only be in response to us telling them to look for them, so there's no value in the location being intuitive.)

hehe. I actually know one crazy dude who has started 0ad with the express intention of having system_info.txt generated (there's some info there not provided by dxdiag).

Besides the issue of intent, I think the frequency of error reports might increase slightly if users have already seen those files when browsing through the personal folder.

And finally, what is the harm in putting anything of potential interest to the user in My Documents? I actually see a benefit: folders outside of that are potentially wiped out if someone does a system restore, whereas anything within My Documents is safe.

(This argument also applies to storing saved+recorded games in My Documents, which I now endorse.)

As to local vs roaming: I might actually change the interface to call the Windows function directly, since we call those functions exactly once. That would get rid of the boilerplate concern.

However, what I suggest is just storing everything in local. Who is going to expect a game they installed on two computers to maintain the same config on both? It's not even clear to me that that is a good thing (monitor resolution may differ). And I don't know if there is a Linux version that supports the same. If not, people would have to copy the config dir anyway.

Ooh, I am a bit concerned about the "0 A.D.". We're already buying into the "let's pray we support spaces correctly" game with "My Games", but at least that has a decent chance of success on Windows. However, if you change from 0ad, we should probably also rename it on other platforms, and that might also cause problems.

Is it that important? I don't mind 0ad, and precedent for that exists in the form of our URL.

Update (I hadn't seen Ben's post)

My Documents\OpenTTD is used for all content downloaded in the game, crash dumps, logs, saved games, scenarios/maps, and config files - anything created while the user plays the game. Not that we have to copy what others do, but it's a least some precedent.

Thanks for the example! To be clear, I would think it is good to store potentially bulky and unimportant stuff (i.e. the cache) outside of my docs, because otherwise we would unnecessarily slow down any backups users make of it.

But pretty much everything else in my docs? Sounds good to me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...