Yes, you're right it does. Ok, your suggestions worked. Now my SQL
scripts run correctly. Thank you!
One thing to note is that if I tried to use ExecuteOnInstall in the
same element with a RollbackOnUninstall, then it doesn't get executed
at all (undocumented).
Anyway I have a new problem, during uninstall. Is there a way to
install these files normally, but leave them alone on uninstall?
(Since they may now contain user data.)
Here's my code now:
<Directory Id="DbDataDir" Name="DATA">
<Component Id="CmpntBaselineDb"
Guid="c57c91e1-d185-49c1-91f9-fc41a26298a3">
<File Id="MDF" Name="Baseline.mdf" Source="Baseline.mdf"
KeyPath="yes" />
<File Id="LDF" Name="Baseline_log.ldf"
Source="Baseline_log.ldf" />
<sql:SqlString Sequence="1" SqlDb="DB1" ExecuteOnUninstall="yes"
Id="DropUserId" SQL="USE [\[][DBNAME][\]];DROP LOGIN
[USERIDVALUE];DROP USER [USERIDVALUE]" ContinueOnError ="yes" />
<sql:SqlString Sequence="2" SqlDb="DB1" ExecuteOnUninstall="yes"
Id="DetachDb" SQL="sp_detach_db [\[][DBNAME][\]], true, false"
ContinueOnError="yes" />
<sql:SqlString Sequence="3" SqlDb="DB1" RollbackOnInstall="yes"
Id="RollbackDb" SQL="USE [\[][DBNAME][\]];DROP LOGIN
[USERIDVALUE];DROP USER [USERIDVALUE];DROP DATABASE [\[][DBNAME][\]]"
ContinueOnError="yes" />
<sql:SqlString Sequence="4" SqlDb="DB1" ExecuteOnInstall="yes"
Id="AttachDb" SQL="CREATE DATABASE [\[][DBNAME][\]] ON
(FILENAME=N'[#MDF]') FOR ATTACH" ContinueOnError="yes" />
<sql:SqlString Sequence="5" SqlDb="DB1" ExecuteOnInstall="yes"
Id="CreateUserId" SQL="IF NOT EXISTS ( SELECT * FROM
sys.server_principals WHERE name = N'[USERIDVALUE]' ) CREATE LOGIN
[USERIDVALUE] WITH PASSWORD='[PWDVALUE]', DEFAULT_DATABASE=[DBNAME],
CHECK_POLICY=OFF;USE [DBNAME];IF EXISTS(SELECT name FROM sys.sysusers
WHERE name=N'[USERIDVALUE]')DROP USER [USERIDVALUE];CREATE USER
[USERIDVALUE];EXEC sp_addrolemember db_owner, [USERIDVALUE];"
ContinueOnError="yes" />
</Component>
</Directory>
Tim
On Fri, Jun 13, 2008 at 2:55 PM, Rob Mensching
<[EMAIL PROTECTED]> wrote:
> We're working on getting the WiX v3 documentation up there. However, every
> download of the WiX toolset includes an up to date (as much as we have it)
> version of the WiX.chm. That should contain all the information...
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users