Get-ChocolateyUnzip support for 64bit-only systems
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
Windows Server Core systems can be configured to disable 32-bit application support (`Uninstall-WindowsFeature WoW64-Support`).
This increases the security of the system by reducing its attack surface.
Chocolatey installs correctly on those systems (provided PowerShell 5 is present, see chocolatey/home#2). However, its functionality is severely crippled by the fact that the `Get-ChocolateyUnzip` helper always calls a 32-bit version of 7z.exe. This prevents the installation of any packages which unpack archives.
Here is a sample output fragment from `cinst -dvy sysinternals`:
```
Extracting C:\Users\Administrator\AppData\Local\Temp\2\chocolatey\sysinternals\2022.5.11\SysinternalsSuite.zip to C:\ProgramData\chocolatey\
lib\sysinternals\tools...
7zip found at 'C:\ProgramData\chocolatey\tools\7z.exe'
Executing command ['C:\ProgramData\chocolatey\tools\7z.exe' x -aoa -bd -bb1 -o"C:\ProgramData\chocolatey\lib\sysinternals\tools" -y "C:\User
s\Administrator\AppData\Local\Temp\2\chocolatey\sysinternals\2022.5.11\SysinternalsSuite.zip"]
ERROR: Exception calling "Start" with "0" argument(s): "The subsystem needed to support the image type is not present"
at Get-ChocolateyUnzip, C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyUnzip.ps1: line 199
at Install-ChocolateyZipPackage, C:\ProgramData\chocolatey\helpers\functions\Install-ChocolateyZipPackage.ps1: line 216
```
This could be resolved if Chocolatey included both 32-bit and 64-bit versions of 7z.exe and `Get-ChocolateyUnzip` used the version matching the native OS bitness.
Contributor guide
Research direction
Start in Get-ChocolateyUnzip.ps1 around line 199, then trace the call from Install-ChocolateyZipPackage.ps1 around line 216. Reproduce the failure with the shown cinst -dvy sysinternals command on a Windows Server Core system without WoW64 support, and verify that archive installation works using the 7z version matching the native OS bitness.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100