Wix:在运行时检测到的多个目录中部署文件

发布于 2024-10-02 18:13:12 字数 382 浏览 1 评论 0原文

这与 Wix 有关:

我遇到一种情况,必须将文件部署到多个目录中,这些目录的值是从注册表中获取的。现在这些目录可以是从 1 到多个。

而且我不想创建太多其值将在运行时确定的目录条目。

我们可以在循环中调用自定义操作来检测目标目录并设置目标文件夹值吗?

我知道我们可以在自定义操作中进行此类复制。但我正在寻找一种通过 WIX 条目来做到这一点的方法。

我正在阅读有关 DuplicateFiles Action 的内容,但没有找到一些适当的方法来实现我的目标。

多谢

This is related to Wix:

I have a situation in which I have to deploy a file into multiple directories whose values being fetched from registry. Now these directories could be from 1 to many.

And I don't want to create too many Directory entries whose values would be determined at runtime.

Can we call a custom action in a loop which would be detecting the target Directories and setting-up our target folder values?

I know we can do such copying inside a Custom Action. But I'm looking for a way to do this via WIX entries.

I was reading about DuplicateFiles Action but not getting some proper methodology to achieve my goal.

Thanks a lot

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

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

发布评论

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

评论(1

墟烟 2024-10-09 18:13:12

WiX 元素 CopyFile 映射到 DuplicateFiles 操作。您可以使用 AppSearch 设置属性,然后使用 CopyFile 将文件复制到目录。 DuplicateFiles 足够聪明,如果该属性为 null,则不会执行任何操作。

如果在创建安装程序时已知副本数量,则可以这样做。如果您认为它在运行时会以某种方式更加动态,您可以编写一个自定义操作,将临时行发送到 DuplicateFile 表,这样 DuplicateFiles 和 RemoveDuplicateFiles 仍然可以完成繁重的工作。

您可以使用动态 Windows Installer UI 中描述的主体。

The WiX element CopyFile maps to the DuplicateFiles action. You can use AppSearch to set properties and then use CopyFile to duplicate a file to a directory. DuplicateFiles is smart enough to not do anything if the property is null.

If the number of copies is known when you create your installer you can just do that. If you think it's going to somehow be more dynamic at runtime, you can write a custom action that emits temporary rows to the DuplicateFile table that way DuplicateFiles and RemoveDuplicateFiles still does the heavy lifting.

You can use the principals described at Dynamic Windows Installer UI.

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