0

I know that serverManagerCmd.exe -query <foo.xml> will output list of all roles + features in xml format. However, I do not have the ability to parse this easily as I am writing WiX code.

So is there a command which returns different codes depending on whether the server role you specify are installed or not?

Background: I am trying to write a WiX installer which checks if a server role is installed and only runs a command to install if not already installed.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
Chirayu Shishodiya
  • 544
  • 2
  • 7
  • 14

2 Answers2

0

I believe the Win32_ServerFeature Windows Management Instrumentation (WMI) class may be of use to you. See also, http://msdn.microsoft.com/en-us/library/cc280268(VS.85).aspx.

I've never used WiX, but I'm assuming it supports WMI.

MHGL
  • 101
0

AFAIK, there isn't a built in WiX element to allow you to do this.

The best thing to do is probably to write a Custom Action, which allows you to write the logic in C# or VB using all the normal .NET functionality. You can then call that Custom Action from the installer in order to deal with the roles.

ChrisPatrick
  • 984
  • 7
  • 19