File locations for Standard Users

Mar 27, 2009 at 3:38 PM
On a Windows 7 machine (and presumably Vista would work the same), the "Windows" folder is locked down for standard users.
When the OAR starts under a non-administrator, it gets a Fatal Error "Access to the path c:\windows\system32\oardiag0973.log is denied".
Maybe the log and word list could go in either the APPDATA folder or the USERPROFILE, I'm not sure which is more correct (and whether they would work on XP).

Coordinator
Mar 27, 2009 at 5:19 PM
We already know about this as its been already reported. As of now we have to have run the Outlook as Admin or turn off UAC. The problem is if I try to save the log to another directory that might have same restriction.

Regarsd,
GD
Jun 3, 2009 at 1:15 AM
Edited Jun 3, 2009 at 1:22 AM

In your code, use Environment.SpecialFolder.ApplicationData instead of Environment.SystemDirectory.  The problem you're running into is because you're not making use of the built-in .NET features which tell you which directory is guaranteed writable for your application regardless of whether the user is running Windows CE, XP, Vista, 2008 Server, or Windows 7.  Using the Environment.SpecialFolder.ApplicationData enum means that your settings will work anywhere, and that it will work even if the user is using a roaming profile.

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

As a worst-case scenario, you could have used System.IO.Path.GetTempPath which is also guaranteed writable, though it may get cleared from time to time.  Way better than forcing people to alter the way they run Outlook or modifying their entire OS to make it less secure!

Coordinator
Jun 3, 2009 at 12:15 PM

Hello Wanderling. Thanks a lot for the suggestion. Would really help me. Its just that I always intended to use System directory for storing the logs. Now that I am recieving issues with many people in Vista (and would be same in Win7). I will incorporate the change to write a user writable directory in the next version of the release

Coordinator
Jun 10, 2009 at 8:05 PM

The new version has the required change. Now Vista and Win7 users wont be facing the issues