【问题标题】:Wix Executing command using custom action not workingWix 使用自定义操作执行命令不起作用
【发布时间】:2020-11-16 00:28:43
【问题描述】:

我有以下自定义操作,这些操作通常会从 Windows 服务中删除 exe 并将其添加回来,

<CustomAction Id="ExecRemoveService" Directory="INSTALLDIR" Execute="immediate" ExeCommand="MyExe.exe -remove" Return="ignore" />
    <CustomAction Id="ExecInstallService" Directory="INSTALLDIR" Execute="immediate" ExeCommand="MyExe.exe -install" Return="ignore" />
    <InstallExecuteSequence>
      <Custom Action="ExecRemoveService" After="InstallFinalize" />
      <Custom Action="ExecInstallService" After="InstallFinalize" />
    </InstallExecuteSequence>

当运行 MSI 时没有任何反应,它成功完成,但我在 windows 服务中没有看到任何内容。

【问题讨论】:

    标签: wix windows-installer custom-action


    【解决方案1】:

    这个对我有用,

        <CustomAction 
    Id="ExecInstallService" 
    Directory="INSTALLDIR" 
    Execute="deferred" 
    ExeCommand='cmd.exe /k "MyService.exe -remove &amp; MyService.exe -install &amp; exit"' Return="check" Impersonate="no" />
    

    【讨论】:

      猜你喜欢
      • 2012-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多