title: Using a WiX custom action to set a property's value
body: <p>I am modifying an existing <a href="http://en.wikipedia.org/wiki/WiX" rel="noreferrer">WiX</a> installer to handle updating an existing installation of one of our products. There are several values whose defaults are specified in properties. These properties are displayed to the user for editing and are then written to a custom configuration file by the existing installer.</p>
  
  <p>My code needs to be smart enough to detect if it is doing a brand new install versus installing an older version. If it is doing a brand new install, it needs to set the properties to default values. But if it is doing an upgrade, the code needs to retrieve the valus of those properties from the existing configuration file and display those to the user.</p>
  
  <p>From the reading I've done, it seems to me I need to use a <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa368237%28v=vs.85%29.aspx" rel="noreferrer">type 51 custom action</a> to set the properties. But how do I implement this custom action?</p>
  
  <p>I'm thinking that I have to first define the custom action to put it in the custom action table, and then I need to stick a tag somewhere to call it. And then I need to define it.</p>
  
  <p>How can I do this? What would some example code be?</p>