You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this is the correct repository for opening this issue.
I have verified no other issues exist related to my problem.
I have verified this is not an issue for a specific package.
I have verified this issue is not security related.
I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
If a Chocolatey package containing a call to Install-ChocolateyPath -PathType Machine is attempted to be installed in a non-admin context (with Chocolatey appropriately installed in a non-administrative-install location), the package install will never complete. Instead, an endless amount of PowerShell processes are spawned, in an attempt to elevate that never works due to #434.
What is Expected?
At most, a single attempt to elevate should be attempted, and there should be some kind of fallback mechanism to error out if the elevation does not produce an elevated process.
How Did You Get This To Happen?
Create a simple Chocolatey package called add-path which has the following content in its chocolateyinstall.ps1
Setup a non-administrative installation of Chocolatey. A quick and dirty way to do this is to duplicate a normal Chocolatey installation to another folder, then open a non-admin PowerShell session to that folder, and set $env:ChocolateyInstall = Get-Location before running the choco.exe from that folder directly for the following steps.
Open Task Manager
Run ./choco.exe install add-path -s path/to/folder/containing/package/from/step/1 -y
Watch rather a lot of PowerShell processes be spawned, you may want to kill the process tree before it gets out of hand.
System Details
Operating System: Win10
Windows PowerShell version: 5.1
Chocolatey CLI Version: 2.2.2
Chocolatey Licensed Extension version: 6.1.0
Chocolatey License type: Business
Terminal/Emulator: PowerShell
Installed Packages
N/a, see _how did you get this to happen_ for a package setup that will trigger the issue.
Add a guard into Start-ChocolateyProcessAsAdmin to ensure we don't
accidentally recurse in the case of calling back into helper commands
that themselves call Start-ChocolateyProcessAsAdmin.
Add a guard into Start-ChocolateyProcessAsAdmin to ensure we don't
accidentally recurse in the case of calling back into helper commands
that themselves call Start-ChocolateyProcessAsAdmin.
Checklist
What You Are Seeing?
If a Chocolatey package containing a call to
Install-ChocolateyPath -PathType Machine
is attempted to be installed in a non-admin context (with Chocolatey appropriately installed in a non-administrative-install location), the package install will never complete. Instead, an endless amount of PowerShell processes are spawned, in an attempt to elevate that never works due to #434.What is Expected?
At most, a single attempt to elevate should be attempted, and there should be some kind of fallback mechanism to error out if the elevation does not produce an elevated process.
How Did You Get This To Happen?
add-path
which has the following content in itschocolateyinstall.ps1
$env:ChocolateyInstall = Get-Location
before running thechoco.exe
from that folder directly for the following steps../choco.exe install add-path -s path/to/folder/containing/package/from/step/1 -y
System Details
Installed Packages
N/a, see _how did you get this to happen_ for a package setup that will trigger the issue.
Output Log
Additional Context
No response
The text was updated successfully, but these errors were encountered: