본문 바로가기

자료/Inno-Setup

이노셋업 (Inno Setup) // About , 홈페이지 버튼 만들기


이노셋업 (Inno Setup) // About , 홈페이지 버튼



 


설치 프로그램에 대하여 버튼과 홈페이지 버튼을
만드는법을 알려드릴까 합니다.
(저도 예제 샘플보고 알려드리는 겁니다 ..)


 
모두 [Code]섹션에 넣어주시면 됩니다.

붉은 글씨를 수정하시면 됩니다.

버튼에 링크 및 설명을 연결합니다

procedure AboutButtonOnClick(Sender: TObject);
begin
  MsgBox(' 대하여 설명 ', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', ' 링크 ', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

대하여 설명 과 링크를 수정하시면 됩니다.

그다음 버튼 제작
 
procedure CreateAboutButtonAndURLLabel(ParentForm: TSetupForm; CancelButton: TNewButton);
var
  AboutButton: TNewButton;
  URLLabel: TNewStaticText;
begin
  AboutButton := TNewButton.Create(ParentForm);
  AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width;
  AboutButton.Top := CancelButton.Top;
  AboutButton.Width := CancelButton.Width;
  AboutButton.Height := CancelButton.Height;
  AboutButton.Caption := '&대하여';
  AboutButton.OnClick := @AboutButtonOnClick;
  AboutButton.Parent := ParentForm;

  URLLabel := TNewStaticText.Create(ParentForm);
  URLLabel.Caption := 'NoBLess 블로그';
  URLLabel.Cursor := crHand;
  URLLabel.OnClick := @URLLabelOnClick;
  URLLabel.Parent := ParentForm;
  URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
  URLLabel.Font.Color := clBlue;
  URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
  URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
end;


그다음 버튼을 표시해야합니다
procedure InitializeWizard();
begin
 CreateAboutButtonAndURLLabel(WizardForm, WizardForm.CancelButton);


저런식으로 하면 간단하게 대하여 버튼과 홈페이지 버튼을 추가할수 있습니다.


샘플 스크립트(아래는 샘플 스크립트입니다 참고해서 사용하세요 ㅎㅎ)