I have 2 sql scripts, one is for fresh install and the other one is for updates. I want this installer to automatically check for the existance of the database.
Pseudo code:
IF (database exists)
{
call 'UpdateDatabase' script
}
ELSE
{
call 'CreateDatabase' script
}
Product.wxs
<sql:SqlDatabase Id='SqlDatabase' Database='master' Server='.'
CreateOnInstall='yes' DropOnUninstall='no' ContinueOnError='yes'>
<sql:SqlScript Id='CreateDatabase' BinaryKey='CreateDatabase' ExecuteOnInstall='yes' />
<sql:SqlScript Id='UpdateDatabase' BinaryKey='UpdateDatabase' ExecuteOnInstall='yes' />
</sql:SqlDatabase>
I got it. It’s
ExecuteOnReinstall. Works as expected.