Click here to Skip to main content
14,732,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
<!-- - - - - DB/SQL Script - - - - -->
<sql:SqlDatabase Id="CreateBingoServer" Server="[SERVERNAME]" Database="BingoServer" CreateOnInstall="yes" DropOnUninstall="yes" ContinueOnError="no" >

  <!-- Pre-Drop on Create -->
  <sql:SqlScript Id="PreDrop" BinaryKey="Drop" ExecuteOnInstall="yes" Sequence="1" ContinueOnError="yes" />
  <!-- Create on Install -->
  <sql:SqlScript Id="Script" BinaryKey="Database" ExecuteOnInstall="yes" Sequence="2" ContinueOnError="no" />
  <!-- Drop on Uninstall -->
  <sql:SqlScript Id="Drop" BinaryKey="Drop" ExecuteOnUninstall="yes" Sequence="1" ContinueOnError="no" />
  <!-- -->


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?
Updated 20-Apr-15 3:56am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900