79198844

Date: 2024-11-18 06:18:14
Score: 1
Natty:
Report link

Using part of the full answer provided by @Martin Prikryl, I managed to solve this problem using the Manual Method (repeating WizardIsComponentSelected), I would still like to figure out how to automate this process like Martin suggested with large quantities of [Components], but this works fine for now.

Here is all the relevant [Code] for the solution that worked for me:

[Code]
// You still need all the necessary pascal script from 'CodeDownloadFiles.iss', I just left it out to keep the answer from being too long  
function NextButtonClick(CurPageID: Integer): Boolean;
var
  Temp: string;
begin
  if CurPageID = wpReady then begin
    DownloadPage.Clear;
    if WizardIsComponentSelected('pack1') then 
     DownloadPage.Add('DownloadLink1', 'pack1.zip', '');

    if WizardIsComponentSelected('pack2') then 
     DownloadPage.Add('DownloadLink2', 'pack2.zip', '');
    DownloadPage.Show;
    try
      try
        DownloadPage.Download; // This downloads the files to {tmp}
        Temp := ExpandConstant('{tmp}');
        if WizardIsComponentSelected('pack1') then 
         UnZip(Temp+'\pack1.zip', 'pack1', Temp);

        if WizardIsComponentSelected('pack2') then 
         UnZip(Temp+'\pack2.zip', 'pack2', Temp);
        Result := True;
      except
        if DownloadPage.AbortedByUser then
          Log('Aborted by user.')
        else
          SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
        Result := False;
      end;
    finally
      DownloadPage.Hide;
    end;
  end else
    Result := True;
end;

If anyone can elaborate on the Automated Method Martin mentioned, please feel free to comment or add your own answer to this post!

Reasons:
  • Blacklisted phrase (1): to comment
  • Whitelisted phrase (-1): worked for me
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Martin
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Lilith Helsente