Hello WiX-Users,
I've been working on an installer that uses quite a few SQL scripts that are
triggered based on conditions set during the UI prompts. The issue I've been
having is that the SQL statements that are scheduled with a lower sequence
number doesn't seem to be fired off (or completed) by the time the next
statement is fired.
The WiX code I use is rather basic, mostly copy/pasted from tutorial sites.
The one change I did make that made a difference is: I set up a DB pointer for
each script. By doing so the error went away, but recently I found out our
testers have found instances where the error returned on slower machines and/or
slower connections to a remote DB. I dislike doing this because it is
redundant, and rather ugly.
Is there a way to force a delay or check for a commit result before continuing
to the next item in the sequence?
Using latest build of WiX 3.0
I have about 45 scripts, and 20-23 will run on each install. I've omitted the
majority of them, but the error usually comes while running the scripts in
SQLBulk. The error refers to an object not existing that should have been
created in a previous Script. Having one pointer to a DB will always cause the
error. Having separated pointers allows the install to complete on most, but
not all machines (as stated before).
Thanks.
Sample code:
<Component Id="DBSQL" Guid="GUID IS HERE" >
<sql:SqlDatabase Id="DBSQL" User="SQLUser" Database="Foo"
Server="[SQLSERVERNAME]" CreateOnInstall="yes" DropOnUninstall="no" >
<sql:SqlScript Id="DBSQL.sql"
ExecuteOnInstall="yes" BinaryKey="DBSQL" Sequence="1" User="SQLUser"/>
</sql:SqlDatabase>
<Condition>NEWDB = "Yes" AND SQLEXPRESS="No"</Condition>
</Component>
<Component Id="DBSQLExpress" Guid="GUID IS HERE" >
<sql:SqlDatabase Id="DBSQLExpress" User="SQLUser"
Database="Foo" Server="[SQLSERVERNAME]" CreateOnInstall="yes"
DropOnUninstall="no" >
<sql:SqlScript Id="DBSQLExpress.sql"
ExecuteOnInstall="yes" BinaryKey="DBSQLExpress" Sequence="1" User="SQLUser"/>
</sql:SqlDatabase>
<Condition>NEWDB = "Yes" AND SQLEXPRESS="Yes"</Condition>
</Component>
<Component Id="SQLCreateFooDB" Guid="GUID IS HERE" >
<sql:SqlScript SqlDb="FooDB01" Id="FooDB.sql"
ExecuteOnInstall="yes" BinaryKey="FooDB" Sequence="2" User="SQLUser"/>
<Condition>NEWDB = "Yes"</Condition>
</Component>
<Component Id="SQLReplication" Guid="GUID IS HERE">
<sql:SqlScript SqlDb="FooDB01"
Id="DropReplicationSubscriberOnClient.sql" ExecuteOnInstall="yes"
BinaryKey="drpRepSubClnt" Sequence="2" User="SQLUser"/>
<sql:SqlScript SqlDb="FooDB23"
Id="ReplicationSubscriberOnClient.sql" ExecuteOnInstall="yes"
BinaryKey="RepSubClient" Sequence="20" User="SQLUser"/>
<Condition>Replication="Yes"</Condition>
</Component>
<Component Id="SQLReplicationNewDB" Guid="GUID IS HERE">
<sql:SqlScript SqlDb="FooDB02" User="SQLUser"
Id="ReinitializeReplicationSubscriberOnClient.sql" ExecuteOnInstall="no"
ExecuteOnReinstall="yes" BinaryKey="ReInRepSubClnt" Sequence="21"/>
<Condition>Replication = "Yes" AND NEWDB = "Yes"</Condition>
</Component>
<Component Id="SQLBulk" Guid="GUID IS HERE">
<sql:SqlScript SqlDb="FooDB04" User="SQLUser"
Id="x7010000UpdateFooDB.sql" ExecuteOnInstall="yes" BinaryKey="xVerUpdateDB"
Sequence="3"/>
<sql:SqlScript SqlDb="FooDB05" User="SQLUser"
Id="MasterObjects.sql" ExecuteOnInstall="yes" BinaryKey="MasterObjects"
Sequence="4"/>
<sql:SqlScript SqlDb="FooDB06" User="SQLUser"
Id="Functions.sql" ExecuteOnInstall="yes" BinaryKey="Functions" Sequence="5"/>
<sql:SqlScript SqlDb="FooDB07" User="SQLUser"
Id="FunctionsSpecial.sql" ExecuteOnInstall="yes" BinaryKey="FunctionsSpecial"
Sequence="6"/>
<sql:SqlScript SqlDb="FooDB08" User="SQLUser" Id="Views.sql"
ExecuteOnInstall="yes" BinaryKey="Views" Sequence="7"/>
<sql:SqlScript SqlDb="FooDB09" User="SQLUser"
Id="ViewsSpecial.sql" ExecuteOnInstall="yes" BinaryKey="ViewsSpecial"
Sequence="9"/>
<sql:SqlScript SqlDb="FooDB10" User="SQLUser" Id="Triggers.sql"
ExecuteOnInstall="yes" BinaryKey="Triggers" Sequence="10"/>
<sql:SqlScript SqlDb="FooDB11" User="SQLUser"
Id="ProceduresGenerated.sql" ExecuteOnInstall="yes" BinaryKey="ProcGen"
Sequence="11"/>
<sql:SqlScript SqlDb="FooDB12" User="SQLUser"
Id="Procedures.sql" ExecuteOnInstall="yes" BinaryKey="Procedures"
Sequence="12"/>
<sql:SqlScript SqlDb="FooDB13" User="SQLUser"
Id="ProceduresSpecial.sql" ExecuteOnInstall="yes" BinaryKey="ProceduresSpecial"
Sequence="13"/>
<sql:SqlScript SqlDb="FooDB14" User="SQLUser"
Id="ActivityReportFunctions.sql" ExecuteOnInstall="yes" BinaryKey="ActRepFunct"
Sequence="14"/>
<sql:SqlScript SqlDb="FooDB15" User="SQLUser"
Id="InitializeSecurity.sql" ExecuteOnInstall="yes"
BinaryKey="InitializeSecurity" Sequence="15"/>
<sql:SqlScript SqlDb="FooDB16" User="SQLUser"
Id="x7010000UpdateData.sql" ExecuteOnInstall="yes"
BinaryKey="x7010000UpdateData" Sequence="17"/>
<sql:SqlScript SqlDb="FooDB17" User="SQLUser" Id="Indexes.sql"
ExecuteOnInstall="yes" BinaryKey="Indexes" Sequence="18"/>
</Component>
...
<util:User Id="SQLUser" Name="[USER]" Password="[PASSWORD]" />
<sql:SqlDatabase Id="FooDB01" Database="ProHear" Server="[SQLSERVERNAME]"
User="SQLUser" />
<sql:SqlDatabase Id="FooDB02" Database="ProHear" Server="[SQLSERVERNAME]"
User="SQLUser" />
<sql:SqlDatabase Id="FooDB03" Database="ProHear" Server="[SQLSERVERNAME]"
User="SQLUser" />
<sql:SqlDatabase Id="FooDB04" Database="ProHear" Server="[SQLSERVERNAME]"
User="SQLUser" />
<sql:SqlDatabase Id="FooDB05" Database="ProHear" Server="[SQLSERVERNAME]"
User="SQLUser" />
...
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users