Detect if installing to WHS RRS feed

  • Question

  • Has anyone come up with an official method of determining the PC an add-in is being installed to is a Windows Home Server or not?


    I've come up with a programmatic way to know if my code is running on a WHS or not... however I'd like to be able to do so in the installer (as built by VS), a place I can’t exactly run C# code and doing a File, Registry or Installer search for a given file, key or installed package would work... however I’m looking for something more official that can be banked on.


    Any suggestions?

    Wednesday, September 19, 2007 10:44 PM

All replies

  • Hi Brendan,


    The SDK describes using Wix to install your Add-in, and there's a line that I thought did the dependency check:


    <Condition Message="[ProductName] requires Windows Home Server. For more information, please refer to the User Guide.">VersionNT = 502</Condition>

    Does this do what you want, or do you have an additional requirement?




    Wednesday, September 19, 2007 11:57 PM
  • Unfortunately not.


    While I'm not currently using WiX (although such an example can be applied to a setup project), that example only detects if the underlying platform is a Windows 2003 Server box and not specifically a Windows Home Server.


    Ideally I want to be able to tell the difference between a Windows 2003 Server box and a Windows Home Server box similar to how I can with GetVersionEx() from ordinary code.

    Thursday, September 20, 2007 12:25 AM

    Hi Brendan,


    If you need a way to detect, you could check for the existence of a registry key, such as

    HKLM\Software\Microsoft\Windows Home Server\


    I recently switched to Wix, it's super easy and flexible, I highly recommend it over setup projects.


    I hope that helps,



    Thursday, September 20, 2007 3:09 AM
  • That is one option yes… however the main HKLM\Software\Microsoft\Windows Home Server\ key exists on both the WHS and client PC's and looking for a specific sub key relies on guesswork of if it will always be there and if it can be depended on.


    Ideally I'm wishing that there was some sort of... WHS equivalent of the MsiNTSuiteSmallBusiness flag (unfortunately that flag only exists in Windows Installer 4.0 or greater and WHS ships with 3.1). From the looks of it there is/will be a WIX_SUITE_WH_SERVER as part of WiX 3.0... but I'm not using WiX.


    WiX is definitely on the list to switch to... unfortunately I'm not to keen on switching to/relying on technologies that I don't fully understand and getting to know it is on my to do list... just a little further down on it.

    Thursday, September 20, 2007 4:17 PM