0

I have built an application using C# which accesses the registry and installation folder for read/write information. A normal user having limited privileges is getting an error while accessing/writing the information (in registry or installation folder).

Is there a way in which all types of users are able to run that application smoothly?

Mr Fooz
  • 103,571
  • 5
  • 68
  • 100
Farukh Zahoor
  • 117
  • 12
  • 2
    It sounds like you might be using the wrong locations for certain types of data. During normal usage, you shouldn't be writing data to your install location. [MS Guidelines](http://download.microsoft.com/download/e/6/a/e6aa654f-cccb-421e-9b50-3392e9886084/VistaFileSysNamespaces.pdf) – Damien_The_Unbeliever Aug 03 '12 at 08:02

2 Answers2

0

It is possible, although it's not completely straightforward. You're gonna have to impersonate another user (who, in turn, has to have all the required privileges).

Check this question for details: Windows Impersonation from C#

Community
  • 1
  • 1
Alex
  • 22,585
  • 4
  • 38
  • 71
0

There are two ways, the simple and complex. First - install the program per user rather than per computer. Second - to write a service that will operate under the privileged user and perform the necessary procedures (accessing/writing the information) for your application.

Alex Butenko
  • 3,554
  • 3
  • 36
  • 54