The
In the code above I used dummy condition names
condition
element for SqlDatabase is not available directly so you need to insert it in the final XML:project.WixSourceGenerated += document => { document.Root.FindSingle("SqlDatabase") .Parent .AddElement("Condition") .SetValue("INSTALLING=\"yes\" AND UPGRADING=\"no\""); };
INSTALLING
and UPGRADING
but you will need to find the real condition expression that constitutes "initial Installation, not by Major Upgrade"