OnGuard: Rework sample projects.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8721 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-20 11:17:45 +00:00
parent a1792b0941
commit d6279b614d
103 changed files with 2214 additions and 1689 deletions

View File

@@ -94,34 +94,36 @@ var
ReleaseCode : TCode;
CodeString : string;
begin
ReleaseCode := Default(TCode);
edtReleaseCode.Text := '';
// Get the key that will be used to generate the ReleaseCode
Key := ApplicationKey;
if chkMachMod.Checked then
try
Modifier := StrToInt(edtMachineMod.Text);
ApplyModifierToKeyPrim(Modifier, Key, sizeof(Key));
except
begin
if TryStrToInt(edtMachineMod.Text, Modifier) then
ApplyModifierToKeyPrim(Modifier, Key, sizeof(Key))
else
begin
MessageDlg('Invalid Machine Modifier. Please check your entry and try again.', mtError, [mbOK], 0);
exit;
end;
end;
// Get the expiration date
if chkExpires.Checked then
try
Expires := StrToDate(edtExpires.Text);
except
begin
if not TryStrToDate(edtExpires.Text, Expires) then
begin
MessageDlg('Invalid Expiration Date. Please check your entry and try again.', mtError, [mbOK], 0);
exit;
end
else
end;
end else
Expires := 0;
// Get the serial number
try
SerialNum := StrToInt(edtSerialNumber.Text);
except
if not TryStrToInt(edtSerialNumber.Text, SerialNum) then
begin
MessageDlg('Invalid Serial Number. Please check your entry and try again.', mtError, [mbOK], 0);
exit;
end;