Skip to content

Instantly share code, notes, and snippets.

@ardislu
Last active March 12, 2025 01:45
Show Gist options
  • Save ardislu/16e44f6a49f8ec0f313b0b849c61580c to your computer and use it in GitHub Desktop.
Save ardislu/16e44f6a49f8ec0f313b0b849c61580c to your computer and use it in GitHub Desktop.

How to fix winget taking a long time to extract archive

Problem

Using winget to install programs with large archives (e.g., zig.zig) takes a long time and appears to hang:

PS> winget install zig.zig
Found Zig [zig.zig] Version 0.14.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...

Solution

Create or update settings.json to set installBehavior.archiveExtractionMethod to tar:

{
  "$schema": "https://aka.ms/winget-settings.schema.json",
  "installBehavior": {
    "archiveExtractionMethod": "tar"
  }
}

This file is probably located at %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json.

Explanation

By default, winget uses the ancient and slow zipfldr.dll to extract archives.

Since 2017, Windows comes with tar.exe which is faster. So, switching archive extraction method resolves the problem.

Credits

Original issues for reporting the problem: #3306, #3311, #3505

PR #4541 for adding suppport for using tar.exe (Documentation: Archive Extraction Method)

User 720720 for sharing the fix 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment