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

Only update chocolatey.config if there are changes #364

Closed
steve-hawkins opened this issue Jul 24, 2015 · 5 comments
Closed

Only update chocolatey.config if there are changes #364

steve-hawkins opened this issue Jul 24, 2015 · 5 comments

Comments

@steve-hawkins
Copy link

I'm using Puppet to install and configure Chocolatey to point to our internal repositories, I noticed that Puppet was detecting drift on the C:\ProgramData\chocolatey\config\chocolatey.config file on every run.

I set the C:\ProgramData\chocolatey\config\chocolatey.config file to read-only and ran the following : -

C:\Users\...>choco -v
Error serializing type chocolatey.infrastructure.app.configuration.ConfigFileSettings:
 Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config' is denied.
Error updating 'C:\ProgramData\chocolatey\config\chocolatey.config'. Please ensure you have permissions to do so:
 Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config' is denied.
0.9.9.8

I don't see why Chocolatey needs to be updating the config file on every command execution, especially since it doesn't appear to be making any changes?

@ferventcoder
Copy link
Member

I wonder if we already have an issue related to this. We have plans to not make changes to the file unless there are differences.

@ferventcoder
Copy link
Member

Related to #355

@ferventcoder ferventcoder added this to the 0.9.9.9 milestone Jul 24, 2015
ferventcoder added a commit that referenced this issue Sep 18, 2015
Do not try to write to the config file unless something has changed.
ferventcoder added a commit that referenced this issue Sep 18, 2015
* stable:
  (GH-364) Only update the config if changed
  (resharper) line breaks at 195 characters
  (maint) formatting
@ferventcoder ferventcoder self-assigned this Sep 18, 2015
@Johnny-Bee
Copy link

+1
choco list -lo
Error serializing type chocolatey.infrastructure.app.configuration.ConfigFileSettings:
Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config' is denied.
Error updating 'C:\ProgramData\chocolatey\config\chocolatey.config'. Please ensure you have permissions to do so:
Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config' is denied.
Chocolatey v0.9.9.8

@ferventcoder
Copy link
Member

@BeezUPJohnny - as an FYI, run choco in an elevated shell to not see the message ever. :)

@Johnny-Bee
Copy link

Works ! Thanks !

@ferventcoder ferventcoder changed the title chocolatey.config updated on every command; causing subsequent system configuration issues Only update chocolatey.config if there are changes Sep 23, 2015
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

4 participants