tags:

views:

41

answers:

1

Hi all,

Using Wix3, its trivial to ensure that a windows service being installed is given a dependency on a service that is already installed on the target machine, but I need to do the opposite - i.e. as part of my install I need to modify the service dependencies of an existing service (i.e. already installed on the target machine), to ensure that that service is dependent on the service I am installing.

Is there a simple way to do this using WiX? or will I need to write a custom action?

Edit - The scenario is around a custom Windows Service that MS Office Communications Server will dispatch messages to. Once OCS is configured to dispatch to that service (and it is marked as a critical service) then that service must be up and running in order for the OCS service to start. So we need the dependency there to ensure our service starts before OCS, and we would usually add the dependency by hand following installation.

I know, it makes me shudder too.

Many thanks,

Paul

+1  A: 

This is a form of a component rule violation because windows installer only creates services for keyfiles and you would be creating a duplicate component to control the service.

Basically your jacking with the attribute of a resource that belongs to a component that isn't your own. When this service was written, I'm guessing it had no idea about your service so how could it possibly have a dependency on your service?

What I'm really asking is what problem are you trying to solve? If you really must do it in WiX/MSI, your probably best off with a custom action to call into the service control manager and add the dependency. Just don't be suprised if whatever installed the service decides to undo your change because it doesn't match it's notion of how that service should be configured.

Christopher Painter
Thanks Christopher. I was expecting an answer along those lines. I've edited to add some clarification, but pretty happy that this is "the" answer. Cheers
Paul Nearney