Search code examples
windows-installerstylecop

Visual Studio install project launch condition to check for StyleCop


I have created a set of default project templates and development framework libraries. I currently have 2 separate installers bunt now want to combine the into a single installer and also ensure that StyleCop is installed as a prerequisite.

If StyleCop hasn't been installed, I want it to be downloaded and installed.

Once I've confirmed StyleCop has been installed I want to overwrite the global style rules to conform with our coding standards.

Is this going to be possible without writing a custom installer?


Solution

  • It turned out to be quite simple once I'd tracked down the relevant How To's on MSDN.

    The first step is to add a launch condition search on the target machine. You can see how this is done here

    The screen shot below shows the registry key and value to search for. StyleCop registry search properties

    The launch condition properties should look like this... launch condition properties

    The File system folder should then be configured as shown here. The screen shot below shows the folder properties.

    file system folder properties NOTE: I use the PID value from the registry to ensure I'm overwriting the correct settings file.