Wix 运行 "Newer version is installed" 时的自定义操作

Wix Run Custom Action When "Newer version is installed"

如何在 "newer version is already installed" 安装完成后为我的应用设置自定义操作 运行?

我想要的:如果安装了较新的版本,只需运行。 运行 应用始终,删除除外。

我的配置:

<CustomAction Id="LaunchApplication" Directory='INSTALLFOLDER' ExeCommand="[INSTALLFOLDER]\MyApp.exe"
              Return="asyncNoWait" />

<InstallExecuteSequence>
  <Custom Action="LaunchApplication" After="InstallFinalize">NOT (REMOVE="ALL")</Custom>
</InstallExecuteSequence>

谢谢

通过日志解决:app.msi /l*v log.txt

工作配置:

<CustomAction Id="LaunchApplication" Directory='INSTALLFOLDER' ExeCommand="[INSTALLFOLDER]\MyApp.exe"
              Return="asyncNoWait" />
<CustomAction Id="SetLaunchApplicationPath" Property="LaunchApplicationPath" Value="[ProgramFilesFolder][Manufacturer]\[ProductName]\MyApp.exe">
</CustomAction>
<CustomAction Id="LaunchApplicationOnDowngrade" ExeCommand="[SetLaunchApplicationPath]" Property="LaunchApplicationPath"
              Return="asyncNoWait" />

<InstallUISequence >
  <Custom Action="SetLaunchApplicationPath" After="FindRelatedProducts">WIX_DOWNGRADE_DETECTED</Custom>
  <Custom Action="LaunchApplicationOnDowngrade" After="SetLaunchApplicationPath">LaunchApplicationPath</Custom>
</InstallUISequence>
<InstallExecuteSequence>
  <Custom Action="LaunchApplication" After="InstallFinalize" >NOT (REMOVE="ALL")</Custom>
</InstallExecuteSequence>

动作 LaunchApplication 在 install/update 完成时执行 当 FindRelatedProducts Action

找到较新版本的产品时安装失败时执行 LaunchApplicationOnDowngrade 操作

我使用<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />配置升级。