Wix - 升级始终运行较旧的安装程序 msi,并且在尝试读取旧的 msi 时失败
我在安装程序的 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>
我收到的错误是:
尝试读取文件时发生网络错误:
谢谢,
I'm having a problem though with the Windows caching of the installer. I'm trying to do an upgrade and each time the Windows installer is launching the installer of the older version. And when I do the upgrade it is complaining about problems with reading the older version's msi file (because its not in the same directory anymore).
I did change the UpgradeCode and the ProductCode but kept the PackageCode the same. I also have different ProductVersion codes (2.2.3 vs 2.3.0).
Here's a sample of my code:
<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>
This is the Install Sequence:
<InstallExecuteSequence>
<Custom Action='SetUpgradeParams' After='InstallFiles'>Installed AND NEWAPPFOUND</Custom>
<Custom Action='Upgrade' After='SetUpgradeParams'>Installed AND NEWAPPFOUND</Custom>
</InstallExecuteSequence>
The error I am getting is:
A network error occurred while attempting to read from the file:
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不要不要保留相同的PackageCode 。
您确实希望自动生成此文件...请参阅文档:
这是我们生产环境中的一个示例...
现在这种方法的缺点是它意味着您可能还想强制执行重大升级,而只关心所引用的升级代码。现在我们可以利用这样一个事实:对于 Windows Installer 软件包,只有前三个字段很重要,例如 1.0.0.1 和 1.0.0.2 都被解释为 1.0.0(文档中明确提到了这一点,因此我们可以依赖)
扩展此逻辑,我们可以在每个构建中自动递增(忽略)第四个版本字段,但在前三个版本相同时阻止升级。
好处是这对客户完全透明,但可以防止内部测试/QA 团队在另一个“构建”之上安装一个“构建”,并且您还需要确保在任何公开发布之后立即手动增加前三个版本字段之一。
Do NOT keep the same PackageCode.
You really want to have this automatically generated... refer the documentation:
Here's an example from our production environment...
Now the downside of this approach is it means you probably also want to enforce major upgrades, which only care about the upgrade code being referenced. Now we can take advantage of the fact that for Windows Installer packages only the first three fields are significant, e.g. 1.0.0.1 and 1.0.0.2 both are interpreted as 1.0.0 (this is explicitly mentioned in the documentation, so we can rely on it.)
Extending this logic, we can auto-increment the (ignored) fourth version field with every build but prevent upgrade when the first three are the same.
The upside is this is completely transparent to customers, but prevents internal test/QA teams from installing one "build" on top of another and you also need to ensure that immediately following any public release you manually increment one of the first three version fields.
您需要保持升级代码相同并更改产品代码(如果您想要升级)。
在 InstallExecuteSequence 中,您需要以下行,
在此示例中,我选择将操作放在 installInitialize 序列之后,但是您可以将它们放置在其他位置,这会给您带来不同的效果。
这是一个很好的参考
You need to keep the upgrade code the same and change the product code (if you want an upgrade).
In the InstallExecuteSequence you need the following line
I have chosen to put the action after the installInitialize sequence in this example however you can place them in other locations which will give you different effects.
This is a good reference
这是源代码(或者我能提供的尽可能多的源代码):
http://schemas.microsoft.com/wix/2003/01/wi'>
……
Here's the source code (or as much of it as I can give):
http://schemas.microsoft.com/wix/2003/01/wi'>
.....
您的产品元素说明了什么?
您需要在升级表和产品表中指定相同的升级代码,即
它也需要在原始表中,如果最初没有在其中指定,那么也许您可以运行 CA 使用 shell 命令将其删除。
除此之外,一切看起来都不错。
日志中的“查找相关产品”部分是否有任何内容?
What does your product element say?
You need to specify the same upgrade code in the upgrade table and the product table ie
and it needs to be in the original one aswell if it wasnt originally specified there then maybe you can run a CA to remove it with shell command.
Apart from that it all looks ok.
In the log does it say anything in the "Findrelatedproducts" section?