Skip to content

Add argument to Get-ChocolateyUnzip and Install-ChocolateyZipPackage to exclude files from being extractedΒ #3790

@glucn

Description

@glucn

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my request.

Is Your Feature Request Related To A Problem? Please describe.

After choco upgrading the version of 7zip to 25.01 (7e18bdb), the installation of package gcloudsdk (https://community.chocolatey.org/packages/gcloudsdk) that I'm maintaining started to fail. The direct reason for the failure is 7zip reporting "Dangerous link path was ignored" error.

For example, in https://gist.github.com/choco-bot/0d8c64f5020673098e5f45a0f7043f5e

...
2025-09-17 03:37:17,543 3480 [INFO ] - VERBOSE: 
2025-09-17 03:37:17,558 3480 [INFO ] - VERBOSE: Sub items Errors: 6
2025-09-17 03:37:17,667 3480 [INFO ] - VERBOSE: 
2025-09-17 03:37:17,681 3480 [INFO ] - VERBOSE: Archives with Errors: 1
2025-09-17 03:37:17,699 3480 [INFO ] - VERBOSE: 
2025-09-17 03:37:17,713 3480 [INFO ] - VERBOSE: Sub items Errors: 6
2025-09-17 03:37:17,762 3480 [ERROR] - ERROR: Dangerous link path was ignored : google-cloud-sdk\platform\gsutil\third_party\funcsigs\docs\index.rst : ..\README.rst
2025-09-17 03:37:17,776 3480 [ERROR] - ERROR: Dangerous link path was ignored : google-cloud-sdk\platform\gsutil\third_party\google-auth-library-python-httplib2\docs\CHANGELOG.md : ..\CHANGELOG.md
2025-09-17 03:37:17,792 3480 [ERROR] - ERROR: Dangerous link path was ignored : google-cloud-sdk\platform\gsutil\third_party\google-auth-library-python-httplib2\docs\README.rst : ..\README.rst
2025-09-17 03:37:17,808 3480 [ERROR] - ERROR: Dangerous link path was ignored : google-cloud-sdk\platform\gsutil\third_party\mock\docs\changelog.txt : ..\ChangeLog
2025-09-17 03:37:17,822 3480 [ERROR] - ERROR: Dangerous link path was ignored : google-cloud-sdk\platform\gsutil\third_party\requests\tests\certs\valid\ca : ..\expired\ca
2025-09-17 03:37:17,855 3480 [ERROR] - ERROR: Dangerous link path was ignored : google-cloud-sdk\platform\gsutil\third_party\requests\tests\certs\mtls\client\ca : ..\..\expired\ca
2025-09-17 03:37:18,183 3480 [DEBUG] - Command ['C:\ProgramData\chocolatey\tools\7z.exe' x -aoa -bd -bb1 -o"C:\ProgramData\chocolatey\lib\gcloudsdk\tools" -y "C:\Users\vagrant\AppData\Local\Temp\chocolatey\gcloudsdk\538.0.0\google-cloud-cli-538.0.0-windows-x86_64.zip"] exited with '2'.
2025-09-17 03:37:18,730 3480 [DEBUG] - 7z exit code: 2
2025-09-17 03:37:18,869 3480 [ERROR] - ERROR: 7-Zip encountered a fatal error while extracting the files. This is most likely an issue with the 'gcloudsdk' package and not with Chocolatey itself. Please follow up with the package maintainer(s) directly.
...

Such error not only happens during the verification tests of any new version of gcloudsdk package, but also happens when installing the published versions of gcloudsdk package.

I'm trying to fix this issue, where I hope I can exclude those symlink files during the ZIP extraction. But I cannot find any argument of Get-ChocolateyUnzip and Install-ChocolateyZipPackage for such purpose.

Describe The Solution. Why is it needed?

I propose choco to add a new optional argument of Get-ChocolateyUnzip and Install-ChocolateyZipPackage, which can control if certain files should be excluded. This new argument will be translated to the 7zip argument of -x!path/to/file, or [email protected] for providing a "blocklist file"

Additional Context

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions