How to use CustomAction in WIX Bundle?

霸气de小男生 提交于 2019-11-30 18:42:48
BryanJ

As I see it, you have three options:

  1. Depending on what information you need, you can use the WixUtilExtension to perform simple tasks such as reading registry keys and performing file searches, which you can then pass the results to your installation packages as properties.

  2. Implement custom actions in the individual installation packages themselves (not in the bundle).

  3. Write your own custom bootstrapper application to determine all the properties you need to set, and then pass them to your installation packages. This is more complex than the #1 and #2, but if your interested the following links should get you started: introducing managed bootstrapper applications and write a wpf wix installer

There is a fourth option, a useful lightweight hack, identified by Vijay Kotecha (see http://vijayskotecha.blogspot.com/2013/07/wix-bootstrapper-custom-action.html),...

Essentially, build an <ExePackage> around a pass-through .bat or .cmd batch file. The batch/command file contains the single line '%*' which re-executes all of the command line arguments as a first class command.

Thus:

<ExePackage ... SourceFile="SourcePath\WixCustomAction.cmd"
    InstallCommand="my_custom_action.exe my_custom_parameters" />
<ExePackage ... SourceFile="SourcePath\WixCustomAction.cmd"
    InstallCommand="my_next_action.exe my_next_parameters" />

Where WixCustomAction.cmd is a file containing only '%*'.

These <ExePackages> can be placed into the <Bundle><Chain> successively as needed using different InstallCommands as needed.

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