gpt4 book ai didi

visual-studio-2005 - Bootstrap : How to compile the application and prerequisite in single . msi 包?

转载 作者:行者123 更新时间:2023-12-01 10:16:15 25 4
gpt4 key购买 nike

我正在为具有安装先决条件的应用程序创建 .msi 包。我正在使用 Visual Studio 2005 Bootstrapper 来完成这项任务。为此,我做了以下工作:找到文件夹 C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\并为我的先决条件创建一个文件夹(使其结构与“dotnetfx”相同);创建“product.xml”和“package.xml”并适当放置它们。到目前为止,我使 xml 文件非常简单以测试安装:

产品.xml

<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="MyPrereq" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="MyPrereq.exe" />
</PackageFiles>
<InstallChecks>
</InstallChecks>
<Commands Reboot="None">
<Command PackageFile="MyPrereq.exe" EstimatedInstallSeconds="90">
<InstallConditions>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
</Commands>
</Product>

包.xml

<?xml version="1.0" encoding="utf-8"?>
<Package Name="MyPrereq" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<Strings>
<String Name="Culture">en</String>
<String Name="DisplayName">MyPrereq</String>
<String Name="GeneralFailure">A fatal error occurred. The installation failed.</String>
</Strings>
</Package>

现在我可以从列表中添加先决条件并构建我的设置项目。

问题:

构建输出是“setup.exe”、“MyApp.msi”包,以及名为“MyPrereq”的子文件夹,其中包含“MyPrereq.exe”。

我希望构建创建一个“setup.exe”和一个“MyApp.msi”,其中包含“MyPrereq”,没有其他文件/目录。

我知道 .NET 框架是我的应用程序的另一个先决条件,它包含在同一个 .msi 中,因此应该可以通过某种方式实现。

我怎样才能做到这一点?

最佳答案

您可以使用 IExpress(随 Windows 提供)等工具创建一个自解压安装程序,其中包含单个可执行文件中的所有文件(请参阅 this SO posting)。

您不能让 MSI 文件安装它自己的先决条件。首先,因为 Windows Installer 本身是先决条件(并且必须由非 MSI exe 安装),其次因为 Windows Installer 安装是事务性的,不支持 MSI 文件的链式执行。这基本上意味着一个 MSI 安装无法启动另一个 MSI 安装。因此,任何先决条件必须由单独的 Bootstrap 安装(顺便说一句,安装不再是事务性的 - 如果 MSI 安装失败,则不会卸载先决条件)。

不过,似乎对 Bootstrap 机制存在基本的误解。 Bootstrap 目前只能由 Visual Studio 或 MSBuild 生成。 Afaik WiX 是不可能的。在 MSBuild 中查找 GenerateBootstrapper 任务(请参阅 this SO posting)。

关于visual-studio-2005 - Bootstrap : How to compile the application and prerequisite in single . msi 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/567592/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com