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

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

问题描述

基本上我需要的是一种自动化的方式来更新 WiX 中的产品版本号(3.0 和 Votive 等),然后将该版本号放入 Inno Setup引导程序"

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天全站免登陆