From 1de94ec62c434951870a275d281195fd90b19c68 Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Sun, 8 Dec 2024 15:12:43 +0200 Subject: [PATCH] Fix zipping large folders- resultant zip file was invalid --- .github/workflows/github-actions-build.yml | 2 +- PanelSwCustomActions/ExecOnComponent.cpp | 2 ++ PanelSwCustomActions/PanelSwCustomActions.vcxproj | 11 ++++++----- .../PanelSwCustomActions.vcxproj.filters | 3 +++ PanelSwCustomActions/Unzip.cpp | 13 +++++++++---- TidyBuild.custom.props | 4 ++-- poco | 2 +- 7 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 3063797..b96f23c 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -47,7 +47,7 @@ jobs: cmake.exe --build build-v142\protobuf --config Release cmake.exe -G "Visual Studio 16 2019" -T v141_xp,host=x86 -A Win32 .\protobuf\cmake -Dprotobuf_BUILD_TESTS=OFF -B build\protobuf cmake.exe --build build\protobuf --config Release - cmake.exe -G "Visual Studio 16 2019" -T v141_xp,host=x86 -A Win32 .\poco -DPOCO_STATIC=ON -DPOCO_MT=ON -B build\poco + cmake.exe -G "Visual Studio 16 2019" -T v141_xp,host=x86 -A Win32 .\poco -DPOCO_MT=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DENABLE_XML=ON -DENABLE_ZIP=ON -DENABLE_ENCODINGS=OFF -DENABLE_UTIL=OFF -DENABLE_NET=OFF -DENABLE_MONGODB=OFF -DENABLE_REDIS=OFF -DENABLE_DNSSD=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_PDF=OFF -DENABLE_JWT=OFF -DENABLE_NETSSL_WIN=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_DATA=OFF -DENABLE_DATA_SQLITE=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_ACTIVERECORD=OFF -DENABLE_ACTIVERECORD_COMPILER=OFF -DENABLE_APACHECONNECTOR=OFF -DENABLE_CPPPARSER=OFF -DENABLE_POCODOC=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF -DENABLE_ENCODINGS_COMPILER=OFF -DENABLE_TRACE=OFF -DENABLE_TESTS=OFF -DENABLE_DATA_ODBC=OFF -B build\poco cmake.exe --build build\poco --config Release - name: Build CaCommon v142 diff --git a/PanelSwCustomActions/ExecOnComponent.cpp b/PanelSwCustomActions/ExecOnComponent.cpp index df2416b..1c696b4 100644 --- a/PanelSwCustomActions/ExecOnComponent.cpp +++ b/PanelSwCustomActions/ExecOnComponent.cpp @@ -1,6 +1,8 @@ #include "ExecOnComponent.h" #include "../CaCommon/RegistryKey.h" #include +#include +#include #include "FileOperations.h" #include "../CaCommon/WixString.h" #include diff --git a/PanelSwCustomActions/PanelSwCustomActions.vcxproj b/PanelSwCustomActions/PanelSwCustomActions.vcxproj index c2e9ee1..abce1d4 100755 --- a/PanelSwCustomActions/PanelSwCustomActions.vcxproj +++ b/PanelSwCustomActions/PanelSwCustomActions.vcxproj @@ -46,7 +46,7 @@ CaCommon.lib;libprotobuf-lite.lib;ProtoCaLib.lib;msi.lib;dutil.lib;wcautil.lib;Version.lib;Shell32.lib;User32.lib;%(AdditionalDependencies) - $(WixSdkPath)\$(WixPlatformToolset)\lib\x86;$(OutDir)\..\CaCommon\;$(OutDir)\..\ProtoCaLib;$(BuildFolder)\poco\lib\$(Configuration);$(BuildFolder)\protobuf\$(Configuration);%(AdditionalLibraryDirectories) + $(WixSdkPath)\$(WixPlatformToolset)\lib\x86;$(OutDir)\..\CaCommon\;$(OutDir)\..\ProtoCaLib;$(BuildFolder)\poco\lib\;$(BuildFolder)\protobuf\$(Configuration);%(AdditionalLibraryDirectories) Windows MachineX86 @@ -62,6 +62,7 @@ MultiThreaded true ProgramDatabase + stdcpp17 true @@ -213,11 +214,11 @@ - + - - + + @@ -231,4 +232,4 @@ - \ No newline at end of file + diff --git a/PanelSwCustomActions/PanelSwCustomActions.vcxproj.filters b/PanelSwCustomActions/PanelSwCustomActions.vcxproj.filters index 07e21cc..47eec1e 100755 --- a/PanelSwCustomActions/PanelSwCustomActions.vcxproj.filters +++ b/PanelSwCustomActions/PanelSwCustomActions.vcxproj.filters @@ -293,6 +293,9 @@ Header Files + + Header Files + diff --git a/PanelSwCustomActions/Unzip.cpp b/PanelSwCustomActions/Unzip.cpp index 262e461..c53aa53 100644 --- a/PanelSwCustomActions/Unzip.cpp +++ b/PanelSwCustomActions/Unzip.cpp @@ -337,7 +337,7 @@ HRESULT CUnzip::ExecuteOneZip(::com::panelsw::ca::ZipDetails* pDetails) zipFileStream = new std::ofstream(zipFileA, std::ios::binary); ExitOnNull(zipFileStream, hr, E_OUTOFMEMORY, "Failed creating zip file '%ls'", zipFileW); - pZip = new Compress(*zipFileStream, true); + pZip = new Compress(*zipFileStream, true, true); ExitOnNull(zipFileStream, hr, E_OUTOFMEMORY, "Failed creating zip archive for '%ls'", zipFileW); for (CFileEntry fileEntry = fileFinder.Find(srcFolderW, szPattern, pDetails->recursive()); !fileFinder.IsEnd(); fileEntry = fileFinder.Next()) @@ -390,10 +390,15 @@ HRESULT CUnzip::ExecuteOneZip(::com::panelsw::ca::ZipDetails* pDetails) } ExitOnFailure(hr, "Failed to add '%ls' to zip '%ls'", (LPCWSTR)fileEntry.Path(), zipFileW); } - - pZip->close(); - zipFileStream->flush(); } + + pZip->close(); + delete pZip; + pZip = nullptr; + + zipFileStream->flush(); + delete zipFileStream; + zipFileStream = nullptr; } catch (Poco::Exception ex) { diff --git a/TidyBuild.custom.props b/TidyBuild.custom.props index ca41b02..66191a8 100644 --- a/TidyBuild.custom.props +++ b/TidyBuild.custom.props @@ -2,7 +2,7 @@ - 3.13.2 + 3.13.3 $(FullVersion).$(GITHUB_RUN_NUMBER) PanelSwWixExtension Panel::Software @@ -12,7 +12,7 @@ --> - D:\Tools\cmake-3.26.4-windows-x86_64\bin\ + D:\Tools\cmake-3.30.3-windows-x86_64\bin\ Visual Studio 16 2019 v141_xp false diff --git a/poco b/poco index de61f00..02c86d4 160000 --- a/poco +++ b/poco @@ -1 +1 @@ -Subproject commit de61f0049175a941cc83c2615c3bdc5e947b89f9 +Subproject commit 02c86d4cddb14de293eabdb795e4a7c61745eb2b