Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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,      //wpWelcome,

            '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;//ScriptDlgPages(CurPage, 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;
Posted
Comments
[no name] 27-Oct-16 7:26am    
You are seriously worried about someone installing your program on the same machine multiple times per day? Why? What possible reason would you have for this? Besides that, you never asked a question, described a problem or told anyone what you need help with.
Thilankap 27-Oct-16 7:39am    
Because it have online logins (but it has limited logins).installation logins details add automatically. one user install many times other users cant install it.
[no name] 27-Oct-16 8:17am    
Do you realize that makes no sense? And you STILL haven't asked a question, described a problem or told us what you need help with.
Thilankap 27-Oct-16 11:33am    
I want Add 1,2,3 above Step to My Script.
[no name] 27-Oct-16 14:37pm    
Okay so go ahead and do that. No one here is going to do it for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900