使用条件操作创建 WIX 安装程序

Creating a WIX installer with conditional operations

我有一个 Windows 表单项目,我需要为其创建一个安装程序。我需要添加先决条件,例如 .net 4.5 和 vC++ 可再发行组件。

基本问题是我需要安装程序离线和在线工作,在那些情况下,我需要它在接受用户不同输入集的不同对话框中移动。此外,对于离线验证任务,在用户最初输入一些输入后生成一定的代码。

我想问一下是应该使用 Wix 还是应该使用其他东西,以及 Wix 是否对解决我的上述问题有用。

a) 我可以在对话框之间进行基于条件的移动吗?

b) 安装开始后,我可以在对话框之间编写自定义代码来执行特定任务吗?

P.S。 - 我以前没有使用过 Wix,所以可能有助于我构建安装程序的链接将非常有用。

@Prashant,

1) 你看过条件语句了吗?这是一个很好的例子,它涵盖了您正在尝试做的很多事情。

How to install features depending on the value of property http://wixtoolset.org/documentation/manual/v3/xsd/wix/condition.html

2) 根据您尝试执行的任务,可能存在覆盖它的现有 Wix 组件。如果没有,您也可以按照此处所示执行自定义模块。

http://wixtoolset.org/documentation/manual/v3/xsd/wix/customaction.html http://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html

https://blogs.msdn.microsoft.com/jschaffe/2012/10/23/creating-wix-custom-actions-in-c-and-passing-parameters/

How to add custom action to wix setup project

3) 您知道以下资源吗?

https://github.com/deepak-rathi/Wix-Setup-Samples

https://github.com/tom-englert/Wax

https://github.com/rstropek/Samples/tree/master/WiXSamples

这里应该有足够的信息让你继续。