Inno Setup - Avoid displaying filenames of sub-installers

前端 未结 1 2034
梦毁少年i
梦毁少年i 2020-12-10 23:28

I am trying to use the idea from Inno Setup - How to hide certain filenames while installing? (FilenameLabel)

The only sure solution is to avoid insta

相关标签:
1条回答
  • 2020-12-10 23:44

    The easiest is to give up on the standard [Files] and [Run] sections and code everything on your own in the CurStepChanged event fuction:

    [Files]
    Source: "dxwebsetup.exe"; Flags: dontcopy
    
    [Code]
    
    procedure CurStepChanged(CurStep: TSetupStep);
    var
      ProgressPage: TOutputProgressWizardPage;
      ResultCode: Integer;
    begin
      if CurStep = ssInstall then { or maybe ssPostInstall }
      begin
        if IsComponentSelected('DirectX') then
        begin
          ProgressPage := CreateOutputProgressPage('Installing prerequsities', '');
          ProgressPage.SetText('Installing DirectX...', '');
          ProgressPage.Show;
          try
            ExtractTemporaryFile('dxwebsetup.exe');
            StartWaitingForDirectXWindow;
            Exec(ExpandConstant('{tmp}\dxwebsetup.exe'), '', '', SW_SHOW,
                 ewWaitUntilTerminated, ResultCode);
          finally
            StopWaitingForDirectXWindow;
            ProgressPage.Hide;
          end;
        end;
      end;
    end;
    

    This even gives you a chance to check for results of the sub-installer. And you can e.g. prevent the installation from continuing, when the sub-installer fails or is cancelled.

    Then it's easier to use the PrepareToInstall instead of the CurStepChanged.


    Another option is to display a custom label, while extracting the sub-installer.
    See Inno Setup - How to create a personalized FilenameLabel with the names I want?

    0 讨论(0)
提交回复
热议问题