所以我有一个正在更新一些 XML 的函数,我想传递{AppVersion}
已设置在[Setup]
脚本的一部分作为该函数的常量
我努力了
MyFunction(ExpandConstants({AppVersion})
但这给了我一个错误?如何正确地将这个常量传递给我的函数
My Code
[Files]
Source: ".\Source\myfile.txt"; DestDir: "{app}\System"; AfterInstall: MyFunction('{#SetupSetting("AppVersion")}')
[Setup]
AppId=MyApp
AppName=My Application
AppVersion=011
DefaultDirName=C:\MyApp
[Code]
procedure MyFunction(Text: String);
begin
MsgBox(Text, mbInformation, MB_OK);
end;
Use the SetupSetting http://www.jrsoftware.org/ispphelp/index.php?topic=setupsetting用于扩展的预处理器函数[Setup] http://www.jrsoftware.org/ishelp/index.php?topic=setupsection节指令值:
MyFunction('{#SetupSetting("AppVersion")}');
一个简短的证明:
[Setup]
AppName=My Program
AppVersion=1.2.3.4
DefaultDirName={pf}\My Program
[Code]
procedure InitializeWizard;
begin
MsgBox('AppVersion is: {#SetupSetting("AppVersion")}.', mbInformation, MB_OK);
end;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)