安装项目不会卸载以前的版本 [英] Setup project does not uninstall previous version

查看:189
本文介绍了安装项目不会卸载以前的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在使用Visual Studio为我的应用程序构建安装程序。我正在使用"Windows安装程序安装项目" (而不是clickonce)。

我的目的是创建一个安装程序(msi或exe),自动检测并卸载以前安装的应用程序版本,然后安装新版本我无法找到办法。根据我设置"产品代码"的方式,生成的.msi文件 无法识别已安装以前的版本,它确实识别它但是要求手动卸载以前的版本。我的产品经理都不接受这两种行为。

这是我在Visual Studio的与设置项目相关的属性面板中所做的事情:

1)设置"DetectNewerInstalledVersion""为真。 (我也尝试过假,无济于事)

设置"RemovePreviousVersions"为什么然后,每次我建立一个新版本:

1)我增加"版本"。属性。例如,我将它从1.0.15增加到1.0.16。 (我也试过从2.0到3.0,结果是一样的)

2)然后出现一个Visual Studio对话框,强烈建议我改变"产品代码"。取决于我是否选择"是"和"是"。或者"no",我遇到了不同的问题:

2.1)如果我接受更改产品代码,那么,当我双击生成的msi或exe安装程序时,安装程​​序不会检测到以前安装的版本。它试图覆盖以前版本中的文件,无法覆盖exe文件,生成的应用程序在启动时崩溃。

另一方面,如果我没有改变产品代码,然后,当我双击生成的msi或exe安装程序时,安装程​​序_does_检测到以前的版本,但是一个对话框要求我先从控制面板卸载它,然后重新启动安装程序。我需要自动卸载,而无需打开控制面板。
具有讽刺意味的是,如果我通过右键单击安装项目来安装应用程序,我发现了在visual studio中,然后选择"安装",安装程序行为正常:它会自动检测并卸载以前的版本,然后安装新版本。当我双击生成的.msi或.exe文件时为什么不会发生这种情况?

非常感谢您的帮助。

解决方案

< blockquote>

任何解决方案?我确实有 相同的结果。


Hello,

I am using Visual Studio to build an installer for my application. I am using a "windows installer setup project" (as opposed to clickonce).

My purpose is to create an installer (msi or exe) which automatically detects and uninstalls the previously installed version of the application, then installs the new version. I can't find a way to do it. Depending on how I set the "product code", the resulting .msi file either does not recognize that a previous version is already installed, or it does recognize it but asks to uninstall the previous version manually. Neither behavior is acceptable for my product manager.

This is what I am doing in Visual Studio's properties panel related to the setup project:

1) set "DetectNewerInstalledVersion" to true. (I also tried false, to no avail)

2) set "RemovePreviousVersions" to true.

Then, each time I build a new version:

1) I increment the "Version" property. For example, I increase it from 1.0.15 to 1.0.16. ( I also tried from 2.0 to 3.0 and the result is the same)

2) then a Visual studio dialog box appears which strongly suggests me to change the "product code". Depending on whether I choose "yes" or "no", I get different problems:

2.1) If I accept to change the product code, then, when I double-click on the resulting msi or exe installer, the installer does not detect the previously installed version. It tries to overwrite the files in the previous version, it fails to overwrite the exe file, and the resulting application crashes at startup.

2.2) If, on the other hand, I do _not_ change the product code, then, when I double-click on the resulting msi or exe installer, the installer _does_ detect the previous version, but a dialog box asks me to uninstall it from the control panel first, then relaunch the installer. I need the uninstall to be automatic, without having to open the control panel.

__

Ironically I have discovered that, if I install the application by right_clicking on the setup project inside visual studio, and then choose "install", the installer behaves correctly: it automatically detects and uninstalls the previous version, then installs the new version. Why is that not happening when I double-click on the generated .msi or .exe files?

Thanks a lot for any help.

解决方案


Any solution to this? I have the exact same results you do.


这篇关于安装项目不会卸载以前的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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