DTavaszi
DTavaszi

Reputation: 192

Converting C# app from WinXP to 7: How to make it not require admin privileges?

I have a program designed to work in XP, but with Windows dropping support for the OS, it's time to upgrade.

The location is in Program Files(x86), so when I run it without Admin privileges, it can't read/write library/assembly files within its folder.

What are my options?

Found this link helpful:

Allow access permission to write in Program Files of Windows 7

Upvotes: 2

Views: 133

Answers (1)

David Heffernan
David Heffernan

Reputation: 613451

Since Vista was released in 2007, UAC has meant that users do not have rights to write to the program files directory, unless the program is run elevated. You need to locate the files that need to be modified somewhere else.

Exactly where those files should be located, I cannot say. Perhaps under the user profile, perhaps somewhere else. It would require some detailed knowledge of how your application operates to give more specific advise. And quite possible your application will need some re-design in order to work well with UAC.

On the other hand, you say that your application can't access library files within its folder. If all you are trying to do is read these library files, there will be no problem, even in modern versions of Windows. It seems plausible that you have not yet fully diagnosed the problem. It seems likely that your application is trying to write to a restricted location. But reading library or assembly files should be fine, even with restricted access under UAC.

So perhaps the problem is not the reading of these library files. Perhaps the problem is that your application is writing to the program files directory, or some other restricted location. You'll need to do a little debugging to diagnose exactly which parts of your application are failing.

Upvotes: 7

Related Questions