通过使用 copyfile 元素文件无法绑定到 msi 包中

发布于 2024-08-12 07:54:41 字数 152 浏览 9 评论 0原文

我正在使用wix 3.0。我有一个文件夹名称“images”。所以我想将图像中的所有文件复制到msi包中。当我复制所有文件并将msi安装到另一台电脑时,它没有绑定图像。当我使用简单的文件元素时,文件绑定到 msi 包。那我该怎么办,

尽快回复我

谢谢 萨米尔

i am using wix 3.0.i have a folder name "images".so i want to copy all the files from images into msi package.when i copy all the file and install msi to another PC then it did not bind the images. And when i use simple File Element then the files bind to msi package. so what should i do,

Reply me soon

Thanking You
Samir

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

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

发布评论

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

评论(1

烂人 2024-08-19 07:54:41

显然,您想要创建一个可以生成屏幕保护程序安装程序的应用程序,其中包括用户选择的许多图像文件 - 一种专门用于创建屏幕保护程序安装程序的专用 InstallShield 应用程序。

我首先创建一个模板 MSI 文件(使用 wix
或其他东西),大部分
工作。您不知道用户稍后将选择哪些文件,因此添加 ID 为“UserSelectedFiles”的占位符组件。分发这个
包含您的应用程序的模板 MSI 文件。

然后,当用户想要生成一个
新的安装程序,首先复制
模板。编辑复制的 msi,以便它也安装用户选择的文件。您可以使用 .NET 类来完成此操作
你可以在“部署
工具基础”API。这是wix附带的一组程序集;看看
C:\program files\Windows Installer
XML v3\sdk

我只将 DTF API 用于一些简单的事情,例如这个示例,它计算 MSI 中的文件表条目:

var database = new Database(@"\path\to\some\file.msi");
var list = database.ExecuteQuery("SELECT FileName FROM File");
Console.WriteLine(list.Count);

您的情况会更复杂一些。您可能需要

  • 生成一个 CAB 存档,其中包含
    包含您的类的图像文件
    找到在
    Microsoft.Deployment.Compression.Cab
    命名空间。
  • 将CAB存档合并到msi中
    使用 Database.Merge
  • 将新条目添加到文件表中
    将产品
  • 代码更改为每个生成的 MSI 的唯一代码

要了解 MSI 文件的内容以及如何编辑它,我建议您首先尝试一下 Orcamsidb 工具。

Apparently you want to create an application that can generate a screensaver installer that includes a number of image files selected by the user — a sort of specialized InstallShield application just for creating screensavers installers.

I would first create a template MSI file (with wix
or something else) that does most of
the work. You don't know which files the user is going to select later on, so add a placeholder component with the ID "UserSelectedFiles". Distribute this
template MSI file with your application.

Then, when the user wants to generate a
new installer, start by copying the
template. Edit the copied msi so that it also installs the user selected files. You can do this with the .NET classes
you can find in the "deployment
tools foundation" API. This is a set of assemblies that come with wix; take a look at
C:\program files\Windows Installer
XML v3\sdk
.

I have only used the DTF API for some simple stuff, like this example which counts the File table entries in the MSI:

var database = new Database(@"\path\to\some\file.msi");
var list = database.ExecuteQuery("SELECT FileName FROM File");
Console.WriteLine(list.Count);

Your case will be a bit more complicated. You will probably have to

  • generate a CAB archive that contains
    the image files with the classes you
    find in the
    Microsoft.Deployment.Compression.Cab
    namespace.
  • merge the CAB archive into the msi
    with Database.Merge
  • Add new entries to the File table
    of the MSI
  • Change the product code to something unique for each generated MSI
  • etcetera

To get an idea of the content of an MSI file and how it can be edited, I recommend you first play around a bit with the orca and msidb tools.

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