WiX, Conditionally installing a file based on OS

Posted by Sam Saffron on Stack Overflow See other posts from Stack Overflow or by Sam Saffron
Published on 2009-06-09T01:16:37Z Indexed on 2010/05/27 13:11 UTC
Read the original article Hit count: 171

Filed under:
|
|

In my WiX project I need to install different content for the same file name, based on the OS.

  • If the OS is Windows 7 then the file needs to have content X.
  • If the OS is Windows Vista the file needs to have content Y.

I have thought through a few approaches:

  1. Define two components, one with the content for windows 7 and another with the contents for Vista. Run a custom action based on the OS that overwrites the content for Vista if the OS is Windows 7.

  2. Define two additional features (window7 config and win vista config) have the components target the same file and install the feature conditionally based on OS.

Which is the best approach to take. Any tips, tricks and sample wix to get this going?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about installer