【发布时间】:2022-08-21 04:16:21
【问题描述】:
我的安装程序有Components,它与可下载文件相关联。这些东西随着构建而变化,所以我使用#insert 创建[Components] 部分以及[Files] 部分中的相应条目。
其中一些组件依赖于常见的可下载文件。
现在,为了在下载页面中包含正确的 url,我目前正在定义数组变量,这些变量的名称与组件类似,并且具有所需的可下载文件的名称作为值,例如:
#dim myfeature[2] {\"01aed27862e2087bd117e9b677a8685aebb0be09744723b4a948ba78d6011bac\", \"677756ac5969f814fd01ae677dbb832ab2e642513fea44ea0a529430d5ec1fdc\"}
在下载页面的代码中,我正在检查通过WizardSelectedComponents() 选择了哪些组件,并将字符串转换为字符串数组后,我正在尝试访问先前定义的变量,这就是我的位置米失败:
function GetDownloads(): Array of String;
var
Downloads: Array of String;
SelectedComponents: String;
SelectedArray: Array of String;
begin
SelectedComponents := WizardSelectedComponents(False);
// a custom procedure to parse the comma seperated string
SelectedArray := ParseArray(SelectedComponents, SelectedArray);
// trying to get to the constant array now this works:
MsgBox(ExpandConstant(\'{#myfeature[0]}\'), mbInformation, MB_OK);
// same but trying to use the selected component value returns this as a literal
// \'+SelectedArray[0]+\' instead the expanded value
MsgBox(ExpandConstant(\'{#\' + SelectedArray[0] + \'[0]}\'), mbInformation, MB_OK);
end;
所以我知道# 标记出了点问题,但我找不到正确解决这个问题的方法。
谢谢! 马库斯
标签: inno-setup