Click-once application as Administrator

I created a ClickOnce application that had to modify the registry.

You can’t do this unless you’re an administrator.

I first tried to add an app.manifest file to elevate the application, but ClickOnce won’t anything but asInvoker.

Then through some googling I found the following article:

http://antscode.blogspot.ca/2011/02/running-clickonce-application-as.html

In summation, when your application starts, it checks if you’re an administrator with administrative priviledges. ┬áIf not, it relaunches itself as yourself (who should be an administrator) and terminates.

Leave a Reply

Your email address will not be published. Required fields are marked *