我的安装程序中有一个AfterInstall
操作的文件,如下所示:
AfterInstall: UpdateImageLoaderConfigValues()
我希望程序调用相同的Pascal脚本函数两次,因为据我所知,我不能进行两次AfterInstall
操作,所以我这样设置了这个:
procedure UpdateImageLoaderConfigValues();
begin
SaveValueToXML(ExpandConstant('{app}\ImageLoader.exe.config'),{#ImageLoaderLastConfigurationPath}, ExpandConstant('{app}/Configurations'))
SaveValueToXML(ExpandConstant('{app}\ImageLoader.exe.config'),{#ImageLoaderLastImagePath}, ExpandConstant('{app}/Images'))
end;
我的函数SaveValueToXML
有一个签名:
function SaveValueToXML(const AFileName, APath, AValue: string);
问题是编译因
而失败在未知标识符'SaveValueToXML'
UpdateImageLoaderConfigValues
我尝试使用此功能的点处出现错误。
如何将SaveValueToXML
显示为UpdateImageLoaderConfigValues
?
答案 0 :(得分:1)
您必须在SaveValueToXML
:
UpdateImageLoaderConfigValues
[Files]
Source: ...; AfterInstall: UpdateImageLoaderConfigValues()
[Code]
function SaveValueToXML(const AFileName, APath, AValue: string);
begin
// ...
end;
procedure UpdateImageLoaderConfigValues();
begin
SaveValueToXML(ExpandConstant('{app}\ImageLoader.exe.config'),{#ImageLoaderLastConfigurationPath}, ExpandConstant('{app}/Configurations'))
SaveValueToXML(ExpandConstant('{app}\ImageLoader.exe.config'),{#ImageLoaderLastImagePath}, ExpandConstant('{app}/Images'))
end;