【问题标题】:Building memo text for Inno Download Plugin为 Inno 下载插件构建备忘录文本
【发布时间】:2020-06-18 23:17:37
【问题描述】:

我查看了 IDP 的帮助文档,但找不到任何用于构建要下载文件的备忘录文本的函数。

以前我使用 DwinsHs,但它一直给我带来问题。但我能够使用:

function DwinsHs_MemoDownloadInfo(Space, NewLine: String): String;
var
    i: Integer;
begin
    Result := '';
    for i := 0 to GetArrayLength(DwinsHs_DownloadsList) - 1 do
    begin
        if DwinsHs_DownloadsList[i].Required then
        begin
                Result := Result + Space + ExtractFileName(DwinsHs_DownloadsList[i].Filename);
                if DwinsHs_DownloadsList[i].Downloaded then
                begin
                    Result := Result + Space + ExpandConstant('{cm:ReadyMemo_Downloaded}');
                end;
                Result := Result + NewLine;
        end;
    end;
    if Result <> '' then
    begin
        Result := ExpandConstant('{cm:ReadyMemo_Download}') + NewLine + Result;
    end;
end;

因此,我们可能有多达 4 个要下载的项目:

  • 帮助文档设置
  • VC Redist x86
  • VC Redist x64
  • 点网框架

使用idpAddFile添加相关文件(虽然我没有指定文件大小,所以会有一点延迟)。我已经要求它在wpPreparing之后显示下载页面:

idpDownloadAfter(wpPreparing);

理想情况下,我希望在备忘录页面上列出我们确定用户想要下载的文件。

【问题讨论】:

    标签: inno-setup inno-download-plugin


    【解决方案1】:

    您知道自己正在下载哪些文件,因此请在致电idpAddFile 时收集它们的名称。您可以创建一个包装函数来替代idpAddFile

    var
      FilesToDownload: string;
    
    procedure AddFileForDownload(Url, Filename: string);
    begin
      idpAddFile(Url, Filename);
      FilesToDownload := FilesToDownload + '      ' + ExtractFileName(FileName) + #13#10;
    end;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多