views:

2665

answers:

3

Is it possible to deploy a Windows Service using ClickOnce? If so, how do you achieve this?

Currently we have to use a Deployment project, and the installation process could be simplified greatly by using ClickOnce.

A: 

You can use the ClickOnce deployment to install a windows service. However in my experience each time an update is issued, user intervention is required and that normally breaks the reason for having the program run as a windows service.

However, one problem that I never worked out completely for the windows service, was running installutil.exe to install the service into the windows services list. But that wasn't an issue for the circumstances that I deployed in.

Sam
+10  A: 

AFAIK you can't really use ClickOnce end-to-end to deploy a service; there are issues with both the file locations (ClickOnce installs into a user's profile) and installation (ClickOnce is largely side-effect free).

You can, however, write a service as an exe that can self-install/uninstall from the services list, like so; basically, you write it as as a console exe and handle some command line args, using AssemblyInstaller to [un]install from the current assembly. Another advantage is that the same approach can be used to help debugging, since you can run it from the command line.

Marc Gravell
+3  A: 

I guess NO according to Choosing Between ClickOnce and Windows Installer

Chocol8