3

This question is regarding getting version directly from assembly. I have followed instructions from this post

My script looks as follow.

#define MyAppName "Keyboard Trader"
#define SrcApp "Keyboard Trader.exe"
#define FileVerStr GetFileVersion(SrcApp)
#define StripBuild(str VerStr) Copy(VerStr, 1, RPos(".", VerStr)-1)
#define AppVerStr StripBuild(FileVerStr)

But while compiling script it throws following Error

Compile started: Tuesday, Oct 11 2011 at 01:15 AM
---
Compiling script with Inno Setup 5.4.2 (a)
---
[ISPP] Preprocessing.
---------------------
Compile Error!
Line: 12
**Error: [ISPP] Actual parameter VerStr is not of the declared type.**

What I am missing here?

Community
  • 1
  • 1
mchicago
  • 780
  • 9
  • 21
  • Neither your script excerpt here nor the accepted answer on the question you linked to have a reference to VerStr on line 12. Can you post the full script you are using? – Vicky Oct 11 '11 at 09:27

1 Answers1

5

GetFileVersion() is returning a blank string as it can't find the the SrcApp path. Try specifying a fully qualified path or using:

#define SrcApp AddBackslash(SourcePath) + "Keyboard Trader.exe"
Deanna
  • 23,876
  • 7
  • 71
  • 156
  • Thanks a ton. It worked. By the way just curious how did you realize that it returns empty string? – mchicago Oct 11 '11 at 16:33
  • I ran it and gave it a valid file name to test and it worked. Removing the path caused the same error. – Deanna Oct 11 '11 at 16:45
  • Sorry to bother you again but how do you debug the script? I have a breakpoint there but I can not get the variable values at all. Because when the engine is stopped at breakpoint then evaluate constant is still disabled. – mchicago Oct 11 '11 at 17:08
  • You can't debug/step through the ISPP as it's done before any compilation. The Inno IDE can only debug runtime `[Code]`. – Deanna Oct 12 '11 at 07:50