Search code examples
inno-setuppercentagepascalscript

How to change size and style of a caption in inno-setup


I have the this script (answered by TLama). I made some changes in the script,Now I want the caption will look like the following image :

enter image description here

Is it possible to change the size and style(bold) the caption Completed(I change it from caption Done). How to do the changes in the caption in inno setup.

Thanks!


Solution

  • This is fully modified code :

    [Code]
    function GetTickCount: DWORD;
      external 'GetTickCount@kernel32.dll stdcall';
    
    var
      StartTick: DWORD;
      PercentLabel: TNewStaticText;
      ElapsedLabel: TNewStaticText;
      RemainingLabel: TNewStaticText;
    
    function TicksToStr(Value: DWORD): string;
    var
      I: DWORD;
      Hours, Minutes, Seconds: Integer;
    begin
      I := Value div 1000;
      Seconds := I mod 60;
      I := I div 60;
      Minutes := I mod 60;
      I := I div 60;
      Hours := I mod 24;
      Result := Format('%.2d:%.2d:%.2d', [Hours, Minutes, Seconds]);
    end;
    
    procedure InitializeWizard;
    begin
      PercentLabel := TNewStaticText.Create(WizardForm);
      PercentLabel.Parent := WizardForm.ProgressGauge.Parent;
      PercentLabel.Left := 110;
        PercentLabel.Top := WizardForm.ProgressGauge.Top +
        WizardForm.ProgressGauge.Height + 50;
      PercentLabel.Font.Style := [fsBold]
      PercentLabel.Font.Size := 14
    
      ElapsedLabel := TNewStaticText.Create(WizardForm);
      ElapsedLabel.Parent := WizardForm.ProgressGauge.Parent;
      ElapsedLabel.Left := 0;
      ElapsedLabel.Top := WizardForm.ProgressGauge.Top +
        WizardForm.ProgressGauge.Height + 12;
      ElapsedLabel.Font.Style := [fsBold]
    
      RemainingLabel := TNewStaticText.Create(WizardForm);
      RemainingLabel.Parent := WizardForm.ProgressGauge.Parent;
      RemainingLabel.Left := 270;
      RemainingLabel.Top := ElapsedLabel.Top;
      RemainingLabel.Font.Style := [fsBold]
    
    end;
    
    procedure CurPageChanged(CurPageID: Integer);
    begin
      if CurPageID = wpInstalling then
        StartTick := GetTickCount;
    end;
    
    procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
    begin
      if CurPageID = wpInstalling then
      begin
        Cancel := False;
        if ExitSetupMsgBox then
        begin
          Cancel := True;
          Confirm := False;
          PercentLabel.Visible := False;
          ElapsedLabel.Visible := False;
          RemainingLabel.Visible := False;
        end;
      end;
    end;