Reputation: 1565
I need to programmatically set the name of the output file using pascal code. The following code is written in section [Setup]
and the function MyFileName
is placed in section [Code]
.
OutputBaseFilename={code:MyFileName}
But it creates a file of 0 kb named {code
. Strangely, this kind of call works for AppVersion
...
Does someone knows a workaroud ?
PS : See Scripted constants
Upvotes: 4
Views: 1968
Reputation: 1
Old but had the same issue I solved it using preprocessor function E.g.
#define AppVersionFloat() GetVersionComponents("file.exe", Local[0], Local[1], Local[2], Local[3]), Str(Local[0]) + "." + Str(Local[1]) + Str(Local[2]) + Str(Local[3])
This will return "1.234" version
Upvotes: 0
Reputation: 76683
You cannot use {code:...}
scripting constant for the OutputBaseFilename
directive because this directive specifies the name for the resulting setup file and thus has to be known at compilation time.
Upvotes: 5