From 00da13f83a81f5f015444226806184075f028e06 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 --- PanelSwCustomActions/ExecOnComponent.cpp | 2 ++ PanelSwCustomActions/PanelSwCustomActions.vcxproj | 7 ++++--- .../PanelSwCustomActions.vcxproj.filters | 3 +++ PanelSwCustomActions/Unzip.cpp | 13 +++++++++---- TidyBuild.custom.props | 4 ++-- poco | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) 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..d613637 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 @@ -216,7 +217,7 @@ - + @@ -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