Jump to content
  • Advertisement
Sign in to follow this  
EJH

Writing to files in Vista/XP (user accounts)

This topic is 3335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, in Vista your game cannot write to files outside of the user's personal directory (Documents and Setting/user) unless the game is run in Administrator mode. What is the best way to handle this? Any good tutorials on setting up the app and installer for it? Is there an easy way to dynamically determine the user's folder path in C#/XNA? Is it different in Vista/XP? [Edited by - EJH on June 2, 2009 11:00:34 AM]

Share this post


Link to post
Share on other sites
Advertisement
This covers all you need to know with regards to locations and what you should write where.

I'm sure C# has ways of accessing this folder information as well.

As for an installer, use something like NSIS to create it; the user will still need to run it as admin in order to write the files for the install, however after that if you've done things correctly with regards to where you write data they shouldn't have to after that.

Share this post


Link to post
Share on other sites
For XNA, you can just use the StorageContainer to figure it out for you. It will make sure user files get stored in an appropriate place.

Outside of XNA you typically use the System.Windows.Forms.Application class to handle this stuff for you, but you're probably not using that if you're using XNA.

Share this post


Link to post
Share on other sites
Windows XP also has restricted user accounts - do not assume that the current user running your application has write access everywhere.

Also, as a note to what phantom said above, you can create installers which do not require administrator privileges. In fact I think you should aim to make it possible - do not require administrator privileges for the installer if it is not technically required by what the installer needs to do.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!