我正在使用Inno Setup生成我的应用程序的安装程序。如何设置Inno生成的setup.exe (VersionInfoVersion
)的版本号自动与我的应用程序的版本号匹配?现在,每次我部署应用程序的新版本时,我都需要手动更新版本号。
现在我这样做:
[Setup]
VersionInfoVersion=1.2.2.0 //writing the value manually
我想要这样的东西:
[Setup]
VersionInfoVersion={Get the version of my app}
发布于 2011-06-28 04:49:18
您可以像这样使用Inno设置预处理器GetVersionNumbersString
函数
#define ApplicationName 'Application Name'
#define ApplicationVersion GetVersionNumbersString('Application.exe')
[Setup]
AppName={#ApplicationName}
AppVerName={#ApplicationName} {#ApplicationVersion}
VersionInfoVersion={#ApplicationVersion}
发布于 2017-05-27 17:12:51
我在让它工作时遇到了一些问题,所以我只是提出了我的解决方案。
app.iss:
[Setup]
#include "Config.txt"
#define AppVersion GetFileVersion("Input\" + AppExec)
AppName={#AppName}
AppVersion={#AppVersion}
Config.txt:
#define AppName "App"
#define AppExec "App.exe"
发布于 2019-09-30 11:11:35
经过相当长的时间尝试其他方法,它的工作方式对我来说是使用相对路径(我有一个文件夹中的.iss文件和EXE文件上两层)。
; Extract File Version from EXE
#define MyAppVersion GetFileVersion("..\..\Release\CSClave.exe")
https://stackoverflow.com/questions/6498750
复制相似问题