   
cisak
New member Username: cisak
Post Number: 2 Registered: 03-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, March 18, 2009 - 12:39 am: |
|
sample: [_ISTool] EnableISX=true Use7zip=false [Files] Source: C:\inno setup 5.2.3\ikg\ikg\sample2.iky; DestDir: {tmp}; Flags: ignoreversion Source: C:\inno setup 5.2.3\ikg\ISID\ISID.dll; DestDir: {sys}\ISID; Flags: ignoreversion Source: C:\inno setup 5.2.3\ikg\ISID\ISID.dll; DestDir: {app}\ISID; Flags: ignoreversion [Setup] AppName=Inno Key Generator AppVerName=Inno Key Generator 1.0.2.1 DefaultDirName={pf}\MJ Freelancing\IKG DefaultGroupName=Inno Key Generator OutputDir=output AppCopyright=Copyright © Oct 2002 - 2006 MJ Freelancing OutputBaseFilename=IKGSetup [Icons] Name: {group}\Inno Key Generator; Filename: {app}\IKG\IKG.exe; IconFilename: {app}\IKG\IKG.exe; IconIndex: 0 Name: {group}\Uninstall IKG; Filename: {uninstallexe}; IconIndex: 0 Name: {group}\IKG Help; Filename: {app}\IKG\IKGHelp.chm; WorkingDir: {app}\IKG; Comment: IKG Help; Flags: createonlyiffileexists; IconIndex: 0 Name: {group}\IKG Help; Filename: {app}\IKG\IKGHelp.hlp; WorkingDir: {app}\IKG; Comment: IKG Help; Flags: createonlyiffileexists; IconIndex: 0 [Code] function ValidateSerialNumber(InnoKeyFile, User, Orgn, ProdCode, HDD, MAC, PrivateKey, Serial: String): Boolean; external 'ValidateSerialNumber@files:ISID.dll stdcall'; var UserPage: TInputQueryWizardPage; UserValues: TArrayOfString; function GetHDDSerial(Drive: Char; HDD : String): Integer; external 'GetHDDSerial@files:ISID.dll stdcall'; procedure InitializeWizard(); begin { create the custom page } 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.'); UserPage.Add('HDD:', False); UserPage.Add('Unlock Code:', False); UserPage.Add('Private Key:', False); { Try to find the settings that were stored last time (also see below). } SetArrayLength(UserValues, 3); end; end. procedure RegisterPreviousData(PreviousDataKey: Integer); begin { Store the settings so we can restore them next time } SetPreviousData(PreviousDataKey, 'HDD', UserPage.Values[1]); SetPreviousData(PreviousDataKey, 'Unlock', UserPage.Values[2]); SetPreviousData(PreviousDataKey, 'Private', UserPage.Values[3]); end; function ScriptDlgPages(CurPage: Integer; BackClicked: Boolean): Boolean; var ExpPath: String; begin Result := True; if (CurPage = UserPage.ID) then begin ExtractTemporaryFile('sample2.iky'); { the public key file } ExpPath := ExpandConstant('{tmp}\sample2.iky'); Result := False; UserValues[1] := UserPage.Values[1]; UserValues[2] := UserPage.Values[2]; UserValues[3] := UserPage.Values[3]; if (UserValues[1] = '') or (UserValues[2] = '') or (UserValues[3] = '') then MsgBox('No fields can be blank !', mbError, MB_OK) else begin Result := ValidateSerialNumber( ExpPath, '','','', UserValues[1], '', UserValues[3], UserValues[2] ); if (not Result) then MsgBox('Invalid Entry !', 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{4662DAB0-D393-11D0-9A56-00C04FB68B66}\InprocServer32', ''); end; function HasNoHtmlHelp(): Boolean; begin Result := not HasHtmlHelp; end; |