Index: dll/win32/setupapi/queue.c =================================================================== --- dll/win32/setupapi/queue.c (revision 69191) +++ dll/win32/setupapi/queue.c (working copy) @@ -989,27 +989,33 @@ { BOOL rc = FALSE; BOOL docopy = TRUE; + BOOL decomppressed = FALSE; + DWORD required, source_size, target_size; + UINT type; WCHAR TempFile[MAX_PATH]; - INT hSource, hTemp; - OFSTRUCT OfStruct; WCHAR TempPath[MAX_PATH]; TRACE("copy %s to %s style 0x%x\n",debugstr_w(source),debugstr_w(target),style); - hSource = LZOpenFileW((LPWSTR)source, &OfStruct, OF_READ); - if (hSource < 0) - return FALSE; + if (!(style & SP_COPY_NODECOMP)) + { + SetupGetFileCompressionInfoExW(source, NULL, 0, &required, NULL, NULL, NULL); - /* Get a temp file name */ - GetTempPathW(sizeof(TempPath) / sizeof(WCHAR), TempPath); - GetTempFileNameW(TempPath, L"", 0, TempFile); + if (required > MAX_PATH) + return FALSE; - /* Extract the compressed file to a temp location */ - hTemp = LZOpenFileW(TempFile, &OfStruct, OF_CREATE); - LZCopy(hSource, hTemp); - LZClose(hSource); - LZClose(hTemp); + if (!SetupGetFileCompressionInfoExW(source, TempFile, required, &required, + &source_size, &target_size, &type)) + return FALSE; + /* Get a temp file name */ + GetTempPathW(sizeof(TempPath) / sizeof(WCHAR), TempPath); + GetTempFileNameW(TempPath, L"", 0, TempFile); + if (ERROR_SUCCESS != SetupDecompressOrCopyFileW(source, TempFile, &type)) + return FALSE; + decomppressed = TRUE; + } + /* before copy processing */ if (style & SP_COPY_REPLACEONLY) { @@ -1035,7 +1041,10 @@ if ((GetFileAttributesW(target) != INVALID_FILE_ATTRIBUTES) && (GetFileAttributesW(TempFile) != INVALID_FILE_ATTRIBUTES)) { - VersionSizeSource = GetFileVersionInfoSizeW(TempFile,&zero); + if (decomppressed) + VersionSizeSource = GetFileVersionInfoSizeW(TempFile,&zero); + else + VersionSizeSource = GetFileVersionInfoSizeW(source,&zero); VersionSizeTarget = GetFileVersionInfoSizeW((LPWSTR)target,&zero); } @@ -1055,7 +1064,10 @@ VersionSource = HeapAlloc(GetProcessHeap(),0,VersionSizeSource); VersionTarget = HeapAlloc(GetProcessHeap(),0,VersionSizeTarget); - ret = GetFileVersionInfoW(TempFile,0,VersionSizeSource,VersionSource); + if (decomppressed) + ret = GetFileVersionInfoW(TempFile,0,VersionSizeSource,VersionSource); + else + ret = GetFileVersionInfoW(source,0,VersionSizeSource,VersionSource); if (ret) ret = GetFileVersionInfoW((LPWSTR)target, 0, VersionSizeTarget, VersionTarget); @@ -1122,7 +1134,7 @@ docopy = FALSE; } } - if (style & (SP_COPY_NODECOMP | SP_COPY_LANGUAGEAWARE | SP_COPY_FORCE_IN_USE | + if (style & (SP_COPY_LANGUAGEAWARE | SP_COPY_FORCE_IN_USE | SP_COPY_IN_USE_NEEDS_REBOOT | SP_COPY_NOSKIP | SP_COPY_WARNIFSKIP)) { ERR("Unsupported style(s) 0x%x\n",style); @@ -1130,7 +1142,10 @@ if (docopy) { - rc = MoveFileExW(TempFile,target,MOVEFILE_REPLACE_EXISTING); + if (decomppressed) + rc = MoveFileExW(TempFile,target,MOVEFILE_REPLACE_EXISTING); + else + rc = MoveFileExW(source,target,MOVEFILE_REPLACE_EXISTING); TRACE("Did copy... rc was %i\n",rc); }