WIX使用自定义操作执行的顺序

时间:2013-05-15 14:58:28

标签: wix

我有一个wix项目,可以安装一个网站,一些SQL Server数据库并配置用户等。

部分安装使用自定义操作为ASP.NET成员资格系统创建数据库,以执行aspnet_regsql.exe。

然后,安装的另一部分需要执行SQL脚本来创建初始用户。问题是脚本组件在自定义操作发生之前就已执行,因此脚本中对成员资格表和存储过程的引用无效,安装失败。

这是我的安装文件的一部分:

<Feature Id="Complete" Title="Darzi Web" Level="1" Display="expand" ConfigurableDirectory="INSTALLDIR">
  <ComponentGroupRef Id="SiteIISConfig"/>
  <ComponentGroupRef Id="SQLConfig" />
  <ComponentGroupRef Id="InstallFiles" />
  <ComponentRef Id="WebConfigChanges" />
  <ComponentGroupRef Id="SQLBootstrap" />
</Feature>

<InstallExecuteSequence>
  <Custom Action='RegSql'  After='InstallFiles'/>
</InstallExecuteSequence>

我需要一种方法告诉安装程序确保在“RegSql”之后发生“SQLBootstrap”。

感谢任何帮助。

修改

这是运行Bootstrap SQL的部分:

<Fragment>
<DirectoryRef Id="INSTALLDIR">
  <Component Id="SqlBoostrapComponent" Guid="CAAA1447-446F-4C1B-9239-812ABA5AF0FF" KeyPath="yes">

      <sql:SqlScript SqlDb='DarziAspNetDbDatabase' Id='Bootstrap' BinaryKey='Bootstrap' ExecuteOnInstall='yes' Sequence='1' />

  </Component>
</DirectoryRef>


<Binary Id='Bootstrap' SourceFile='Bootstrap.sql' />

<ComponentGroup Id="SQLBootstrap">
  <ComponentRef Id="SqlBoostrapComponent" />
</ComponentGroup>

</Fragment>

1 个答案:

答案 0 :(得分:3)

假设您运行的Sql脚本使用内置sql actions您需要在RegSql操作后安排InstallSqlData操作:

<Custom Action="InstallSqlData" After="RegSql" />
相关问题