winforms - 使用 WiX 引导程序安装 winforms 应用程序的先决条件
问题描述
我创建了一个 C# WinForms 应用程序,它依赖于 .NET Framework 版本 4.6.1 和 GhostScript 9.2.1(32 位 Windows)。我为 WinForms 应用程序制作了一个简单的 Windows 安装程序(.msi 文件),但 GhostScript 库拒绝安装。因此,我决定使用 WiX 引导程序制作捆绑安装程序。
在引导程序项目中,我打包了之前的 GhostScript exe 安装程序和简单的 msi 安装程序。我想我还在引导程序的前几行中处理了 .NET 框架。
现在,我在使用 Bootstrap 安装程序时仍然面临一个问题。问题是安装跳过了 msi 安装程序。如何让 Bootstrap 安装成功完成?
这是引导程序项目的 XML:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="POD" UpgradeCode="390cbc0b-980b-4f35-a9de-a11228f75b69">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<PayloadGroup Id="NetFx461RedistPayload">
<Payload Name="redist\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"
SourceFile="C:\Users\Admin\Downloads\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"/>
</PayloadGroup>
<Chain>
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
<PackageGroupRef Id="NetFx461Web"/>
<ExePackage Id="Ghostscript_32_bit_Version_9.2.1"
Cache="yes"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="C:\Users\Admin\Downloads\gs921w32new.exe"
InstallCommand="/passive /norestart" />
<MsiPackage Id="POD_Measuring_Tool"
Cache="yes"
Compressed="yes"
Permanent="yes"
Vital="yes"
SourceFile="C:\Users\Admin\Documents\POD\Workspace Folder\c# projects\6lumber\toolPOD\Debug\toolPOD.msi" />
</Chain>
</Bundle>
</Wix>
我引用了 WixBalExtension 和 WixNetFxExtension,msi 文件和 ghostscript exe 来自我的计算机。
解决方案
问题是安装跳过了 msi 安装程序。
这可能表明该产品已安装。MsiPackage
将通过检查注册表中的产品代码自动检测是否已安装 msi。
该MsiPackage/@Permanent
属性还意味着在卸载 Bootstrapper 时不会删除您的产品 - 因此请检查您是否手动删除了 msi,并且日志记录有助于-l logfile.txt
切换。
推荐阅读
- html - CSS Flex,如何显示具有自定义顺序和水平滚动功能的列表
- javascript - 如何在 javascript 函数中从 smarty 模板发送数组作为参数
- jsf-2.2 - 带有 h:dataTable 的 JSF Facelet 无法识别
- php - 将多个文件放在后台作业或单个文件中更好吗?
- java - 在春季使用 JPA 更新查询?
- jenkins - Jenkins-pipeline:没有这样的 DSL 方法
- ios - 如何使用 dailymotion api 实现对 chromecast 的投射
- java - 如何在 Android 中通过 StaticLayout 使用指定的段落间距
- python - 如果在 Python 中将打印输出限制为每个小数位 1 个语句
- php - phpspreedsheet 数据出现损坏的格式