VS2008安装项目:卸载以前的MSI [英] VS2008 Setup Project: Uninstalling the previous MSI

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

问题描述

我有一个VS2008安装项目,创建它安装了一个WinForms应用程序(C#)的setup.msi一个

I have a VS2008 setup project, which creates a setup.msi which installs a WinForms application (C#).

我每次更新的版本号,用户首先要卸载之前的版本才可以安装新的。否则我们得到了可怕的此产品的另一个版本已安装消息

Every time I update the version number, the users first have to uninstall the previous version before they can install the new one. Otherwise we get the dreaded "Another version of this product is already installed" message.

这是我在做什么的时候已经建立我安装了新版本:

This is what I'm doing already when I build a new version of the installer:


  • 设置的 RemovePreviousVersions = TRUE和 DetectNewerInstalledVersion = TRUE

  • 增量的AssemblyVersion

  • (这是正在部署的exe文件的)增量版本(设置项目)

  • 生成一个新的产品代码(由VS,当版本改变为提示)

  • 的UpgradeCode 不变

  • Set RemovePreviousVersions=true and DetectNewerInstalledVersion=true
  • Increment AssemblyVersion (of the exe that's being deployed)
  • Increment Version (of the setup project)
  • Generate a new ProductCode (as prompted by VS, when the Version is changed)
  • Leave UpgradeCode unchanged

然而它仍然拒绝卸载以前的版本。那么,你有什么我错过了什么?或者我究竟做错了什么?

And yet it still refuses to uninstall the previous version. So, what have I missed? Or what am I doing wrong?

谢谢!

推荐答案

半回答我的问题,只是对任何人的利益,谁的兴趣:

Semi-answering my own question, just for the benefit of anyone who's interested:

首先,我发现了一个的有关MSI的更新是如何工作非常有用的文章

Firstly, I found an incredibly useful article on how MSI updates work.

其次,我发现的InstEd ,一个相当不错的免费软件MSI编辑器,这表明我没有什么明显的错误与我的MSI文件。 (是的,我可以用逆戟鲸,而不是,如果我不介意下载整个Windows SDK中得到它。)

Secondly, I found InstEd, a rather nice freeware MSI editor, which showed me that there was nothing obviously wrong with my MSI file. (Yes, I could use Orca instead, if I didn't mind downloading the whole Windows SDK to get it.)

第三,烦人,原来问题似乎有固定的本身,我无法重现了。 !如果它回来了,如果我再修复它,我会在这里添加注释

Thirdly, and annoyingly, the original problem seems to have fixed itself and I can't reproduce it any more. If it comes back, and if I fix it again, I'll add a comment here!

总之,这一切造就了一个新的 - 可以说是糟糕 - 的问题:现在微星声称的更新应用程序,但实际上并没有安装任何东西!该解决方案如下:

Anyway, all this brought up a new - arguably worse - problem: the MSI now claimed to update the application but didn't actually install anything! The solution to that is as follows:


  • 的AssemblyVersion无所谓,但
    的AssemblyFileVersion绝对
    确实的:它的必须的增量,如果你想安装的新文件。 (这是在VS2008的变化,相比于VS2005参见,例如,在Microsoft
    组这个
    讨论
    。)

  • 然而,的AssemblyFileVersion不能自动递增的方式的AssemblyVersion
    能。将其设置为1.9。*(或
    等等)只会导致
    错误。该解决方案,从堆栈
    溢出
    这个时候,是设置
    的AssemblyVersion为自动增量,和
    然后打开AssemblyInfo.cs中和完全删除
    的属性的AssemblyFileVersion
    。这将迫使文件
    版本等于装配
    版本。

  • AssemblyVersion doesn't matter, but AssemblyFileVersion absolutely does: it must increment, if you want the new files to be installed. (This is a change in VS2008, compared to VS2005. See, for instance, this discussion on the Microsoft groups.)
  • However, AssemblyFileVersion can't autoincrement the way AssemblyVersion can. Setting it to 1.9.* (or whatever) will just result in an error. The solution, from Stack Overflow this time, is to set AssemblyVersion to autoincrement, and then open AssemblyInfo.cs and remove the AssemblyFileVersion attribute altogether. This will force the file version to equal the assembly version.

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

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