本文介绍了如何从Inno Setup Pascal脚本设置版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个脚本,可以从应用程序文件中读取版本号.现在,我需要找到一种方法将此号码放入Inno Setup的 AppVersion 指令中.
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.
如何将函数的返回值放在 AppVersion 指令中?
How can I place the return value of my function in the AppVersion directive?
推荐答案使用脚本化常数:
[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.
更多推荐
如何从Inno Setup Pascal脚本设置版本号
发布评论