我使用Inno安装程序来生成我的应用程序的安装程序。如何设置Inno生成的setup.exe(VersionInfoVersion)的版本号与我的应用程序的版本号自动匹配?现在每次我部署我的应用程序的新版本,我需要手动更新版本号。
现在我做这个:
- [Setup]
- VersionInfoVersion=1.2.2.0 //writting the value manually
我想要这样的东西:
- [Setup]
- VersionInfoVersion={Get the version of my app}
解决方法
你可以像这样使用Inno Setup Preprocessor GetFileVersion函数
- #define ApplicationName 'Application Name'
- #define ApplicationVersion GetFileVersion('Application.exe')
- [Setup]
- AppName={#ApplicationName}
- AppVerName={#ApplicationName} {#ApplicationVersion}
- VersionInfoVersion={#ApplicationVersion}