Doing some wix work at the moment and came across the need to default some varibles if they weren't passed in to candle. In my case we have a private build that creates an installer for an application but as it's a private build we don't have a version number (well we do but it's 1.0.0.0 to denote developer build).
Anyway the below code defines a varible if it doesn't exist:
<?ifndef ProductVersion ?>
<?define ProductVersion="1.0.0.0" ?>
<?endif ?>
<Product Id="*" Name="AppName" Language="1033" Version="$(var.ProductVersion)" Manufacturer="ATeam" UpgradeCode="$(var.UpgradeCode)">
cf6ba2fe-afd8-4d07-865d-1133b1b88668|0|.0