ElDog
ElDog

Reputation: 1387

How to install windows service using wix and not using ServiceInstall

I need to install a windows service using wix. Unfortunately ServiceInstall doesn't fit my needs. It doesn't allow to specify service file explicitly and needs to be placed into the same component where the service executable file is. But my components are dynamically generated by heat each time the project is build. So I can't put ServiceInstall there.

Does anyone know alternative ways to install the service?

The service is .net one so my first idea would be to run installutil from .net framework directly.

Upvotes: -1

Views: 1187

Answers (2)

Christopher Painter
Christopher Painter

Reputation: 55620

I've spoken at length of the many limitations of dynamic installation authoring. What I would do is statically author this component for the service (using ServiceInstall ) and exclude it from the dynamic generation process.

Then again, I don't use dynamic authoring period. I don't consider it a best practice.

Upvotes: 3

Yan Sklyarenko
Yan Sklyarenko

Reputation: 32280

You can transform the heat output with XSLT transform (see -t switch) the way you want. And it is still better than falling back to installutil... Take a look at the DTF documentation (DTF.chm installed with WiX, Development Guide > Managed CAs > InstallUtil) for the reasons why using installutil is not considered a good idea.

Upvotes: 0

Related Questions