1

I wanna add a link with a button or text to InnoSetup project so if someone doesn't know the password can easily jump into password webpage.

Currently I am using following script by Martin Prikryl:

var
  ShowPasswordCheck: TNewCheckBox;

procedure ShowPasswordCheckClick(Sender: TObject);
begin
  WizardForm.PasswordEdit.Password := not ShowPasswordCheck.Checked;
end;

<event('InitializeWizard')>
procedure InitializeWizardRevealPassword();
begin
  ShowPasswordCheck := TNewCheckBox.Create(WizardForm);
  ShowPasswordCheck.Parent := WizardForm.PasswordEdit.Parent; 
  ShowPasswordCheck.Caption := '&Show password';
  ShowPasswordCheck.Top :=
    WizardForm.PasswordEdit.Top + WizardForm.PasswordEdit.Height + ScaleY(8);
  ShowPasswordCheck.Height := ScaleY(ShowPasswordCheck.Height);
  ShowPasswordCheck.Checked := not WizardForm.PasswordEdit.Password;
  ShowPasswordCheck.OnClick := @ShowPasswordCheckClick;
end;

enter image description here

Vampire
  • 71
  • 8
  • You have not stated what the problem is? – StayOnTarget Oct 17 '22 at 11:50
  • @MartinPrikryl not working. Unknown identifier 'OpenBrowser' error – Vampire Oct 18 '22 at 00:45
  • @MartinPrikryl yeah I wasn't adding those code as I thought there were 3 sets of different codes. But now I am having the button on every single screen instead of only Password screen. And how to change size of button label too. – Vampire Oct 18 '22 at 20:17
  • You already have a code to add a control to specific page, right? `ShowPasswordCheck.Parent := WizardForm.PasswordEdit.Parent` – So do the same! + What you mean by *"change size of button label"*? Do you mean font size? Your question didn't mention anything like this. Sounds like a new question to me. – Martin Prikryl Oct 19 '22 at 05:45
  • I surrender, this is beyond my knowledge and skills. Looks like this coding thing isn't my cup of tea. – Vampire Oct 19 '22 at 23:32

0 Answers0