简体   繁体   English

C#VS卸载程序

[英]C# VS uninstaller

I have created VS installer in VS2010. 我在VS2010中创建了VS安装程序。 it works fine. 它工作正常。 when the program is already installed and you re-run the installer it would prompt for repair and uninstall. 当程序已经安装并重新运行安装程序时,它将提示进行修复和卸载。 this is good. 这很好。 the problem is when I re-build the same exact installer and try to install it on a machine that already has one installed it would not give me the prompt repair and uninstall. 问题是,当我重新构建完全相同的安装程序并尝试将其安装在已经安装了一台机器的机器上时,它不会给我提示修复和卸载。 Instead it gives me pop up error "Windows Installer: Another version of this product is already installed. Installation of this version cannot continue...." then it asks me to do manual uninstall using Add/Remove program from Control panel. 相反,它给我弹出错误“Windows Installer:此产品的另一个版本已经安装。此版本的安装无法继续....”然后它要求我使用“控制”面板中的“添加/删除程序”进行手动卸载。

So there is gotta be something changed/auto generated during the re-build. 因此,在重新构建期间必须更改/自动生成一些内容。 kind a like key or something that is different from the older version which makes the newer one fails to recognize the older version. 类似于旧版本的密钥或其他东西,使新版本无法识别旧版本。 anybody knows how to handle this? 有谁知道如何处理这个?

increment your setup project version and set 增加您的安装项目版本并设置

- DetectNewerInstalledVersion = true
- RemovePrevousVersions = true

more info : http://social.msdn.microsoft.com/Forums/en/winformssetup/thread/717cfce0-3061-400f-9ea3-069f73f3a473 更多信息: http//social.msdn.microsoft.com/Forums/en/winformssetup/thread/717cfce0-3061-400f-9ea3-069f73f3a473

If you increase the version it will automatically detect the previous version and handle it as per your configuration on RemovePrevousVersions and DetectNewerInstalledVersion . 如果您增加版本,它将自动检测以前的版本并根据您在RemovePrevousVersionsDetectNewerInstalledVersion上的配置进行DetectNewerInstalledVersion

在此输入图像描述

On the properties on the VS Setup project set the RemovePreviousVersions to True. 在VS Setup项目的属性上,将RemovePreviousVersions设置为True。 I believe by default it is set to false. 我相信默认设置为false。 I beleive that would save some time instead of doing it manually. 我相信这会节省一些时间而不是手动操作。

Also, there is an ProductCode, UpgradeCode, and Version in these properties. 此外,这些属性中还有ProductCode,UpgradeCode和Version。 These control installation behavior, more information is here: 这些控制安装行为,更多信息在这里:

http://msdn.microsoft.com/en-us/library/aa372845(v=VS.85).aspx http://msdn.microsoft.com/en-us/library/aa372845(v=VS.85).aspx

Here are more details: 这里有更多细节:

http://msdn.microsoft.com/en-us/library/aa370579(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/aa370579(v=vs.85).aspx

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

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