|
I have to admit I am a little bit newbie with ClickOnce customisation. So sorry if the question is too obvious :-) Here is the question: I have to setup an event logger source with the installUtil.exe (that calls a class EventLogInstaller) at the end of the deployment of my C# App with ClickOnce. The deployment starts on low privilege client machines so I need to do this in the ClickOnce installation. Does anyone have some idea? thanks |
| RoboBoot Saturday, September 05, 2009 6:20 AM |
ClickOnce applications are installed under the user's profile, and require not security to be installed or (generally) to run. So only non-privileged operations can be run. I think you can programmatically elevate the privileges, but it will prompt the user.
I'm not sure what you mean by including a dependency in the ClickOnce manifest. Let me tell you what you CAN do.
If it is not dependent on the ClickOnce application being installed first, you can deploy it as a prerequisite to the ClickOnce installation. To do this, roll a setup & deployment package for it, and then take the msi and generate the bootstrapper manifest for it using the Bootstrapper Manifest Generator, put that package with the rest of the Visual Studio prerequisites, and then select it as a prerequisite to your ClickOnce application.
Here's some info about the BMG:
Where to get it: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/92d68fc3-3c00-4435-9d45-f781aad89ad1
Instructions on using it: http://jcrawfor74.wordpress.com/2008/02/27/bootstrap-manifest-generator-how-to-custom-pre-requisites/
Note that it will only install it when the user installs the application (by double-clicking on the setup.exe); it won't install it or reinstall it when updates are published for the ClickOnce application. But I believe it WILL prompt for elevated privileges like the .Net Framework does.
Does that help?
RobinDotNet
Click here to visit my ClickOnce blog!- Marked As Answer byRoboBoot Sunday, September 06, 2009 6:45 AM
-
|
| RobinDotNet Sunday, September 06, 2009 2:45 AM |
Robin you are right, prerequisites of the ClickOnce installation are only for "double click install" onto the MSI ClickOnce generated package. I think I'll do in this manner: the administrator will distribute and execute (only once) with high privilege an msi package that executes onto the local user machine: "installUtil EventLogInstaller" (http://msdn.microsoft.com/en-us/library/system.diagnostics.eventloginstaller.aspx). This to create an eventsource for the log that is needed by the application. Then the user could start the normal ClickOnce installation from a UNC. I hoped that this high privileges operations could be integrated in ClickOnce but it's not possible. Tnx for your very fast reply :-)
- Marked As Answer byRoboBoot Sunday, September 06, 2009 6:45 AM
-
|
| RoboBoot Sunday, September 06, 2009 6:45 AM |
Are you saying you want to install a windows service with ClickOnce? You can't do this. You have to use a setup & deployment package. ClickOnce installations do not have the privileges to install a Windows Service. Also, you can't customize a ClickOnce deployment to do something after deploying the actual application. You can try having your application do the installation itself or have it fire it off, but I don't know if it will have the privileges to do so. And note that if the event logger is being deployed with your ClickOnce app, the location will change every time the user updates their application. Can you explain more about what you're trying to do? RobinDotNet
Click here to visit my ClickOnce blog! |
| RobinDotNet Saturday, September 05, 2009 4:59 PM |
No I want to execute an application that installs a log event source after the installation of the main application. The user executing the main app doesn't have the privileges to install the event source so only a privileged user can do this. I hoped that ClickOnce process could do this. Is it possible that only non privileged operations can be executed by Clickonce? Can I create a .MSI package that install the logs event source and to include a dependecy in the ClickOnce manifest (as Office 2007 PIA or .NET framework, etc.)? Could be a way? Thanks for your reply |
| RoboBoot Saturday, September 05, 2009 6:48 PM |
ClickOnce applications are installed under the user's profile, and require not security to be installed or (generally) to run. So only non-privileged operations can be run. I think you can programmatically elevate the privileges, but it will prompt the user.
I'm not sure what you mean by including a dependency in the ClickOnce manifest. Let me tell you what you CAN do.
If it is not dependent on the ClickOnce application being installed first, you can deploy it as a prerequisite to the ClickOnce installation. To do this, roll a setup & deployment package for it, and then take the msi and generate the bootstrapper manifest for it using the Bootstrapper Manifest Generator, put that package with the rest of the Visual Studio prerequisites, and then select it as a prerequisite to your ClickOnce application.
Here's some info about the BMG:
Where to get it: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/92d68fc3-3c00-4435-9d45-f781aad89ad1
Instructions on using it: http://jcrawfor74.wordpress.com/2008/02/27/bootstrap-manifest-generator-how-to-custom-pre-requisites/
Note that it will only install it when the user installs the application (by double-clicking on the setup.exe); it won't install it or reinstall it when updates are published for the ClickOnce application. But I believe it WILL prompt for elevated privileges like the .Net Framework does.
Does that help?
RobinDotNet
Click here to visit my ClickOnce blog!- Marked As Answer byRoboBoot Sunday, September 06, 2009 6:45 AM
-
|
| RobinDotNet Sunday, September 06, 2009 2:45 AM |
Robin you are right, prerequisites of the ClickOnce installation are only for "double click install" onto the MSI ClickOnce generated package. I think I'll do in this manner: the administrator will distribute and execute (only once) with high privilege an msi package that executes onto the local user machine: "installUtil EventLogInstaller" (http://msdn.microsoft.com/en-us/library/system.diagnostics.eventloginstaller.aspx). This to create an eventsource for the log that is needed by the application. Then the user could start the normal ClickOnce installation from a UNC. I hoped that this high privileges operations could be integrated in ClickOnce but it's not possible. Tnx for your very fast reply :-)
- Marked As Answer byRoboBoot Sunday, September 06, 2009 6:45 AM
-
|
| RoboBoot Sunday, September 06, 2009 6:45 AM |