简体   繁体   English

如何通过visual studio安装项目降级程序?

[英]How to downgrade program by visual studio setup project?

I have program on C#.我有 C# 程序。 I create VS Setup for this project.我为这个项目创建了 VS 安装程序。 First of all i create setup for version 1.0.0, then i create for 1.0.1.首先我为 1.0.0 版创建设置,然后我为 1.0.1 创建。

In Setup Properties I check DetectNewerInstalledVersion to false, and RemovePreviousVersion to true.在设置属性中,我将DetectNewerInstalledVersion 选中为 false,将RemovePreviousVersion选中为 true。

在此处输入图片说明

After install 1.0.0 I try to Upgrade to 1.0.1 by run setup v. 1.0.1.安装 1.0.0 后,我尝试通过运行 setup v. 1.0.1 升级到 1.0.1。 It`s finish success.它完成成功。 But when I try to downgrade to 1.0.0 it`s install me to regedit 2 positions (I mean 1.0.0 and 1.0.1), and in application folder left 1.0.1, not 1.0.0.但是当我尝试降级到 1.0.0 时,它会将我安装到regedit 2 个位置(我的意思是 1.0.0 和 1.0.1),并且在应用程序文件夹中留下 1.0.1,而不是 1.0.0。 How to downgrade program from 1.0.1 to 1.0.0 in one step - install 1.0.0?如何一步将程序从 1.0.1 降级到 1.0.0 - 安装 1.0.0?

There's no support for this in Visual Studio setups. Visual Studio 设置中不支持此功能。 I suspect that in most situations going back to an earlier version is unusual, so a manual uninstall of the newer one would be done first.我怀疑在大多数情况下返回早期版本是不寻常的,因此会先手动卸载较新的版本。

That means you need to use another tool that supports downgrades (I know WiX does) or edit the MSI file (with Orca from the Windows kit) as follows:这意味着您需要使用另一个支持降级的工具(我知道 WiX 支持)或编辑 MSI 文件(使用 Windows 工具包中的 Orca),如下所示:

Open the MSI file and go to the Upgrade table.打开 MSI 文件并转到升级表。 Delete the 1.0.1 (or whatever) is in the VersionMax column.删除 VersionMax 列中的 1.0.1(或其他)。 Add a 0 to the VersionMin column, then save the file.将 0 添加到 VersionMin 列,然后保存文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM