Can I ensure components installation order?

被刻印的时光 ゝ 提交于 2019-12-12 19:45:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/13252880/can-i-ensure-components-installation-order

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!