开发者

WiX - Modifying an existing service to be dependent on the service I am installing

开发者 https://www.devze.com 2022-12-26 08:47 出处:网络
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 par

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开发者_Go百科 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消