demon_777 Цитата: к примеру серийники будут наподобие такого
56LC-V6RA-KNP7-RJYH-FARH
-- тогда к примеру [more=так]
Код: [no]
[Setup]
AppName=My Program
AppVerName=My Program v.1.2
DefaultDirName={pf}\My Program
[Code]
const
gap = 8;
MaxPartLen = 4;
var
SerialPage: TWizardPage;
SerialPart1, SerialPart2, SerialPart3, SerialPart4, SerialPart5: TNewEdit;
procedure SerialPartOnChange(Sender: TObject);
var
ln: integer;
begin
if (Length(SerialPart1.Text) = 4) and
(Length(SerialPart2.Text) = 4) and
(Length(SerialPart3.Text) = 4) and
(Length(SerialPart4.Text) = 4) and
(Length(SerialPart5.Text) = 4)
then
WizardForm.NextButton.Enabled := True
else
WizardForm.NextButton.Enabled := False;
end;
procedure CreatePages();
begin
SerialPage := CreateCustomPage(wpWelcome, 'License Information', 'Please enter Serial number, then click Next.');
SerialPart1 := TNewEdit.Create(SerialPage);
with SerialPart1 do begin
Top := SerialPage.SurfaceHeight / 2 ;
Width := ScaleX(48);
Left := (SerialPage.SurfaceWidth / 2) - (5*SerialPart1.Width + 4*gap)/2;
CharCase := ecUpperCase;
MaxLength := MaxPartLen;
Parent := SerialPage.Surface;
OnChange:= @SerialPartOnChange;
end;
SerialPart2 := TNewEdit.Create(SerialPage);
with SerialPart2 do begin
Top := SerialPart1.Top;
Left := SerialPart1.Left + SerialPart1.Width + ScaleX(gap);
Width := SerialPart1.Width;
CharCase := ecUpperCase;
MaxLength := MaxPartLen;
Parent := SerialPage.Surface;
OnChange:= @SerialPartOnChange;
end;
SerialPart3 := TNewEdit.Create(SerialPage);
with SerialPart3 do begin
Top := SerialPart2.Top;
Left := SerialPart2.Left + SerialPart2.Width + ScaleX(gap);
Width := SerialPart2.Width;
CharCase := ecUpperCase;
MaxLength := MaxPartLen;
Parent := SerialPage.Surface;
OnChange:= @SerialPartOnChange;
end;
SerialPart4 := TNewEdit.Create(SerialPage);
with SerialPart4 do begin
Top := SerialPart3.Top;
Left := SerialPart3.Left + SerialPart3.Width + ScaleX(gap);
Width := SerialPart3.Width;
CharCase := ecUpperCase;
MaxLength := MaxPartLen;
Parent := SerialPage.Surface;
OnChange:= @SerialPartOnChange;
end;
SerialPart5 := TNewEdit.Create(SerialPage);
with SerialPart5 do begin
Top := SerialPart4.Top;
Left := SerialPart4.Left + SerialPart4.Width + ScaleX(gap);
Width := SerialPart4.Width;
CharCase := ecUpperCase;
MaxLength := MaxPartLen;
Parent := SerialPage.Surface;
OnChange:= @SerialPartOnChange;
end;
end;
procedure InitializeWizard();
begin
CreatePages();
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = SerialPage.ID then
SerialPartOnChange(nil);
end;
[/no]