我可以确保组件安装顺序吗? [英] Can I ensure components installation order?

查看:77
本文介绍了我可以确保组件安装顺序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用WiX安装程序实施数据库升级。因此,几乎没有带有 SqlScript 元素的组件。但是我不确定是否可以依靠组件执行顺序。



WiX是否总是按照Fragment中定义的顺序将组件添加到MSI组件表中? Windows安装程序是否保证按组件表的顺序执行它们?

解决方案

否,MSI不处理任何给定的组件订购。这是不确定的。但是,WiX提供的SQL脚本自定义操作会按给定顺序处理脚本。由SqlScript @ Sequence属性确定。



在对CustomActions进行评估时,它会根据要安装的组件来决定需要执行哪些脚本。然后,它将基于Sequence属性对该结果进行排序并安排安装。



我倾向于根据安装类别使用诸如100200300400之类的东西。 / p>

100-创建空数据库



200-创建表



300-应用约束



400-加载数据



500-创建诸如proc和触发器之类的对象



想法是您不必对101和102进行微管理,而只需将其视为安装阶段即可。


I'm considering implementing DB upgrades using WiX installer. So there would be few components with SqlScript elements. But I'm not sure if I can rely on the component execution sequence.

Does WiX always add components to MSI Components table in order they are defined in a Fragment? And does Windows installer guarantee to execute them in the order of Components table?

解决方案

No, MSI does not process components in any given order. It's non-deterministic. However, the SQL Scripts Custom Actions provided by WiX do process scripts in a given order. It's determined by the SqlScript@Sequence attribute.

When the CustomActions evaluate it'll decide which scripts need to be executed based on which components are being installed. It'll then sort that result based on the Sequence attribute and schedule it for installation.

I tend to use things like 100 200 300 400 based on catagories of installation.

100 - Create Empty Databases

200 - Create Tables

300 - Apply Constraints

400 - Load Data

500 - Create objects like procs and triggers

The idea is you don't have to micromanage 101 vs 102 but rather just treat it as stages of installation.

这篇关于我可以确保组件安装顺序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆