mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 10:22:59 +00:00
[RAPPS] Don't delete downloaded ZIP/CAB even if configured to (#7791)
This commit is contained in:
parent
7f49ae633b
commit
7dc7b866b1
5 changed files with 78 additions and 3 deletions
|
@ -47,6 +47,17 @@ enum {
|
|||
UNOP_EMPTYREGKEY = 'k',
|
||||
};
|
||||
|
||||
BOOL IsZipFile(PCWSTR Path)
|
||||
{
|
||||
zlib_filefunc64_def zff;
|
||||
fill_win32_filefunc64W(&zff);
|
||||
unzFile hzf = unzOpen2_64(Path, &zff);
|
||||
if (!hzf)
|
||||
return FALSE;
|
||||
unzClose(hzf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
ExtractFilesFromZip(LPCWSTR Archive, const CStringW &OutputDir,
|
||||
EXTRACTCALLBACK Callback, void *Cookie)
|
||||
|
@ -491,7 +502,7 @@ ExtractAndInstallThread(LPVOID Parameter)
|
|||
|
||||
if (!Info.Error)
|
||||
{
|
||||
BOOL isCab = SplitFileAndDirectory(Archive).Right(4).CompareNoCase(L".cab") == 0;
|
||||
BOOL isCab = LOBYTE(ClassifyFile(tempdir)) == 'C';
|
||||
Info.Error = isCab ? ExtractCab(Archive, tempdir, ExtractCallback, &Info)
|
||||
: ExtractZip(Archive, tempdir, ExtractCallback, &Info);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue