Add Version to SetupWindowTitle of Inno Setup

本秂侑毒 提交于 2020-08-06 06:42:25

问题


The default Title of a Inno Setup Form is

Setup - %1

where %1 will be replaced by AppName from [Setup]-Section. I want to add the Version like this

Setup - MyProgramm 2.07.5

I've already managed to change the title by adding the [Messages]-Section and define the SetupWindowTitle. But this is fixed and i can't add the version string.

[Messages]
SetupWindowTitle=Setup - {AppName} {AppVersion}

This will result in


回答1:


OK, I've found my mistake. The right syntax is

[Messages]
SetupWindowTitle=Setup - {#MyAppName} {#MyAppVersion}

And define some parameters at the beginning

#define MyAppName "MyProgram"
#define MyAppVersion GetStringFileInfo("package\MyProgram.exe", "FILEVERSION")

[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}



回答2:


Set the AppVersion directive:

[Setup]
AppVersion=2.07.5

The value gets automatically into the SetupWindowTitle (indirectly via the default value of AppVerName directive).

You need Inno Setup 5.6 or newer.


You can also read the version from the executable:

[Setup]
AppVersion={#GetFileVersion(AddBackslash(SourcePath) + "MyProg.exe")}

See:

  • Using GetStringFileInfo in Setup section of Inno Setup
  • How do I automatically set the version of my Inno Setup installer according to my application version?


来源:https://stackoverflow.com/questions/57883316/add-version-to-setupwindowtitle-of-inno-setup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!