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

标签 installation wix windows-installer upgrade

我在安装程序的 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 not have the same package code. It is important to change the package code because it is the primary identifier used by the installer to search for and validate the correct package for a given installation. If a package is changed without changing the package code, the installer may not use the newer package if both are still accessible 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/

相关文章:

python-2.7 - Pyrouge安装测试结果在 "FAILED (errors=10)"

Android 小部件仅显示用于调试;应用程序图标总是显示

windows-installer - 如何在InstallShield的安装要求页面添加新的框架版本?

维克斯 : error LGHT0204 : ICE80: This 32BitComponent xxx uses 64BitDirectory yyy

mysql - 如何在没有数据库的情况下安装 MySQL 客户端(在 Windows 服务器上)

windows - 在用户文件夹中安装 PostgreSQL 数据

Wix 绑定(bind)子字符串或拆分

Wix 自定义操作 - session 为空且延迟操作时出错

xml - 使用 XSLT 转换 Heat 生成的 .wxs(添加 RegistryValue 并编辑一些值)

windows-installer - 替换 MSI 中的小文件的最简单解决方案?