简体   繁体   English

Wix-在安装结束时运行一个exe(带有自变量),当前MSI尚未安装

[英]Wix - Run an exe ( with arguments ) at end of install, which wasn't installed by current MSI

I have a MSI created in WiX 3.6 that obviously installs various things and creates a shortcut to an exe that isn't actually installed by my MSI ( we know for certain that the exe is located in a specific folder, because it's installed by a seperate MSI, that is a required pre-req for my MSI ). 我在WiX 3.6中创建了一个MSI,它显然会安装各种东西,并为我的MSI实际未安装的exe创建一个快捷方式(我们确定该exe位于一个特定的文件夹中,因为该文件是由单独的文件夹安装的MSI,这是我的MSI必需的先决条件。 The shortcut we create, passes in some arguments that actually tell the exe to use stuff that we've just installed. 我们创建的快捷方式会传入一些参数,这些参数实际上告诉exe使用我们刚刚安装的内容。 This all works fine, but I now want the MSI to automatically run the exe with the same arguments as we use in the shortcut. 一切正常,但是我现在希望MSI以与在快捷方式中使用的相同参数自动运行exe。

I tried following this article - http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html but it assumes you want to run an exe you have just installed and doesn't seem to use exe arguments. 我尝试按照以下文章进行操作-http: //wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html,但它假设您要运行刚刚安装的exe,并且似乎不使用exe参数。

I also tried using a custom action like - 我也尝试使用自定义操作,例如-

<CustomAction Id="RunMainApp"
          Directory="FREDFOLDER"
          ExeCommand="[FREDFOLDER]Fred.exe -SBDSingleApp -SBDSplash=&quot;MySplash.bmp&quot;"
          Execute="commit"
          Return="ignore"/>

<InstallExecuteSequence>
  <Custom Action="RunMainApp" Before="InstallFinalize" />
</InstallExecuteSequence>

this was more promising - it ran the exe, but did so before the actual installation had finished - which obviously isn't correct. 这更有希望-它运行了exe,但是在实际安装完成之前这样做-显然是不正确的。

To be honest, I'm not that bothered if about having a UI as in the first example - because 90% of the time the MSI will be run in quiet mode without the wizard been displayed. 坦白地说,如果像第一个示例中那样具有UI,我不会感到烦恼-因为90%的时间MSI将在安静模式下运行而不显示向导。

您是否尝试过将Execute =“ commit”更改为Execute =“ deferred”,这将使自定义操作在安装脚本运行之后运行,但在安装过程完成之后不会运行,因为后者可能不在执行上下文中安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM