chocolatey / chocolatey-licensed-issues

Issues for Licensed Editions of Chocolatey
19 stars 13 forks source link

Install of License Requires Subsequent Admin Chocolatey Execution #306

Open ryanrichter94 opened 2 years ago

ryanrichter94 commented 2 years ago

What You Are Seeing?

When installing a new license file, Chocolatey needs invoked as admin again in order for the config update with the new password entry for the chocolatey.licensed source to be written to the chocolatey.config file.

What is Expected?

This config change should not require an additional invoking of Chocolatey as admin to make work. This should all be handled by the same session.

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

  1. Ran choco upgrade chocolatey-license -y logged in as a non-admin user but having background service configured.
  2. Next time a chocolatey command is run by the same user an error is thrown.

System Details

Output Log

Full Log Output

~~~sh PS C:\Users\bob> choco upgrade chocolatey-license -y Chocolatey v1.1.0 Business Running in background mode Upgrading the following packages: chocolatey-license By upgrading, you accept licenses for the packages. You have chocolatey-license v2023.05.13 installed. Version 9999.04.03 is available based on your source(s). Progress: Downloading chocolatey-license 9999.04.03... 100% chocolatey-license v9999.04.03 chocolatey-license package files upgrade completed. Performing other installation steps. C:\ProgramData\chocolatey\license The license has been installed. The upgrade of chocolatey-license was successful. Software install location not explicitly set, it could be in package or default install location of installer. Chocolatey upgraded 1/1 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). PS C:\Users\bob> choco This is try 1/3. Retrying after 400 milliseconds. Error converted to warning: Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config.3872.update' is denied. This is try 2/3. Retrying after 600 milliseconds. Error converted to warning: Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config.3872.update' is denied. Maximum tries of 3 reached. Throwing error. Chocolatey v1.1.0 Business Please run 'choco -?' or 'choco -?' for help menu. ~~~

References

┆Issue is synchronized with this Gitlab issue by Unito