I have Inno Script Create Using IKG (Inno Key generator)
I want Add This Step to My Script
Please Help me.
User can install this setup one or two time per day only.
Eg:
1.get and check date using Internet (because user can change PC date)
2.Save date to registry and a file in program folder ({app}) (date limitation file), like date.txt. Registry and date limitation file must be created after all installation files are copied.
3.Check per date limitation and before installation starts (using registry and date limitation file)
i.limit Over :
Msg Cant Install
ii.Limit Not over or registry And Limitation File not Have : Installation Start
Files:
2016-10-27_asxctxuk | Files.fm.[
^]
Please help me. Thanks
What I have tried:
This is My Ikg Script
[_ISTool]
EnableISX=true
Use7zip=false
[Files]
Source: sample2.iky; DestDir: {tmp}; Flags: ignoreversion
Source: ISID.dll; DestDir: {sys}\ISID; Flags: ignoreversion
[Setup]
AppName=Temp
AppVerName=1.0
DefaultDirName={pf}\
DefaultGroupName=Temp
OutputDir=output
OutputBaseFilename=setup
[ThirdParty]
CompileLogMethod=append
[Code]
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
PicList: TStringlist;
function ValidateSerialNumber(InnoKeyFile, User, Orgn, ProdCode, HDD, MAC, PrivateKey, Serial: ansiString): Boolean;
external 'ValidateSerialNumber@files:ISID.dll stdcall';
var
UserPage: TInputQueryWizardPage;
UserValues: TArrayOfString;
I: Integer;
sHWID: ansiString;
procedure InitializeWizard();
begin
begin
PicList:=tstringlist.Create;
ExtractTemporaryFile('sample2.iky');
end;
UserPage := CreateInputQueryPage(wpInfoBefore,
'Enter Registration Details', 'You need to be a registered user to be able to proceed',
'Enter your registration details exactly (CASE SENSITIVE), then click Next. ( Type {User ID-Game Name-User Code} Send SMS ) Tel No 071-9551010 Support Time 8.30AM-6.00PM' );
UserPage.Add('User Code:', False);
UserPage.Add('Path Code:', true);
UserPage.Add('Reg Code:', False);
for I := 0 to 1 do
begin
UserPage.Edits[I].ReadOnly := True;
UserPage.Edits[I].Color := clBtnFace;
end;
{ Set default values }
SetArrayLength(UserValues, 3);
RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion', 'RegisteredOwner', UserValues[0]);
RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion', 'RegisteredOrganization', UserValues[1]);
if (UserValues[0] = '') and (UserValues[1] = '') then begin
RegQueryStringValue(HKCU, 'Software\Microsoft\MS Setup (ACME)\User Info', 'DefName', UserValues[0]);
RegQueryStringValue(HKCU, 'Software\Microsoft\MS Setup (ACME)\User Info', 'DefCompany', UserValues[1]);
end;
{ Try to find the settings that were stored last time (also see below). }
UserPage.Values[0] := GetPreviousData('MAC', UserValues[0]);
UserPage.Values[1] := GetPreviousData('Private', UserValues[1]);
UserPage.Values[2] := GetPreviousData('Unlock', UserValues[2]);
UserPage.Edits[0].Text := '123';
UserPage.Edits[1].Text := '968699E9-0C9D-409A-9699-0197A9A9201A';
UserPage.Edits[2].Text := '';
end;
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
{ Store the settings so we can restore them next time }
SetPreviousData(PreviousDataKey, 'MAC', UserPage.Values[0]);
SetPreviousData(PreviousDataKey, 'Private', UserPage.Values[1]);
SetPreviousData(PreviousDataKey, 'Unlock', UserPage.Values[2]);
end;
function ScriptDlgPages(CurPage: Integer; BackClicked: Boolean): Boolean;
var
ExpPath: String;
begin
Result := True;
if (CurPage = UserPage.ID) then
begin
{ the public key file }
ExpPath := ExpandConstant('{tmp}\sample2.iky');
Result := False;
UserValues[0] := UserPage.Values[0];
UserValues[1] := UserPage.Values[1];
UserValues[2] := UserPage.Values[2];
if (UserValues[0] = '') or (UserValues[1] = '') or (UserValues[2] = '') then
MsgBox('No fields can be blank !', mbError, MB_OK)
else
begin
Result := ValidateSerialNumber( ExpPath,'','','','',UserValues[0],UserValues[1],UserValues[2] );
if (not Result) then
MsgBox('Invalid Serial !', mbError, MB_OK);
end
end
end;
function NextButtonClick(CurPage: Integer): Boolean;
begin
Result := ScriptDlgPages(CurPage, False);
end;
function BackButtonClick(CurPage: Integer): Boolean;
begin
Result := True;
end;
function HasHtmlHelp(): Boolean;
begin
{ HHCTRL.OCX GUID }
Result := RegValueExists(HKCR, 'CLSID\{152898F1-3E79-479E-846A-3988D37A0F0C}\InprocServer32', '');
end;
function HasNoHtmlHelp(): Boolean;
begin
Result := not HasHtmlHelp;
end;