gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 14:36:30 25 4
gpt4 key购买 nike

基本上我需要的是一种自动方式来更新 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com