function UnZipFile(DesPathName, ZipFileName: string; OverWrite: Boolean;
IsDir: Boolean; sPwd: string): Boolean;
begin
Result := False;
if IsDir and (not DirectoryExists(DesPathName)) then
MkDir(DesPathName);
if IOResult <> 0 then Exit;
if not FileExists(ZipFileName) then Exit;
with TVCLUnZip.Create(nil) do
try
try
Password := sPwd;
DoProcessMessages := True;
ZipName := ZipFileName;
ReadZip;
if Count = 0 then Abort; // 没有文件的情况 zmj
DestDir := DesPathName;
DoAll := True;
RecreateDirs := True;
if OverWrite then
OverwriteMode := ifNewer
else
OverwriteMode := Never;
UnZip;
Result := True;
except
Result := false;
end;
finally
Free;
end;
end;