gpt4 book ai didi

installation - Wix - 升级总是运行较旧的安装程序 msi 并且在尝试读取旧 msi 时失败

转载 作者:行者123 更新时间:2023-12-01 00:02:19 26 4
gpt4 key购买 nike

我在安装程序的 Windows 缓存方面遇到了问题。我正在尝试进行升级,每次 Windows 安装程序启动旧版本的安装程序时。当我进行升级时,它提示读取旧版本的 msi 文件时出现问题(因为它不再位于同一目录中)。

我确实更改了 UpgradeCode 和 ProductCode,但保持 PackageCode 不变。我也有不同的 ProductVersion 代码(2.2.3 与 2.3.0)。

这是我的代码示例:

<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Property="OLDAPPFOUND"
IncludeMinimum="yes"
Minimum="$(var.RTMProductVersion)"
IncludeMaximum="no"
Maximum="$(var.ProductVersion)"/>
<UpgradeVersion Property="NEWAPPFOUND"
IncludeMinimum="no"
Minimum="$(var.ProductVersion)"
OnlyDetect="yes"/>
</Upgrade>

这是安装顺序:
<InstallExecuteSequence>
<Custom Action='SetUpgradeParams' After='InstallFiles'>Installed AND NEWAPPFOUND</Custom>
<Custom Action='Upgrade' After='SetUpgradeParams'>Installed AND NEWAPPFOUND</Custom>
</InstallExecuteSequence>

我得到的错误是:

尝试从文件中读取时发生网络错误:

谢谢,

最佳答案

不是 保持不变 PackageCode .
你真的想自动生成这个......请参阅文档:

Nonidentical .msi files should nothave the same package code. It isimportant to change the package codebecause it is the primary identifierused by the installer to search forand validate the correct package for agiven installation. If a package ischanged without changing the packagecode, the installer may not use thenewer package if both are stillaccessible to the installer.


这是我们生产环境中的一个例子......
<Product Id="*"
UpgradeCode="$(var.Property_UpgradeCode)"
Name="!(loc.ApplicationName)"
Language="!(loc.Property_ProductLanguage)"
Version="$(var.version)"
Manufacturer="!(loc.ManufacturerName)" >

<Package Description="!(loc.Package_Description) $(var.version)"
Comments="!(loc.Package_Comments)"
Manufacturer="!(loc.ManufacturerName)"
InstallerVersion="301"
Compressed="yes"
InstallPrivileges="elevated"
InstallScope="perMachine"
Platform="$(var.ProcessorArchitecture)" />
现在这种方法的缺点是它意味着你可能还想强制执行主要升级,它只关心被引用的升级代码。现在我们可以利用以下事实:对于 Windows 安装程序包,只有前三个字段是重要的,例如1.0.0.1 和 1.0.0.2 都被解释为 1.0.0(文档中明确提到了这一点,所以我们可以依赖它。)
扩展此逻辑,我们可以在每次构建时自动增加(忽略的)第四个版本字段,但在前三个版本相同时阻止升级。
    <UpgradeVersion Property="ANOTHERBUILDINSTALLED"
Maximum="$(var.version)" Minimum="$(var.version)"
IncludeMinimum="yes" IncludeMaximum="yes" OnlyDetect="yes" />
好处是这对客户完全透明,但会阻止内部测试/QA 团队在另一个“构建”之上安装一个“构建”,并且您还需要确保在任何公开发布后立即手动增加前三个版本字段之一。

关于installation - Wix - 升级总是运行较旧的安装程序 msi 并且在尝试读取旧 msi 时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2784173/

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