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/FileIterator.cpp b/PanelSwCustomActions/FileIterator.cpp index f04c542..ff2b617 100644 --- a/PanelSwCustomActions/FileIterator.cpp +++ b/PanelSwCustomActions/FileIterator.cpp @@ -54,7 +54,16 @@ CFileEntry CFileIterator::Find(LPCWSTR szBasePath, LPCWSTR szPattern, bool bRecu // We're searching without filespec wildcard pattern so we can match subfolders _hFind = ::FindFirstFile(szBasePattern, &_findData); - ExitOnInvalidHandleWithLastError(_hFind, _hrStatus, "Failed to find files in '%ls'", szBasePath); + if (_hFind == INVALID_HANDLE_VALUE) + { + DWORD dwError = ::GetLastError(); + if ((dwError == ERROR_FILE_NOT_FOUND) || (dwError == ERROR_PATH_NOT_FOUND) || (dwError == ERROR_NO_MORE_FILES)) + { + _hrStatus = E_NOMOREFILES; + ExitFunction(); + } + ExitOnWin32Error(dwError, _hrStatus, "Failed to find files in '%ls'", szBasePath); + } return ProcessFindData(); 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 d764a01..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()) @@ -357,7 +357,7 @@ HRESULT CUnzip::ExecuteOneZip(::com::panelsw::ca::ZipDetails* pDetails) fileName.setFileName(szEntryName); ReleaseNullMem(szEntryName); - hr = StrAnsiAllocString(&szEntryName, fileEntry.Path(), 0, CP_UTF8); + hr = StrAnsiAllocString(&szEntryName, (LPCWSTR)fileEntry.Path(), 0, CP_UTF8); ExitOnFailure(hr, "Failed allocating string"); file.setFileName(szEntryName); @@ -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 271b969..66191a8 100644 --- a/TidyBuild.custom.props +++ b/TidyBuild.custom.props @@ -2,7 +2,7 @@ - 3.13.1 + 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