有没有办法通过指定顺序或指定依赖关系确保一个组件在WiX中的另一个组件之前执行?
具体来说,我正在尝试创建一个数据库,然后可选地在其上运行一个脚本。我的Wix看起来与此相似:
<ComponentGroup Id="SQLServerComponentGroup">
<Component Id="SQLServerIstallScriptWA" Guid="" >
<Condition>INSTALLDB</Condition>
<mssql:SqlDatabase Id="dbWA" Server="localhost" Database="[DATABASENAME]" CreateOnInstall="yes" ConfirmOverwrite="yes" DropOnReinstall="no" DropOnUninstall="yes">
<mssql:SqlScript Id="dbWAScript" ContinueOnError="no" ExecuteOnInstall="yes" ExecuteOnReinstall="no" Sequence="1" BinaryKey="MSSQLCreateDBBin" />
</mssql:SqlDatabase>
</Component>
<Component Id="SQLServerCreateUserWA" Guid="">
<Condition>INSTALLDB AND DBCREATEUSER = 1</Condition>
<mssql:SqlDatabase Id="dbWA" Server="localhost" Database="[DATABASENAME]">
<mssql:SqlString Id="dbWACreateUser" ContinueOnError="no" ExecuteOnInstall="yes" ExecuteOnReinstall="no" ExecuteOnUninstall="no" Sequence="1" SQL="" />
</mssql:SqlDatabase>
</Component>
</ComponentGroup>
我想确保在SQLServerCreateUserWA组件之前执行SQLServerInstallScriptWA组件。
答案 0 :(得分:1)
未订购组件。但是,SqlScript和SqlString具有可用于强加顺序的Sequence属性。 SqlScript和SqlString Sequence属性恰好一起排序以处理这种情况。