WiX:安装后如何执行命令行命令

问题描述 投票:0回答:1
installation wix custom-action wix3.8
1个回答
29
投票

自己解决了,实际上是UAC/权限问题。对于任何感兴趣的各方,这里是工作代码:

<CustomAction Id="ExecPortOpen" Directory="INSTALLFOLDER" Execute="commit" Impersonate="no" ExeCommand="cmd.exe /c &quot;netsh http add urlacl url=http://+:1234/ user=Everyone&quot;" Return="check" />

<InstallExecuteSequence>
  <Custom Action="ExecPortOpen" After="InstallInitialize" />
</InstallExecuteSequence>
© www.soinside.com 2019 - 2024. All rights reserved.