Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I obtain the Inno Setup version number from a batch or Inno Setup script?

Tags:

inno-setup

Is it possible to obtain the Inno Setup version number for use in an Inno Setup installer?

I cannot find a documented switch to return its version number (e.g. 5.5.6) and there doesn't seem to be an exposed predefined version constant exposed to Inno Setup scripts.

like image 746
oflisback Avatar asked Oct 28 '25 07:10

oflisback


1 Answers

On the contrary @magicnumber, there is indeed a compiler version constant available directly in your inno-script. The predefined Preprocessor variable Ver returns the 32-bit encoded version of Inno Setup compiler. Highest byte holds the major version, lowest byte usually holds zero. Make it prettyful with the DecodeVer function. Example:

#define MyCompilerVerStr DecodeVer(Ver)

Update:

You can also add details if the compiler is the unicode or non-unicode version:

#ifdef UNICODE
  #define MyInnoVersion DecodeVer(Ver) + " (unicode)"
#else
  #define MyInnoVersion DecodeVer(Ver) + " (non-unicode)"
#endif
like image 186
Lars Avatar answered Oct 30 '25 15:10

Lars