使用 Wix 使用 CustomAction 在网络共享上运行可执行文件?

发布于 2024-08-22 02:28:22 字数 769 浏览 3 评论 0原文

我创建了一个 msi 包,它在安装过程中将一些 xml 文件压缩为 zip 文件。我为此目的创建了一个 CustomAction:

<CustomAction Id="CompressMy" BinaryKey="zipEXE" ExeCommand="a -tzip &quot;[TEMPLATE_DIR]my.zip&quot; &quot;[TempSourceFolder]data.xml&quot;" Return="check" HideTarget="no" Impersonate="no" Execute="deferred" />

如果我尝试安装到本地驱动器,安装工作正常,但最近一位客户想要将 [TEMPLATE_DIR] 安装到 Windows Vista 上的网络驱动器。 CustomAction 失败,因为提升的安装用户尚未映射网络驱动器,即使安装程序调用用户已映射驱动器也是如此。如果我尝试安装到 unc 路径,也会发生这种情况。我使用7zip进行压缩。我已将其添加到我的 msi 包中。

我尝试设置 Impersonate="yes",但如果我的 TEMPLATE_DIR 是 ProgramData-dir,则安装会失败。

你知道我能做什么吗?我考虑过检查 TEMPLATE_DIR 是否是网络路径,但我不知道如何检查它。或者您对如何在使用此自定义操作时提供本地和网络安装有任何其他想法。

如果有任何建议、

问候,那就太好了,马丁

i have created a msi-package which compresses some xml-files to a zip-file during installation. I have created a CustomAction for this purposes:

<CustomAction Id="CompressMy" BinaryKey="zipEXE" ExeCommand="a -tzip "[TEMPLATE_DIR]my.zip" "[TempSourceFolder]data.xml"" Return="check" HideTarget="no" Impersonate="no" Execute="deferred" />

The installation works fine, if i try to install to a local drive, but recently a customer wanted to install [TEMPLATE_DIR] to a network drive on Windows Vista. The CustomAction fails, because of the elevated install-user hasn't mapped the network drive, even if the installer-calling user has mapped the drive. This happens also, if I try to install to an unc-path. I use 7zip for compressing. I have added it to my msi-package.

I have tried to set Impersonate="yes", but then the Installations fails, if my TEMPLATE_DIR is f.e. the ProgramData-dir.

Do you have any idea what i can do? I thinked about checking if TEMPLATE_DIR is a network path, but I didn't know how i can check this. Or do you have any other Ideas how I can provide a local and a network installation while using this custom action.

Would be great if there are any advices,

greetings, Martin

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

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

发布评论

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

评论(1

绮烟 2024-08-29 02:28:22

完成任务的一种方法是使用本机代码进行自定义操作。我有类似的问题,我将所有可能的 CA 转换为本机代码(C++)

一切顺利

One way to accomplish you task is to use native code for you custom action. I had similar problem and I converted all of may CA to native code (C++)

All the Best

s

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