在WIX中立即执行自定义操作

一旦出现第一个对话框(欢迎),是否有任何方法可以在WIX​​中执行自定义操作?

要求是检查先决条件,其中一些需要自定义操作。

自定义操作可以在我们点击下一个对话框时执行,但是标准的WIX prereqs是由我们自定义的prereq决定的。

(我们需要的自定义操作是检查IIS 6元数据库兼容性是否已打开,而registrysearch在装有32位安装程序的x64计算机上无效)

我使用这样的东西…

<InstallExecuteSequence> <Custom Action="CA_DoSomething" After="FindRelatedProducts"> <![CDATA[1]]> </Custom> </InstallExecuteSequence> <InstallUISequence> <Custom Action="CA_DoSomething" After="FindRelatedProducts"> <![CDATA[1]]> </Custom> </InstallUISequence> <CustomAction Id="CA_DoSomething" Error="Error message goes here" /> 

添加如下内容:

 <Custom Action="MyCustomAction" Before="FindRelatedProducts">1</Custom> 
  • 而不是FindRelatedProducts,您可能需要进行其他标准操作。 您可以简单地在Orca中打开当前的msi以查看InstallExecuteSequence。
  • 而不是“1”条件,你可能需要另外一个东西。