2

I have a script that reads the version number from an application file. Now I need to find a way to place this number in the AppVersion directive of Inno Setup.

How can I place the return value of my function in the AppVersion directive?

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846
JimmyD
  • 2,379
  • 4
  • 28
  • 55

1 Answers1

2

Use a scripted constant:

[Setup]
AppVersion={code:GetAppVersion}
[Code]

function GetAppVersion(Param: string): string;
begin
  Result := MyFunction;
end;

If the function call is costly, you should cache its value to a global variable and use the cached value in the scripted constant.

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846