如何在WIX安装过程中执行一个exe文件

5
<CustomAction Id="RegisterEXE" Directory="INSTALLDIR" ExeCommand="&quot;INSTALLDIR]MyApp.exe&quot; /Register" Execute="immediate" Return="ignore" />   
<InstallExecuteSequence>
  <Custom Action='RegisterEXE' After='InstallFinalize' />
</InstallExecuteSequence>

我已经使用了这段代码,但它没有执行exe程序。该exe程序注册为OLE服务器并执行一些其他任务。

1个回答

13

使用这个

<CustomAction Id="RegisterEXE"
                  Directory="INSTALLDIR"
                  ExeCommand="&quot;[INSTALLDIR]TKW5.exe&quot; /Register"
                  Execute="deferred"
                  Return="ignore"  
                  Impersonate="no"
                 />

<InstallExecuteSequence>
      <Custom Action='RegisterEXE' After='InstallFiles' />
</InstallExecuteSequence>

如果这个方法不起作用,可以尝试按照这里的描述将CustomAction / @Execute设置为立即执行:https://dev59.com/Y2oy5IYBdhLWcg3wZdGr#8587072 - J. Krz
3
可能对一些人来说很明显,但我必须将它放在<Product>元素内 - 否则它会被忽略,因为我将它放在一个未被引用的片段中。 - phil_rawlings

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接