chocolatey-community / chocolatey-azuredevops

Chocolatey Extension for Azure DevOps
MIT License
21 stars 11 forks source link

Azure pipelines: Installation of Chocolatey to default folder requires Administrative permissions. Please run from elevated prompt. #68

Open ericnewton76 opened 1 year ago

ericnewton76 commented 1 year ago

Just started happening since Thursday 2022-Nov-03. Used to work prior. Looks like the task will need to be updated due to some kind of fundamental change on the Azure Pipelines hosted VMs

Expected Behavior

Installs Chocolately fine.

Current Behavior

Copy of the log (note this is running on Azure Pipelines hosted VM)

Starting: Use Chocolatey
==============================================================================
Task         : Chocolatey tool installer
Description  : Acquires the latest version of Chocolatey from the internet and adds it to the PATH (if not already installed). This task only works on Windows agents
Version      : 0.3.2
Author       : David Gardiner
Help         : [More Information](https://chocolatey-community.github.io/chocolatey-azuredevops/
==============================================================================
Installing Chocolatey - this may take a few minutes
Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
Getting latest version of the Chocolatey package for download.
Not using proxy.
Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/1.2.0.
Downloading https://community.chocolatey.org/api/v2/package/chocolatey/1.2.0 to C:\Windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
Not using proxy.
Extracting C:\Windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\chocolatey\chocoInstall
Installing Chocolatey on the local machine
WARNING: Setting ChocolateyInstall Environment Variable on USER and not SYSTEM variables.
  This is due to either non-administrator install OR the process you are running is not being run as an Administrator.
Creating ChocolateyInstall as an environment variable (targeting 'User') 
  Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell 
  before you can use choco.
##[error]Installation of Chocolatey to default folder requires Administrative permissions. Please run from elevated prompt. Please see https://chocolatey.org/install for details and alternatives if needing to install as a non-administrator.
Finishing: Use Chocolatey

Possible Solution

Might need to include more options on the config screen to allow for non-administrative chocolately install, plus support for non-standard chocolatey install path