带有WiX,Inno Setup和VS2008的自动构建版本号 [英] Automated-build version number with WiX, Inno Setup, and VS2008

查看:81
本文介绍了带有WiX,Inno Setup和VS2008的自动构建版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我需要一种自动的方法来更新WiX中的产品版本号(3.0与Votive等),然后将该版本号放入Inno安装程序的引导程序中。

Basically what I need is an automated way to update the product version number in WiX (3.0 with Votive etc), and then get that version number into an Inno Setup "bootstrapper"

我的流程几乎都是自动化的,但是版本号仍然需要手动更新,这显然不理想,但是我找不到如何在编译时将值传递给Inno Setup的方法(以及如何引用它们),在WiX项目中,我需要知道如何在Visual Studio 2008的同一解决方案中引用不同项目的版本号。

I pretty much have the process mostly automated, however version numbers still need to be updated manually which obviously isn't ideal, but I couldn't find how to pass in values to Inno Setup at compile time (and how to reference them), and in the WiX project I need to know how to reference the version number of a different project in the same solution in Visual Studio 2008

推荐答案

无需传递任何内容!您可以简单地让InnoSetup预处理程序直接从二进制文件的版本资源中读取版本信息,例如:

No need to pass anything! You can simply let the InnoSetup Preprocessor read the version info straight from the binary's version resource, e.g.:

#define AppName "My App"
#define SrcApp "MyApp.exe"
#define FileVerStr GetFileVersion(SrcApp)
#define StripBuild(str VerStr) Copy(VerStr, 1, RPos(".", VerStr)-1)
#define AppVerStr StripBuild(FileVerStr)

[Setup]
AppName={#AppName}
AppVersion={#AppVerStr}
AppVerName={#AppName} {#AppVerStr}
UninstallDisplayName={#AppName} {#AppVerStr}
VersionInfoVersion={#FileVerStr}
VersionInfoTextVersion={#AppVerStr}
OutputBaseFilename=MyApp-{#FileVerStr}-setup

版本5.4.1(2011-02-09)之前的ISPP不是包含在默认的InnoSetup程序包中。您必须下载InnoSetup快速入门包: http://www.jrsoftware.org/isdl.php #qsp (感谢@Gwyn进行更新)

Before version 5.4.1 (2011-02-09) ISPP was not included in the default InnoSetup package. You had to download the InnoSetup Quick Start Pack: http://www.jrsoftware.org/isdl.php#qsp (thanks @Gwyn, for the update)

这篇关于带有WiX,Inno Setup和VS2008的自动构建版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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