Hi,

I want to do a similar thing. I want to provide an option for deleting
database during uninstallation. I added a checkbox to prompt the user, and
bound the checkbox to a property, but I don't know how to drop the database
if the property is true.
The "droponuninstall" attribute on SqlDatabase does not take a property as
its value.

I thought of using a sql script to drop the database. But there is no
<condition> child allowed for <SqlScript>. Even the inner text does not tkae
a condition.

Please help.

Regards,
Maryann

Romeo S. wrote:
>
> Hi,
>
> Our package creates a database during installation and we only want to
> drop the database during uninstall when the PROPERTIES DROPDB="1".
>
> What i did was i've created a component:
> <Component Id="createDB" Guid="8D0757C0-B204-4A99-8FA1-4F3235FA2CAF">
>       <CreateFolder Directory="INSTALLDIR" />
>       <sql:SqlDatabase Id="createSqlDB" CreateOnInstall="yes"
> Server="[SQLSERVER_SERVER]" Database="[SQLSERVER_DATABASE]">
>               <sql:SqlScript Id="createScript" ExecuteOnInstall="yes"
> ContinueOnError="no" BinaryKey="create_DB.sql"/>
>       </sql:SqlDatabase>
> </Component>
>
> And then i created another database for dropping the database:
> <Component Id="dropDB" Guid="D32A0748-A505-45B4-B419-BF21C71FF0B6">
>       <CreateFolder Directory="INSTALLDIR" />
>       <sql:SqlDatabase Id="dropSqlDB" DropOnUninstall="yes"
> Server="[SQLSERVER_SERVER]" Database="[SQLSERVER_DATABASE]" />
>       <Condition><![CDATA[DROPDB="1"]]></Condition>
> </Component>
>
> What is the right way to do this? All we want is drop the database on
> uninstall only if DROPDB="1". Thank you in advance.
>
> Regards,
> Romeo
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to