tags:

views:

60

answers:

2

Hi,

I have c# program which writes an xml file to "C:" disk. I published my program as one click package because it's for test purpose only. But the problem is the one click package doesn't have "run as admin" option. So how can I solve this problem ? Any idea ?

A: 

I don't know if this works with One Click Deployment, but you could try to include an Manifest with your executable to request that the application is run with higher privileges.

See Create and Embed an Application Manifest (UAC).

dtb
+7  A: 

The correct solution is not to force administrator elevation to bypass the built-in operating system security.

The correct solution is to fix the broken program. Even though it's just a test program, it should be written correctly.

See this SO question and the answers for more details. Even though it deals with the Program Files folder instead of the root, the underlying problem and solutions are identical.

Stephen Cleary