visual-studio-2008 - 使用 WiX、Inno Setup 和 VS2008 自动构建版本号

标签 visual-studio-2008 wix build-automation inno-setup

基本上我需要的是一种自动方式来更新 WiX 中的产品版本号(3.0 与 Votive 等),然后将该版本号放入 Inno Setup “bootstrapper”

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

最佳答案

不需要通过任何东西!您可以简单地让 InnoSetup 预处理器直接从二进制文件的版本资源中读取版本信息,例如:

#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) 之前,默认的 InnoSetup 包中不包含 ISPP。您必须下载 InnoSetup 快速入门包:http://www.jrsoftware.org/isdl.php#qsp (感谢@Gwyn,更新)

关于visual-studio-2008 - 使用 WiX、Inno Setup 和 VS2008 自动构建版本号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/357803/

相关文章:

visual-studio-2008 - 您可以搜索 tfs 历史记录来查找其中包含特定代码的文件版本吗?

wix - 在安装结束时打开 readme.txt 在 WiX 中失败

.net - 如何从powershell构建VS解决方案文件夹

visual-studio-2008 - 无法加载文件或程序集“Microsoft.VisualStudio.Enterprise.ASPNetHelper

visual-studio-2008 - Visual Studio 2008 中的批处理文件

wix - 如何从 UI WixUI_Minimal 内置的 Wix 安装程序中删除许可证对话框

WiX 安装程序会在卸载时删除文件,但不会在升级时删除文件

python - 如何生成多行构建命令?

c# - TFS 自动构建策略问题

c++ - Visual Studio MFC CListCtrl 复选框 - 空格键