Search code examples
wixwix3

Use Environment Variable in WiX script to set Install location


I am creating WiX installer to drop my custom VS 2010 extension inside Visual Studio Extensions folder. I want to use the system environment variable VS100COMNTOOLS to figure out the VS installed path inside WiX script. I would like to use a relative path syntax like %VS100COMNTOOLS%\..\IDE\Extensions to get to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions folder or wherever user chose to install VS 2010.

Can somebody please suggest me how I achieve this in Wix script?


Solution

  • WixVSExtension has a bunch of properties available for Visual Studio paths. Not that one in particular but you can use the technique outlined in the question Erik pointed out to construct it from one of the WixVSExtension properties.