Thursday 6 September 2012

Use Msiexec to install or uninstall particular features of a Wix Installer

A few days ago the requirements changed again, isn't Agile development a hoot?, and all of sudden I found myself needing to modify the PowerShell script  that we've been using to install the build, I'll probably publish it in another post. It turns out that not all the servers servers needed all features installed which prompted a furious bout of Googling.

It's quite simple:
msiexec /i build.msi ADDLOCAL=MyFeature
If you want to install several features, just separate them with commas:
msiexec /i build.msi ADDLOCAL=Website,Webservices
Note that if the features need public properties to be set, then remember to do so, as otherwise it will fail to install, something like this:
msiexec /i build.msi ADDLOCAL=Website SQLSERVERINSTANCE=myinstance 

Since I did not want to uninstall and reinstall the relevant features I did another bout of less furious Googling to find out how to remove a particular feature only.

This is somewhat counter-intuitive as you use the install flag:
msiexec /i build.msi REMOVE=Website

No comments:

Post a Comment