使用 WixUI_Minimal 进行 Wix 自定义操作

发布于 2024-07-09 14:12:02 字数 631 浏览 4 评论 0原文

因此,我尝试在应用程序完成安装后(尽管事实上,辅助应用程序何时运行并不重要,因为它在安装过程中不会与已安装的文件交互),运行另一个程序,该程序是与应用程序捆绑在一起。 相关代码(各种内容替换为“...”:

<directory ...>
  <component ...>
  <File Id="IDINST" ... />
  </component>
</directory>
...
<CustomAction Id="IDACTION" FileKey="IDINST" ExeCommand="..." Return="ignore" />
...
<InstallExecuteSequence>
  <Custom Action="IDACTION" After="CostFinalize" />
</InstallExecuteSequence>

我检查了目录并且文件位于我预期的位置,但在安装过程后并未执行。事实上,我什至不想安装该文件,只需运行然后删除。无论如何,我已经看到了几个在对话框后触发操作的示例,但由于我当前正在使用 我认为这并不理想。

So, I'm trying to, after an application finishes installing (though in truth, it really doesn't matter when the secondary application is run, since it doesn't interact with the installed files during installation), run another program which is bundled with the application. Pertinent code (with various stuff replaced with "...":

<directory ...>
  <component ...>
  <File Id="IDINST" ... />
  </component>
</directory>
...
<CustomAction Id="IDACTION" FileKey="IDINST" ExeCommand="..." Return="ignore" />
...
<InstallExecuteSequence>
  <Custom Action="IDACTION" After="CostFinalize" />
</InstallExecuteSequence>

I checked the directory and the file was where I expected, but it was not executed after the install process. In truth I really don't even want that file to be installed, just run and then deleted. But I'll ignore that for now. Anyways, I've seen several examples of triggering actions after dialogs but since I'm currently using <UIRef Id="WixUI_Minimal" /> I don't think that's ideal.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天冷不及心凉 2024-07-16 14:12:03

CostFinalize 发生在 InstallFiles 延迟操作运行(实际放置文件)之前很久。 因此,CustomAction 失败(因为文件不可用)(因为 Return 被忽略),

您需要至少在 InstallFiles 之后安排 CustomAction 并推迟,或者如果 CustomAction 无法延迟运行,那么它必须在 InstallFinalize 之后(当然,InstallFinalize之后不会导致回滚)。

CostFinalize happens long before InstallFiles deferred action runs (that actually places the file). Thus the CustomAction is failing (because the file isn't available) silently (because Return is ignore)

You need your CustomAction scheduled at least after InstallFiles and be deferred or if the CustomAction can't run deferred then it has to be after InstallFinalize (of course, it can't cause rollback after InstallFinalize).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文