使用自定义操作的Wix执行命令不起作用

问题描述

我有以下自定义操作,这些操作通常从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服务中却看不到任何东西。

解决方法

这个对我有用,

  DAY_OF_WEEK      HOUR  id
0      Monday  21:02:02   1
1      Sunday  11:22:02   2
2    Saturday  23:02:02   2