在旧版本上安装新版本的部署项目

发布于 2024-09-04 22:19:17 字数 89 浏览 5 评论 0原文

我有一个部署项目,不允许我安装旧版本。 msi 文件表示首先从“添加/删除程序”中卸载该程序。这不是一个好的用户体验。我怎样才能让安装程序先删除软件然后安装新版本?

I have a deployment project which will not let me install over an older version. The msi file says to uninstall the program first from Add/Remove programs. This is not a good user experience. How can I do it so that the installer will simply remove the software first and then install the new version?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

芯好空 2024-09-11 22:19:17

这很棘手,您必须执行以下步骤,

  1. 将删除以前的安装设置为 True
  2. 将检测新版本设置为 True
  3. 您的 C# 程序的版本必须随着每次部署而增加
  4. 您应该将安装程序的版本更改为更高的版本,它会要求您更改产品代码,选择是。
  5. 不要更改您的升级代码,保持相同。

如果您没有正确执行第三步,安装程序仍将安装并保留旧文件,如果您更改了内容,则每个文件的文件版本都必须是新的。

This is tricky, you have to do following steps,

  1. Set Remove Previous Installation as True
  2. Set Detect new version as True
  3. Your C# program's version must increase with every deployment
  4. You should change version of your installer to one higher version and it will ask you to change product code, select YES.
  5. Do not change your upgrade code, let it be same.

If you do not do 3rd step correctly, installer will still install and keep the old file, your file version of every file must be new if you have changed your content.

久夏青 2024-09-11 22:19:17

我尝试了一些场景,也许这会帮助某人节省一些时间

如果程序集版本发生变化并且项目安装程序版本发生变化(ProductCode Guid 也发生变化)
->应用程序安装在现有应用程序的基础上
-> dll 和 exe 版本得到更新
->如果安装路径不同,现有的初始安装项目文件将从安装位置删除。 (以及此后保留的文件)

如果程序集版本更改并且项目安装程序版本更改(没有更改 ProductCode Guid)
->要求用户手动删除该应用程序
->如果他们继续并首先从控制面板中删除,则可以安装应用程序,并将 dll 和 exe 更新到新版本

如果仅程序集版本更改,或仅项目安装程序版本更改(不更改 ProductCode Guid)
->要求用户手动删除该应用程序
->如果他们继续并首先从控制面板中删除,则可以安装应用程序,并将 dll 和 exe 更新到新版本

如果仅项目安装程序版本发生变化(产品代码 Guid 也发生变化)
-> MSI 完成安装过程,但 dll 和 exe 不会更改版本 - 它们按照程序集版本,并被替换为相同程序集构建版本的文件
->如果安装路径不同,现有的初始安装项目文件将从安装位置删除。 (此后保留的任何文件)

如果项目安装程序版本发生变化(ProductCode Guid 也发生变化)并且程序集版本低于已安装版本
->安装将开始,最终用户被告知安装失败,因为旧版本。

I tried out a few scenarios, maybe this will help someone save some time

If Assembly Version changes AND project installer version changes (with ProductCode Guid changing also)
-> App installs over the top of existing one
-> dlls and exe versions get updated
-> IF path installed to is different, existing initially installed project files are deleted from where they were installed. (and files made since remain)

If Assembly Version changes AND project installer version changes (without ProductCode Guid changing)
-> User is asked to manually remove the application
-> if they go ahead and remove from control panel first, app can then be installed and the dlls and exes get updated to the new version

If ONLY Assembly Version changes, or only project installer version changes (without ProductCode Guid changing)
-> User is asked to manually remove the application
-> if they go ahead and remove from control panel first, app can then be installed and the dlls and exes get updated to the new version

If ONLY project installer version changes (with ProductCode Guid changing also)
-> MSI goes through install process, but dlls and exe do not change version -they are as per assembly version, and are replaced with files of same assembly build version
-> IF path installed to is different, existing initially installed project files are deleted from where they were installed. (any files made since remain)

If project installer version changes (with ProductCode Guid changing also) and assembly version is lower than installed version
-> Installation will commence, at the end user is informed install fails as old version.

自控 2024-09-11 22:19:17

设置安装项目属性 RemovePreviousVersions True

但您必须在两个安装应用程序中使用相同的 UpgradeCode

Set setup project property RemovePreviousVersions True

But you have to use same UpgradeCode in both setup applications

何止钟意 2024-09-11 22:19:17

有时您可以在安装新版本后执行此操作,旧产品将保持不变。

您需要更改RemoveExistingProducts的序列号,它必须安排在
安装验证操作和 InstallInitialize 。您可以通过 ORCA

For Ex InstallValidate=1400 来 完成此操作
InstallInitialize =1500

然后删除ExistingProducts =1450

You can do this sometimes after installing new version the old product will remain same.

You need to change the sequence number of RemoveExistingProducts ,It must schedule between
Install Validate action and InstallInitialize . You can do this by ORCA

For Ex InstallValidate=1400
InstallInitialize =1500

Then RemoveExistingProducts =1450

幻梦 2024-09-11 22:19:17

如果您使用的是Visual Studio 2012或更高版本,

  1. 如果解决方案文件夹下已有Installer文件夹,只需打开Installer下的项目助手并双击它即可。

2.打开项目助手后,您会看到应用程序信息,在这里您可以输入要更改的版本。

If you are using visual studio 2012 or upper version ,

  1. If you have already installer folder under the solution folder, just open the Project assistant under Installer and double click on it .

2.Once you open Project assistant you see the Application Information ,here you can enter the version you want to change it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文