tags:

views:

382

answers:

1

Hi all,

Recently I had a problem in a costumer's computer. Our installer would hang during install and uninstall. Eventually I found out that the winmgmt service wasn't running, and that was causing the problem. For some reason it was disabled.

I would like to add a check to our installer, to guarantee that the service is running when installation begins. Preferably, with a helful error message if it isn't running.

I know I can do this check with a custom action, calling QueryServiceStatusEx from a C program. It can probably be done in some way in VBS too. But i would like to avoid custom actions, if possible. We had some problems with antiviruses, and dependency with WSH.

So, in short: How can I check if a service is running, in WiX?

(I don't have much experience with WiX. The guy who wrote the installer left the company and now I do the maintenance)

Thanks!

+2  A: 

There is nothing built into the Windows Installer to check the status of a service. You will need a CustomAction. As you've found script CustomActions should not be used, see: http://blogs.msdn.com/robmen/archive/2004/05/20/136530.aspx

Rob Mensching
I had already read that article, but thanks anyway. Now I know there is no built in way do this.
Idex