ZVSRus1957
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору [Setup] AppName=My Program AppVerName=My Program version 1.5 CreateAppDir=no DisableProgramGroupPage=yes DefaultGroupName=My Program UninstallDisplayIcon={app}\MyProg.exe OutputDir=userdocs:Inno Setup Examples Output [CustomMessages] TextLabel=Здесь будет располагаться ваш текст [Code_] procedure URLLabelOnClick(Sender: TObject); var ErrorCode: Integer; begin ShellExec('open', 'http://www.innosetup.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode); end; procedure AboutButtonOnClick(Sender: TObject); var Form: TSetupForm; OKButton: TButton; URLLabel: TNewStaticText; RichEditViewer1: TRichEditViewer; begin Form := CreateCustomForm(); try Form.ClientWidth := ScaleX(456); Form.ClientHeight := ScaleY(356); Form.Caption := 'Информация'; Form.CenterInsideControl(WizardForm, False); OKButton := TButton.Create(Form); OKButton.Parent := Form; OKButton.Width := ScaleX(75); OKButton.Height := ScaleY(23); OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 10); OKButton.Top := Form.ClientHeight - ScaleY(23 + 10); OKButton.Caption := 'OK'; OKButton.ModalResult := mrOk; URLLabel := TNewStaticText.Create(Form); URLLabel.Caption := 'www.innosetup.com'; URLLabel.Cursor := crHand; URLLabel.OnClick := @URLLabelOnClick; URLLabel.Parent := Form; URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline]; URLLabel.Font.Color := clBlue; URLLabel.Top := 325; URLLabel.Left := 75; Form.ActiveControl := OKButton; begin { RichEditViewer1 } RichEditViewer1 := TRichEditViewer.Create(WizardForm); with RichEditViewer1 do begin Parent := Form; Left := ScaleX(0); Top := ScaleY(0); Width := ScaleX(456); Height := ScaleY(320); BorderStyle := bsNone; Color := clBtnFace; ScrollBars := ssVertical; RTFText := '{\rtf1\ansi\ansicpg1251\deff0\deflang1049\deflangfe1049{\fonttbl{\f0\fmodern\fprq1\fcharset204{\*\fname Courier New;}Courier New CYR;}{\f1\fnil\fcharset134 MS Sans Serif;}}' + #13#10 + '{\colortbl ;\red128\green0\blue0;\red192\green192\blue192;}' + #13#10 + '\viewkind4\uc1\pard\cf1\lang1033\f0\fs20 [Setup]\par' + #13#10 + ' AppName=My Program\par' + #13#10 + ' AppVerName=My Program version 1.5\par' + #13#10 + ' CreateAppDir=no\par' + #13#10 + ' DisableProgramGroupPage=yes\par' + #13#10 + ' DefaultGroupName=My Program\par' + #13#10 + ' UninstallDisplayIcon=\{app\}\\MyProg.exe\par' + #13#10 + ' OutputDir=userdocs:Inno Setup Examples Output\par' + #13#10 + '\par' + #13#10 + '[CustomMessages]\par' + #13#10 + ' TextLabel=\lang1049\''c7\''e4\''e5\''f1\''fc\lang1033 \lang1049\''e1\''f3\''e4\''e5\''f2\lang1033 \lang1049\''f0\''e0\''f1\''ef\''ee\''eb\''e0\''e3\''e0\''f2\''fc\''f1\''ff\lang1033 \lang1049\''e2\''e0\''f8\lang1033 \lang1049\''f2\''e5\''ea\''f1\''f2\lang1033 \par' + #13#10 + '\par' + #13#10 + '[Code_]\par' + #13#10 + ' procedure URLLabelOnClick(Sender: TObject);\par' + #13#10 + ' var\par' + #13#10 + ' ErrorCode: Integer;\par' + #13#10 + ' begin\par' + #13#10 + ' ShellExec(''open'', ''http://www.innosetup.com'', '''', '''', SW_SHOWNORMAL, ewNoWait, ErrorCode);\par' + #13#10 + ' end;\par' + #13#10 + '\par' + #13#10 + ' procedure AboutButtonOnClick(Sender: TObject);\par' + #13#10 + ' var\par' + #13#10 + ' Form: TSetupForm;\par' + #13#10 + ' OKButton: TButton;\par' + #13#10 + ' URLLabel: TNewStaticText;\par' + #13#10 + ' TextLabel: TLabel;\par' + #13#10 + '\par' + #13#10 + ' begin\par' + #13#10 + ' Form := CreateCustomForm();\par' + #13#10 + ' try\par' + #13#10 + ' Form.ClientWidth := ScaleX(256);\par' + #13#10 + ' Form.ClientHeight := ScaleY(256);\par' + #13#10 + ' Form.Caption := ''\lang1049\''c8\''ed\''f4\''ee\''f0\''ec\''e0\''f6\''e8\''ff\lang1033 '';\par' + #13#10 + ' Form.CenterInsideControl(WizardForm, False);\par' + #13#10 + '\par' + #13#10 + ' OKButton := TButton.Create(Form);\par' + #13#10 + ' OKButton.Parent := Form;\par' + #13#10 + ' OKButton.Width := ScaleX(75);\par' + #13#10 + ' OKButton.Height := ScaleY(23);\par' + #13#10 + ' OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 10);\par' + #13#10 + ' OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);\par' + #13#10 + ' OKButton.Caption := ''OK'';\par' + #13#10 + ' OKButton.ModalResult := mrOk;\par' + #13#10 + '\par' + #13#10 + ' URLLabel := TNewStaticText.Create(Form);\par' + #13#10 + ' URLLabel.Caption := ''www.innosetup.com'';\par' + #13#10 + ' URLLabel.Cursor := crHand;\par' + #13#10 + ' URLLabel.OnClick := @URLLabelOnClick;\par' + #13#10 + ' URLLabel.Parent := Form;\par' + #13#10 + ' URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];\par' + #13#10 + ' URLLabel.Font.Color := clBlue;\par' + #13#10 + ' URLLabel.Top := 200;\par' + #13#10 + ' URLLabel.Left := 75;\par' + #13#10 + '\par' + #13#10 + ' Form.ActiveControl := OKButton;\par' + #13#10 + '\par' + #13#10 + ' \{ TextLabel \}\par' + #13#10 + ' TextLabel := TLabel.Create(WizardForm);\par' + #13#10 + ' with TextLabel do\par' + #13#10 + ' begin\par' + #13#10 + ' Parent := Form;\par' + #13#10 + ' Caption := ExpandConstant(''\{cm:TextLabel\}'');;\par' + #13#10 + ' Alignment := taCenter;\par' + #13#10 + ' Transparent := False;\par' + #13#10 + ' Left := ScaleX(10);\par' + #13#10 + ' Top := ScaleY(10);\par' + #13#10 + ' Width := ScaleX(236);\par' + #13#10 + ' Height := ScaleY(236);\par' + #13#10 + ' end;\par' + #13#10 + '\par' + #13#10 + ' if Form.ShowModal() = mrOk then\par' + #13#10 + ' exit;\par' + #13#10 + ' finally\par' + #13#10 + ' Form.Free();\par' + #13#10 + ' end;\par' + #13#10 + ' end;\par' + #13#10 + '\par' + #13#10 + ' procedure InitializeWizard();\par' + #13#10 + ' var\par' + #13#10 + ' AboutButton, CancelButton: TButton;\par' + #13#10 + ' Form: TSetupForm;\par' + #13#10 + '\par' + #13#10 + ' begin\par' + #13#10 + ' CancelButton := WizardForm.CancelButton;\par' + #13#10 + '\par' + #13#10 + ' AboutButton := TButton.Create(WizardForm);\par' + #13#10 + ' AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;\par' + #13#10 + ' AboutButton.Top := CancelButton.Top;\par' + #13#10 + ' AboutButton.Width := CancelButton.Width;\par' + #13#10 + ' AboutButton.Height := CancelButton.Height;\par' + #13#10 + ' AboutButton.Caption := ''\lang1049\''cf\''ee\''e4\''f0\''ee\''e1\''ed\''e5\''e5\lang1033 '';\par' + #13#10 + ' AboutButton.ShowHint := True\par' + #13#10 + ' AboutButton.Hint := ''\lang1049\''ce\lang1033 \lang1049\''ef\''f0\''ee\''e3\''f0\''e0\''ec\''ec\''e5\lang1033 ''\par' + #13#10 + ' AboutButton.OnClick := @AboutButtonOnClick;\par' + #13#10 + ' AboutButton.Parent := WizardForm;\par' + #13#10 + ' \lang1049 AboutButton.Cursor := crHand;\par' + #13#10 + ' end;\cf2\f1\fs16\par' + #13#10 + '}' + #13#10 + ''; end; end; if Form.ShowModal() = mrOk then exit; finally Form.Free(); end; end; procedure InitializeWizard(); var AboutButton, CancelButton: TButton; Form: TSetupForm; begin CancelButton := WizardForm.CancelButton; AboutButton := TButton.Create(WizardForm); AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width; AboutButton.Top := CancelButton.Top; AboutButton.Width := CancelButton.Width; AboutButton.Height := CancelButton.Height; AboutButton.Caption := 'Подробнее'; AboutButton.ShowHint := True AboutButton.Hint := 'О программе' AboutButton.OnClick := @AboutButtonOnClick; AboutButton.Parent := WizardForm; AboutButton.Cursor := crHand; end; |