I have completed a WiX 3.9 project, with one hiccup...
It is able to:
-- skip the EULA
-- ask the user for the database string
-- save it in a RegKey
-- install files in the inetpub\wwwroot folder (defined by the client)
-- creates an AppPool
-- creates an IIS
-- creates a database
-- runs a script to remove the database, if it already exists
-- runs a script to create the entire database (tables and contents, necessary user)
However, during uninstall, everything is removed but the database does not drop.
I tested the script to drop the database by running it before the database is created. It works. I cannot get it to run at uninstall.
Here is my wix sql:SqlDatabase tag:
<sql:SqlDatabase Id="CreateBingoServer" Server="[SERVERNAME]" Database="BingoServer" CreateOnInstall="yes" DropOnUninstall="yes" ContinueOnError="no" >
<sql:SqlScript Id="PreDrop" BinaryKey="Drop" ExecuteOnInstall="yes" Sequence="1" ContinueOnError="yes" />
<sql:SqlScript Id="Script" BinaryKey="Database" ExecuteOnInstall="yes" Sequence="2" ContinueOnError="no" />
<sql:SqlScript Id="Drop" BinaryKey="Drop" ExecuteOnUninstall="yes" Sequence="1" ContinueOnError="no" />
</sql:SqlDatabase>
For Drop, I have tried 'ExecuteOnUninstall' and 'RollbackOnUninstall'.
I have also tried:
<sql:SqlScript Id="Drop" BinaryKey="Drop" ExecuteOnUninstall="yes" Sequence="1" ContinueOnError="no" SqlDb="CreateBingoServer" />
(outside the sql:SqlDatabase tag) and that does not run.
The verbose log shows the database is not found but SERVERNAME = "proper string from RegKey/installer input".
Any ideas?