View Single Post
  #2  
Old 17-05-2014, 09:58
peterf1999's Avatar
peterf1999 peterf1999 is offline
Die Hard Member
 
Join Date: Nov 2008
Location: Italy
Posts: 928
Thanks: 14
Thanked 983 Times in 236 Posts
peterf1999 is on a distinguished road
Quote:
Originally Posted by altef_4 View Post
small error, if file for check not exists - error.
p.s. in attachment working module+example for those who don't know how to use this library.
p.p.s. can you provide me example how do you create callback for inno setup in delphi without CallbackCtrl.dll/InnoCallback.dll/CallbackAddr ?
Code:
type THashProgress = function(OverallProgress,FileProgress: Integer): Boolean of object;




function CheckFileSHA1(Filename,SHA1HashHex: AnsiString; PctOfTotal: integer; callback: THashProgress): integer export; stdcall;
begin
...

if not callback(FileProgress+OverallProgress,round(FileProgress*100/PctOfTotal)) then begin
      Result:=-1;
      break;
      end;
...

end;
I didn't intentionally handle the exception of TFileStream, because the file must exist.

Last edited by peterf1999; 17-05-2014 at 10:44.
Reply With Quote
The Following 2 Users Say Thank You to peterf1999 For This Useful Post:
altef_4 (17-05-2014), y_thelastknight (18-05-2014)