如何让安装的版本号同步与已安装的组件“版本号? [英] How to keep the installer's version number in sync with the installed assemblies' version numbers?

查看:204
本文介绍了如何让安装的版本号同步与已安装的组件“版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我当前的项目,我每周制作发行。我一直在使用这个帖子保持在我的同步项目的程序集的版本号。 (我现在并没有任何充分的理由分别跟踪程序集'版本号,不过我相信这一天终将到来。)

In my current project, I'm producing weekly releases. I've been using the technique described in this post to keep the version numbers of all of the assemblies in my project in sync. (I don't presently have any good reason to track the assemblies' version numbers separately, though I'm sure that day will eventually come.)

当我推了出去一放,我生成安装程序的新版本。与所有的组件,它可以从一个共享文件SolutionInfo.cs得到他们的版本号,安装程序的版本号没有,尽我可以告诉,装配性能。所以,我的发布过程包括手工推进在安装项目的版本号。

When I push out a release, I build a new version of the installer. Unlike all of the assemblies, which can get their version numbers from a shared SolutionInfo.cs file, the version number of the installer isn't, as best I can tell, an assembly property. So my release process includes manually advancing the version number in the setup project.

或者,我应该说,一般的包括这样做。我想将其转换成的东西我不能搞砸。我发现安装和部署项目的文档,令人惊讶的不透明(这是相当有点难以找出如何使人们有可能因为如果用户将其安装到非默认路径,这也是微星正常卸载一个漂亮再用常见的情况是无证),而且不知道如果它甚至有可能做到这一点。

Or, I should say, usually includes doing that. I'd like to turn that into something I can't screw up. I'm finding the documentation of setup and deployment projects to be surprisingly opaque (it was quite a bit harder to find out how to make it possible for the MSI to uninstall properly if the user installed it to a non-default path, which is a pretty freaking common use case to be undocumented) and have no idea if it's even possible to do this.

任何想法?

编辑:

我想弄清楚,这是我说的是一个Visual Studio安装和部署项目

Just to clarify, this is a Visual Studio setup and deployment project I'm talking about.

推荐答案

CodeProject上有一个脚本来设置一个MSI文件,你可以在设置的预建步运行的版本号项目。在这里你找到它:

CodeProject has a script to set the version number of an MSI file, which you could run in the pre-built step of the setup project. You find it here:

http://www.codeproject.com/KB/install/NewSetupVersion.aspx

更多详细信息

注意,用Windows安装程序事情有点复杂。 MSI文件(如你创建使用VS安装和部署项目之一),不但有版本号,但也是一个产品代码是一个GUID值。该产品代码是使用Windows Installer来唯一地标识您的产品例如在控制面板 - >添加或删除程序,你可以决定卸载或修复产品

Be aware that with Windows Installer things are a bit more complicated. MSI files (as the one that you create using a VS Setup and Deployment project) not only have a version number but also a product code which is a GUID value. This product code is used by Windows Installer to uniquely identify your product e.g. in Control Panel -> Add Or Remove programs where you can decide to uninstall or repair a product.

但是,改变你MSI版本号时,该产品的代码也必须在许多情况下改变。微星科技是记录不完整,但你可以找到一些建议时也下面的MSDN页面上改变产品代码:的 http://msdn.microsoft.com/en-us/library/aa367850(VS.85)的.aspx

However, when changing you MSI version number, this product code must also be changed in a number of cases. MSI technology is poorly documented but you can find some recommendations when to also change the product code on the following MSDN page: http://msdn.microsoft.com/en-us/library/aa367850(VS.85).aspx.

在我的项目,我总是生成每一个新版本的新产品代码。 。在CodeProject上的脚本也将发生变化的产品代码为您

In my projects I always generate a new product code for every new version. The script on CodeProject will also change the product code for you.

还有一件事:Windows安装程序只检查版本号的前三位据我所知,任何在第四名会被忽略,即2.3.0.1234被认为等于2.3.0.5678。 (的ProductVersion

And one more thing: Windows Installer only checks the first three places of the version number afaik, anything in the forth place will be ignored, i.e. 2.3.0.1234 is considered equal to 2.3.0.5678. (ProductVersion)

(在CodeProject上一篇相关文章可能也很有趣,你:的http:// www.codeproject.com/KB/install/VersionVDProj.aspx

(There is a related article on CodeProject which might also be interesting to you: http://www.codeproject.com/KB/install/VersionVDProj.aspx)

这篇关于如何让安装的版本号同步与已安装的组件“版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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