Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Installing an Application as administrator
 

Installing an Application as administrator

Hello, i have a Windows Forms application, and I'm trying to publish it. The problem is that I want to force install this application as administrator. The execution does not matter but I'm focused on the installation privileges.

I have tried to modify the manifest and have looked into lots of forums, but i have not found anything regarding this. And neither any results obtained worked.

Can anyone of you help me?

Thanks in advance!

Carlos Torrecillas  Friday, July 04, 2008 10:04 AM

You can't do custom actions with ClickOnce deployment. IF you want some kind of custom actions *during* installation, you need to use a setup & deployment package.

With ClickOnce deployment, you can deploy prerequisites that may do things like install the .Net framework, or install 3rd party components in the GAC, or run a .net program to set something up, but these happen prior to the ClickOnce installation.

I recommend either using a setup & deployment package, or writing a small setup & deployment package to do what it is you want to configure, and deploying that as a prerequisite to the ClickOnce deployment. It will only deploy once (the first time they installthe app). It depends if what you are trying to configure needs to run after/during the actual installation, or if it can run beforehand.

If you deploy something to do your config stuff prior to the ClickOnce app, you can still take advantage of ClickOnce to do the incremental udpates on your application.

RobinS.

GoldMail.com

RobinDotNet  Monday, July 07, 2008 5:05 PM

You can't do this with ClickOnce deployment. There are two major reasons to use ClickOnce deployment, the primary one being that it does not require any user privileges to install and application and perform subsequent updates.

What are you trying to do that you need administrative privileges for? Is it something during the installation process, or is it your application itself?

If it's something in the installation process, you can deploy a prerequisite to do the action instead. A prerequisite could be a setup & deployment package, or even a small .net program that runs. To add a prerequisite to Visual Studio for something you have created that you want to run prior to the ClickOnce installation, check out the Bootstrapper Manifest Generator.

RobinS.

GoldMail.com

RobinDotNet  Friday, July 04, 2008 7:36 PM

I want only these privileges for installation purposes. I though in Vista users and, in order to make easy the installation and keep out the task of running an application as administrator, it would be better if the clickonce itself prompt for this type of permissions. So that i wanted to give my application this requeriment.Do you know what i mean?

Many thanks!

Carlos.

Carlos Torrecillas  Monday, July 07, 2008 7:47 AM

Well, really i would like to execute some code with administrator privileges (configuration tasks that require administrator privileges) but want torun the application with non-required administrator privileges. So neither i do not know how to execute this pieces of code like custom actions on installation.

Thanks.

Carlos Torrecillas  Monday, July 07, 2008 9:55 AM

You can't do custom actions with ClickOnce deployment. IF you want some kind of custom actions *during* installation, you need to use a setup & deployment package.

With ClickOnce deployment, you can deploy prerequisites that may do things like install the .Net framework, or install 3rd party components in the GAC, or run a .net program to set something up, but these happen prior to the ClickOnce installation.

I recommend either using a setup & deployment package, or writing a small setup & deployment package to do what it is you want to configure, and deploying that as a prerequisite to the ClickOnce deployment. It will only deploy once (the first time they installthe app). It depends if what you are trying to configure needs to run after/during the actual installation, or if it can run beforehand.

If you deploy something to do your config stuff prior to the ClickOnce app, you can still take advantage of ClickOnce to do the incremental udpates on your application.

RobinS.

GoldMail.com

RobinDotNet  Monday, July 07, 2008 5:05 PM

You can use google to search for other answers

Custom Search

More Threads

• Testing against dotnetfx 2.0 redist
• How to create an MSI installer which runs in the elevate mode by default
• Strong name library installer
• Publish unsigned clickonce using msbuild
• QuestionSetting own prerequisities (.net Framework 2.0 German Languagepack)
• Rolling back un-installation through custom action.
• Need Help
• Occasionally Connected Clients & ClickOnce
• What makes an application unique
• Can I prevent browser from closing after opening ClickOnce app?