
17-05-2014, 09:58
|
 |
Die Hard Member
|
|
Join Date: Nov 2008
Location: Italy
Posts: 928
Thanks: 14
Thanked 983 Times in 236 Posts
|
|
Quote:
Originally Posted by altef_4
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.
|