2

My installer has a custom finish page with an image on it. I referred this Custom Welcome and Finished page with stretched image in Inno Setup solution for it. But the issue is with the check box at finish page, it is coming on top of the finish page image with a white background. If I removed postinstall flag, then it will automatically launch my app. But I want the user to be able to choose like how checkbox does. So is there any way to transparent the check box launch message on top of my image? Would TNewCheckBox help here?

[Run]
Filename: "app\My program.exe"; Description: "{cm:LaunchProgram}"; #
    Flags: nowait postinstall skipifsilent
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Trang D
  • 333
  • 5
  • 16

1 Answers1

2

In standard Inno Setup, I do not think you can make WizardForm.RunList (TNewCheckListBox) transparent. But as the simple TNewCheckBox is transparent, you can replace the WizardForm.RunList with TNewCheckBox (or more of them, if needed – not covered by the code below).

[Code]
procedure RunCheckBoxClick(Sender: TObject);
begin
  WizardForm.RunList.Checked[0] := TNewCheckBox(Sender).Checked;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  RunCheckBox: TNewCheckBox;
begin
  if CurPageID = wpFinished then
  begin
    if (not WizardForm.RunList.Visible) or
       (WizardForm.RunList.Items.Count < 1) then
    begin
      Log('No items to run');
    end
      else
    if WizardForm.RunList.Items.Count > 1 then
    begin
      Log('More than one item to run, ' +
          'keeping the standard non-transparent run list');
    end
      else
    begin
      Log('Replacing the one item in the run list ' +
          'with a simple transparent checkbox');
      RunCheckBox := TNewCheckBox.Create(WizardForm);
      RunCheckBox.Parent := WizardForm.RunList.Parent;
      RunCheckBox.Left := WizardForm.RunList.Left + ScaleX(4);
      RunCheckBox.Top := WizardForm.RunList.Top + ScaleY(4);
      RunCheckBox.Width := WizardForm.RunList.Width;
      RunCheckBox.Height := ScaleY(RunCheckBox.Height);
      RunCheckBox.Checked := WizardForm.RunList.Checked[0];
      RunCheckBox.Caption := WizardForm.RunList.ItemCaption[0];
      RunCheckBox.OnClick := @RunCheckBoxClick;
      WizardForm.RunList.Visible := False;
    end
  end; 
end;

enter image description here

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992