简体   繁体   English

如何从批处理或 Inno Setup 脚本中获取 Inno Setup 版本号?

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

Is it possible to obtain the Inno Setup version number for use in an Inno Setup installer?是否可以获得 Inno Setup 版本号以用于 Inno Setup 安装程序?

I cannot find a documented switch to return its version number (eg 5.5.6) and there doesn't seem to be an exposed predefined version constant exposed to Inno Setup scripts.我找不到记录开关来返回其版本号(例如 5.5.6),并且似乎没有暴露给 Inno Setup 脚本的公开预定义版本常量。

On the contrary @magicnumber, there is indeed a compiler version constant available directly in your inno-script.相反@magicnumber,确实有一个编译器版本常量可以直接在你的inno-script 中使用。 The predefined Preprocessor variable Ver returns the 32-bit encoded version of Inno Setup compiler.预定义的预处理器变量Ver返回 Inno Setup 编译器的 32 位编码版本。 Highest byte holds the major version, lowest byte usually holds zero.最高字节保存主要版本,最低字节通常保存零。 Make it prettyful with the DecodeVer function.使用DecodeVer函数让它变得DecodeVer Example:示例:

#define MyCompilerVerStr DecodeVer(Ver)

Update:更新:

You can also add details if the compiler is the unicode or non-unicode version:如果编译器是 unicode 或非 unicode 版本,您还可以添加详细信息:

#ifdef UNICODE
  #define MyInnoVersion DecodeVer(Ver) + " (unicode)"
#else
  #define MyInnoVersion DecodeVer(Ver) + " (non-unicode)"
#endif

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM