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

Unzipping to ProgramFiles/System32 is Subject to File System Redirection #960

Closed
ferventcoder opened this issue Sep 13, 2016 · 1 comment

Comments

@ferventcoder
Copy link
Member

ferventcoder commented Sep 13, 2016

Install PSWindowsUpdate and see what happens.

What You Are Seeing?

It appears it doesn't install successfully even though it logs that it does.

It actually installs to C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules

What is Expected?

Install to C:\Windows\System32\WindowsPowerShell\v1.0\Modules

How Did You Get This To Happen? (Steps to Reproduce)

  • Install 0.10.0 of Chocolatey on a 64-bit system
  • choco install pswindowsupdate -y --ignore-checksums (careful on this one)

Output Log

https://gist.github.com/erotavlas85/95f0588f9bd4f9713355f367ebeb672e#file-chocolatey-log-L320-L351

Details

File System Redirection is the issue.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa384187.aspx

Prior to 0.9.10, this worked appropriately. This is first seen with 0.9.10: bde0941#diff-e6324cd750d08e45111a0365537f3632L115. Note that the changes removed the call using the variables with 32 at the end that disabled redirection.

@ferventcoder
Copy link
Member Author

This was first introduced as a fix by @jberezanski in 0.9.8.24 - chocolatey-archive/chocolatey@54985d5

ferventcoder added a commit that referenced this issue Sep 14, 2016
When using a 32-bit version of 7z.exe to install applications, it can
be subject to file system redirection. This was originally handled
since 0.9.8.24 with
chocolatey-archive/chocolatey@54985d5
but was later accidentally reverted in choco v0.9.10 - GH-616
(bde0941).

With redirection, calls in 32bit processes to C:\Windows\System32 are
automatically redirected to C:\Windows\SysWOW64. This can have
undesirable effects when the path is meant to look for System32.
Windows provides `SysNative` for this reason, and it should be used if
the path is found (32bit processes on 64bit Windows). This puts the old
behavior back to how it worked prior to the changes in 0.9.10.
ferventcoder added a commit that referenced this issue Sep 14, 2016
* stable:
  (doc) update generated docs for command reference
  (doc) add source to functions
  (doc) add new line in helper reference
  (GH-935) search/info/list --version
  (doc) provide more awareness about licensed
  (GH-893) Fix: Help Warns Required Elevated Rights
  (GH-959) Fix: Licensed feed cannot be disabled
  (GH-960) Fix: 7z File System Redirection
  (GH-938) Suggest choco help on unknown command
  (doc) Synchronizer/Enhancements to Autouninstaller
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

2 participants