chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.04k stars 890 forks source link

How to install choco without admin to local path user ? #3442

Closed chuongmep closed 1 month ago

chuongmep commented 1 month ago

Checklist

What You Are Seeing?

I want install choco without admin permistion, but I saw that is don't have any way to change the installation path of choco to user path. At the moment is programdata folder. image

What is Expected?

I want choco allow can install to special user path.

How Did You Get This To Happen?

I just try to install cho in my computer without permission.

System Details

Installed Packages

It is not package, it is coco installer.

Output Log

System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\lib-bad' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.<>c__DisplayClass63_0.<CreateDirectory>b__1()
   at chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1_0.<Retry>b__0()
   at chocolatey.infrastructure.tolerance.FaultTolerance.Retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.tolerance.FaultTolerance.Retry(Int32 numberOfTries, Action action, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.CreateDirectory(String directoryPath, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.EnsureDirectoryExists(String directoryPath, Boolean ignoreError, Boolean isSilent)
2024-05-15 13:39:55,788 10048 [WARN ] - 
Chocolatey installed 0/0 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2024-05-15 13:39:55,790 10048 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2024-05-15 13:39:55,791 10048 [ERROR] - Access to the path 'C:\ProgramData\chocolatey\lib-bad' is denied.
2024-05-15 13:39:55,796 10048 [ERROR] - More Details: System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\lib-bad' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.<>c__DisplayClass63_0.<CreateDirectory>b__1()
   at chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1_0.<Retry>b__0()
   at chocolatey.infrastructure.tolerance.FaultTolerance.Retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.tolerance.FaultTolerance.Retry(Int32 numberOfTries, Action action, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.CreateDirectory(String directoryPath, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.EnsureDirectoryExists(String directoryPath, Boolean ignoreError, Boolean isSilent)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.MovePackageToFailedPackagesLocation(PackageResult packageResult)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.HandleFailedOperation(ChocolateyConfiguration config, PackageResult packageResult, Boolean movePackageToFailureLocation, Boolean attemptRollback)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.HandlePackageResult(PackageResult packageResult, ChocolateyConfiguration config, CommandNameType commandName)
   at chocolatey.infrastructure.app.services.NugetService.Install(ChocolateyConfiguration config, Action`2 continueAction, Action`2 beforeModifyAction)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.Install(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.runners.GenericRunner.Run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action`1 parseArgs)
   at chocolatey.infrastructure.app.runners.ConsoleApplication.Run(String[] args, ChocolateyConfiguration config, Container container)
   at chocolatey.console.Program.Main(String[] args)
2024-05-15 13:39:55,796 10048 [DEBUG] - Exiting with 1

Additional Context

No response

pauby commented 1 month ago

Please follow the non-administrative install documentation which requires a different installation location.

chuongmep commented 1 month ago

Nice, thanks you mate !