Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-ChocolateyUnzip support for 64bit-only systems #2735

Open
jberezanski opened this issue Jun 8, 2022 · 5 comments
Open

Get-ChocolateyUnzip support for 64bit-only systems #2735

jberezanski opened this issue Jun 8, 2022 · 5 comments

Comments

@jberezanski
Copy link

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.

@corbob
Copy link
Member

corbob commented Jun 13, 2022

Any changes to this would require changes in chocolatey.extension as well to ensure we're maintaining feature parity here.

@mikocot
Copy link

mikocot commented Nov 28, 2022

Maybe we could at least start with detecting such incompatibility early and notifying the user? For now, it's quite hard to see what is happening without studying the logs, and even then far from obious as no one expects 7zip to be a problem, especially if another one (but correct verison) is already installed in the system and functional.

For those who also have gotten into this exact problem the workaround is to replace all 7zip files in C:\ProgramData\chocolatey\tools with a 64 bit version. But I guess it only works until the next update.

@pauby
Copy link
Member

pauby commented Nov 28, 2022

Is there a use case for this outside Windows Server Core that has 32bit application support disabled?

@mikocot
Copy link

mikocot commented Dec 1, 2022

Is there a use case for this outside Windows Server Core that has 32bit application support disabled?

Apparently security. But I can also see that similar effect is reported for some bugs/discrepancies and in my case other 32bit apps seem to work. Might be other kind of incompatibility in provided 7zip binary. Hard to say. In a corporate environment you don't have full control over you setup, and I'm a bit lazy to investigate the cause to be honest.

Uhh, sorry, for reopening.

@pauby
Copy link
Member

pauby commented Dec 2, 2022

Thanks for updating. Given that this is an issue that is difficult to reproduce, I'll go ahead and close it again.

It was never closed initially.

I'll leave it here, as it was, unclosed 😄

@pauby pauby closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2022
@pauby pauby reopened this Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants