Managed WiX Bootstrapper packages

家住魔仙堡 提交于 2019-12-30 09:48:12

问题


I have chained multiple Msi/exec packages in my Bundle.wxs. In my managed Bootstrapper code, I would like to get the parameters (such as DisplayName, Vital, etc) of the current package that is being executed. Right now, I have only found events that provide the packageID. Can I use this to somehow access other properties of the package?


回答1:


Yes. A file called BootstrapperApplicationData.xml is created during the build process and included with your Bootstrapper Application. The BootstrapperApplicationData.xml has lots of information about the bundle and packages included in your Bundle Chain, including the DisplayName and sizes and vital.

You'll find the BootstrapperApplicationData.xml right next to your .dll. In managed code you can get it using the following code:

 string folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
 string dataXmlPath = Path.Combine(folder, "BootstrapperApplicationData.xml");

In native code, it is easier to use the helper functions provided in the balutil.lib. Namely BalManifestLoad() then BalInfoParseFromXml() to parse the XML file into a bunch of handy structs. You can see the code in src\ext\BalExtension\balutil\balinfo.cpp.

Finally, the BootstrapperApplicationData.xml can be extended by using CustomTable elements and setting the BootstrapperAppplicationData='yes' attribute.



来源:https://stackoverflow.com/questions/16412193/managed-wix-bootstrapper-packages

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