From 2964ea8e326b1330fe827d2f293720a225829b62 Mon Sep 17 00:00:00 2001 From: Javier Matos Denizac Date: Mon, 4 Nov 2024 11:24:25 -0800 Subject: [PATCH] Remove msiexec dependency by adding using `vcpkg.exe` to unpack `7z.exe` (#41604) Co-authored-by: Javier Matos --- scripts/azure-pipelines/azure-pipelines.yml | 2 +- scripts/cmake/vcpkg_extract_archive.cmake | 6 +----- scripts/cmake/vcpkg_find_acquire_program(7Z).cmake | 10 +++++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index b9215e4291..a938207de7 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -8,7 +8,7 @@ parameters: - name: vcpkgToolSha displayName: 'Custom SHA of vcpkg-tool to use rather than bootstrap' type: string - default: 'use default' + default: 'use default' - name: tripletPattern displayName: 'Enable triplets which contain this substring' type: string diff --git a/scripts/cmake/vcpkg_extract_archive.cmake b/scripts/cmake/vcpkg_extract_archive.cmake index b6bc868479..51a425752c 100644 --- a/scripts/cmake/vcpkg_extract_archive.cmake +++ b/scripts/cmake/vcpkg_extract_archive.cmake @@ -34,12 +34,8 @@ function(vcpkg_extract_archive) WORKING_DIRECTORY "${archive_directory}" ) elseif("${archive_extension}" MATCHES [[\.7z\.exe$]]) - vcpkg_find_acquire_program(7Z) vcpkg_execute_in_download_mode( - COMMAND ${7Z} x - "${arg_ARCHIVE}" - "-o${arg_DESTINATION}" - -y -bso0 -bsp0 + COMMAND "$ENV{VCPKG_COMMAND}" z-extract "${arg_ARCHIVE}" "${arg_DESTINATION}" WORKING_DIRECTORY "${arg_DESTINATION}" ) else() diff --git a/scripts/cmake/vcpkg_find_acquire_program(7Z).cmake b/scripts/cmake/vcpkg_find_acquire_program(7Z).cmake index 419f2ac896..23ca4431d7 100644 --- a/scripts/cmake/vcpkg_find_acquire_program(7Z).cmake +++ b/scripts/cmake/vcpkg_find_acquire_program(7Z).cmake @@ -1,9 +1,9 @@ set(program_name 7z) if(CMAKE_HOST_WIN32) set(tool_subdirectory "24.08") - set(paths_to_search "${DOWNLOADS}/tools/7zip_msi-${tool_subdirectory}-windows/Files/7-Zip") # vcpkg fetch 7zip_msi path - list(APPEND paths_to_search "${DOWNLOADS}/tools/7z/${tool_subdirectory}/Files/7-Zip") - set(download_urls "https://github.com/ip7z/7zip/releases/download/24.08/7z2408.msi" "https://7-zip.org/a/7z2408.msi") - set(download_filename "7z2408.msi") - set(download_sha512 0bc88c99ad921a6f828d9ed9b8391510d1d0c2f8ecb7ad2921838c97c20f215e2ab03198009d159e2d1859bb20f157010f492288ce61c86544df06742cebbc34) + set(paths_to_search "${DOWNLOADS}/tools/7z/${tool_subdirectory}/7z2408/SourceDir/Files/7-Zip") + set(download_urls "https://github.com/ip7z/7zip/releases/download/24.08/7z2408.exe") + set(download_filename "7z2408.7z.exe") + set(search_names "7z.exe") + set(download_sha512 7f6c46c780fcb5fc10cc5405221179ddecbbb871c578ca3d9e3a74141271b383bd83e8f9d75c98d7e9d406e9b935d52a6b04913d654169e0b30f0719225e7dd9) endif()