为什么我的新 Windows 安装程序文件 (MSI) 不能在旧版本的 MSI 上正确安装? [英] Why doesn't my new Windows Installer file (MSI) install properly over an older version of the MSI?

查看:43
本文介绍了为什么我的新 Windows 安装程序文件 (MSI) 不能在旧版本的 MSI 上正确安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

症状

我新建了安装包 (MSI),用于安装我的应用程序的新版本.

我的安装有一个新的 ProductCode,但我的 UpgradeCode 保持不变.

因此,当我执行新的 MSI 时,它首先会正确卸载旧版本.甚至 Program Files\MyProduct 目录也被删除了.

但是在卸载旧版本后,安装程序只会部分安装新版本.如果我修复损坏的新安装(使用添加删除程序"->修改安装"->修复"),一切都会修复.

如果我首先使用添加删除程序"卸载旧版本,然后安装新版本,则一切正常.仅当我在旧版本之上安装新版本时才会出现此问题.

可能的原因

旧版本中各种dll和exe的版本号都乱了.旧的 exe 版本是 4.11.1234.新 exe 的版本是 4.5.1234.根据文件版本控制规则"新文件不会覆盖旧文件.我挠头的原因是,当 InstallFiles 操作执行时,目标文件不再驻留在磁盘上.

其他信息

我的目标是 Windows Installer 3.1.

我的安装执行顺序大致是:

<预><代码>...安装验证移除现有产品安装初始化...安装文件...安装执行安装完成....

如果此上下文没有使问题清晰,请告诉我...

谢谢!

解决方案

我假设您还更改了 PackageCodeProductVersion?

<块引用>

我抓我的原因头是那个时候InstallFiles 操作执行目标文件不再驻留在磁盘."

是的,但 MSI 会在文件被物理删除之前决定安装/不安装文件——该决定是在第一次通过 InstallExecute 序列时做出的,此时文件仍在硬盘驱动器上.

我遇到了你遇到的问题,我能够通过将文件的版本更改为比硬盘驱动器上已有的版本更新来解决它——你能做到吗?

另一种选择:您是否使用 InstallShield?您可以选择为单个文件设置两个属性之一来解决问题:1) 始终覆盖,2) 覆盖系统版本.始终覆盖"将自动将版本号设置为 65535.0.0.0,从而启用安装.覆盖系统版本"允许您输入自己的版本,高于实际文件版本,从而也可以安装.右键单击该文件并查看属性"以设置这些选项.

Symptoms

I have newly created setup package (MSI) that installs a new version of my application.

I have a new ProductCode for my installation but I have left the UpgradeCode the same.

So when I execute the new MSI it first uninstalls the old version correctly. Even the Program Files\MyProduct directory is removed.

But after uninstalling the old version the installer then only partially installs the new version. If I repair the damaged new installation (Using Add Remove Programs->Modify Installation->Repair), everything is fixed.

If I first uninstall the old version using Add Remove Programs and then install the new version everything works great. The problem only occurs when I install the new version over top of the old version.

Possible Cause

The version numbers for various dlls and exes in the old version were messed up. The old exe version is 4.11.1234. The version for the new exe is 4.5.1234. According to the "File Versioning Rules" the new file will not overwrite the old file. The reason why I am scratching my head is that by the time the InstallFiles action executes the destination file no longer resides on the disk.

Other Information

I'm targeting Windows Installer 3.1.

My installation execution sequence is roughly:

...
InstallValidate
RemoveExistingProducts
InstallInitialize
...
InstallFiles
...
InstallExecute
InstallFinalize
....

If this context doesn't make the question clear, let me know...

Thanks!

解决方案

I'm assuming you also changed the PackageCode and ProductVersion?

"The reason why I am scratching my head is that by the time the InstallFiles action executes the destination file no longer resides on the disk."

Yes, but MSI makes the decision to install/not install files before the files get physically removed -- that decision is made during the 1st pass through the InstallExecute sequence, when files are still on the hard drive.

I had the problem you have, and I was able to solve it by changing the files' version to be newer than those already on the hard drive -- can you do that?

Another option: Are you using InstallShield? You can choose to set one of two properties on individual files that would solve the problem: 1) Always Overwrite, 2) Override System Version. "Always Overwrite" will automatically set the version number to 65535.0.0.0, thus enabling installation. "Override System Version" allows you to enter in your own version, higher than the real file version, and thus also enabling installation. Right-click on the file and see Properties to set these options.

这篇关于为什么我的新 Windows 安装程序文件 (MSI) 不能在旧版本的 MSI 上正确安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆