且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何让安装的版本号同步与已安装的组件“版本号?

更新时间:2023-01-15 09:16:37

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)