我可以使用下面的wix代码片段安装/运行exe,它也会创建一些注册表项
<Property Id="WixShellExecTarget" Value="D:\RegUtil.exe" />
<CustomAction Id="LaunchRegExe" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
<InstallExecuteSequence>
<Custom Action='LaunchRegExe' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
我可以在正常的命令提示符中使用值“D:\ RegUtil.exe / uninstall”卸载exe。 有没有办法在wix中使用值“D:\ RegUtil.exe / uninstall”卸载RegUtil.exe
答案 0 :(得分:0)
您可以运行安静执行自定义操作来卸载它,如下所示:
http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html
实施例: -
<!--Sets command-->
<CustomAction Id="SetQtExecCmdLine_UninstallRegUtil"
Execute="immediate"
Property="QtExecCmdLine"
Return="check"
Value="D:\RegUtil.exe /uninstall" />
<!--Runs command-->
<CustomAction Id="QtExec_UninstallRegUtil"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Execute="immediate"
Return="check" />
<!--InstallExecuteSequence-->
<InstallExecuteSequence>
<Custom Action="SetQtExecCmdLine_UninstallRegUtil" After="CostFinalize"/>
<Custom Action="QtExec_UninstallRegUtil" After="SetQtExecCmdLine_UninstallRegUtil"/>
</InstallExecuteSequence>