Inno Setup 从输入用户解压文件

Inno Setup unzip file from input user

我尝试解压缩从我的存储库下载的安装文件。我找到这段代码:
How to get Inno Setup to unzip a file it installed (all as part of the one installation process)

但我需要在自定义页面中从用户输入有关存储库中应用程序版本的信息,下载并尝试解压缩。如何将值从输入发送到 ExtractMe('{tmp}\INPUT FROM USER VERSION.zip', '{app}\');

begin
  {Page for input Version}
  UserPage := CreateInputQueryPage(wpWelcome,
    'Number of Version', 'example : 1.8.20',
    'Program will download your input');
  UserPage.Add('Version:', False);
  UserPage.Values[0] := GetPreviousData('Version', '1.8.20');
end;

{Called when the user clicks the Next button}
function NextButtonClick(CurPageID: Integer): Boolean;
var
  Version: string;
  FileURL: string;
begin
  if CurPageID = wpReady then
  begin
    Version := UserPage.Values[0];
    {Download}

    FileURL := Format('http://127.0.0.1/repository/ia/ats-apps/ia-client.zip/%s/ia-client.zip-%0:s.zip', [Version]); <-- FROM HERE TO BELOW
    idpAddFile(FileURL, ExpandConstant(Format('{tmp}\%s.zip', [Version])));
    idpDownloadAfter(wpReady);
  end;
  Result := True;
end;

procedure unzip(src, target: AnsiString);
external 'unzip@files:unzipper.dll stdcall delayload';

procedure ExtractMe(src, target : AnsiString);
begin
  unzip(ExpandConstant(src), ExpandConstant(target));
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then 
  begin
    ExtractMe('{tmp}\INPUT FROM USER VERSION.zip', '{app}\'); <--HERE
  end;
end;

感谢提示。

与您在 NextButtonClick 中已经使用的方法相同:阅读 UserPage.Values[0]

ExtractMe(Format('{tmp}\%s.zip', [UserPage.Values[0]]), '{app}\');