One begs to ask why MS designed the OS this way
In theory to prevent malicious programs from doing stuff. If one tries to do something naughty, you'll see a UAC prompt (unless you've turned it off) REally we should be blaming the virus and adware writers.Matt: Yeah, I want to write to a common folder not a user's folder so that highscores can be shared between users.
Here's some more info in different words:
http://msdn2.microsoft.com/en-us/library/aa905330.aspx
But it's saying the same old stuff.
I guess it's possible to embed a "manifest" into your game so that Windows thinks it's an installer and always prompts the user when it loads, and then it'll be able to write into the Common_AppData folder no problems. In fact, thinking about this, it only needs to be able to write into the Common_AppData folder once to make a subfolder for the game and to give it global permissions. Once that subfolder is made the game doesn't need to prompt any more. However, the problem with that is that if you embed a manifest, the only way to remove it is to change the actual exe code somehow!
Would having a UAC prompt appear everytime you run the game be a bad thing? Would it impact sales? Would customers be "worried" by it? If you were already an administrator the prompt would just ask permission. If you were not an administrator then you'd have to logon with administrator password everytime to play the game which would be annoying and in some cases maybe not possible when people aren't supposed to know the admin password.
Why do I want the app to make the sub-folder with special permission in Common_AppData? Couple reasons:
1) if a portal can't make their installer make the sub-folder (or you can't figure out how to make your installer do it) then the game has to be able to do it instead.
2) If you are making a demo and distributing just a .zip file with no installer, you might want the game to be able to do it.