0

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.

ElDog
  • 1,230
  • 1
  • 10
  • 21

2 Answers2

3

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.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • +1, It's not really difficult to statically include this and what's the point of generating it every build when its kt – caveman_dick Aug 17 '12 at 07:17
  • I know that it is recommended to make the wix files statically but in my situation I simply have to accept the fact: I need to pack the contents of build folders which I don't know fully in advance. Could be that later we will switch to the static files generation. Thanks anyway. – ElDog Aug 17 '12 at 07:36
  • 1
    I would never accept that 'fact'. It's a horrible requirement and bad design and probably coming from someone who doesn't know anything about deployment. There are so many edge case additional meta data case scenarios to consider that you can't possibly get it right 'magically' at build time. – Christopher Painter Aug 17 '12 at 10:25
0

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.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • Tx! I even found a question here where it is explained how to do it: http://stackoverflow.com/questions/7020694/wix-3-5-install-service-from-heat-need-from-custom-action – ElDog Aug 17 '12 at 07:32