chocolatey-licensed-issues
chocolatey-licensed-issues copied to clipboard
Chocolatey GUI - Unable to locate config file
When starting Chocolatey GUI, it is possible to be met with the following error message:
Failed to start application. Could not find a part of the path 'C:\Program Files (x86)\Chocolatey GUI\config\chocolatey.config' More details available in application logs.
This problem is reproducible on any machine by:
- Closing Chocolatey GUI
- Open the settings page for System Environment Variables
- Deleting the ChocolateyInstall environment variable
- Starting Chocolatey GUI
The issue here is that Chocolatey GUI is requesting the installation location for Chocolatey via Chocolatey.Lib, and this is determined based on the presence of the ChocolateyInstall
environment variable. When this doesn't exist, or contains nothing, the directory for the currently executing assembly is returned. When running Chocolatey GUI, this location is C:\Program Files (x86)\Chocolatey GUI
as per the error message above.
When we have seen this happen, Chocolatey and Chocolatey GUI have been provisioned via Intune, and over an RDP connection. The suspicion is that the environment variables that Chocolatey creates as part of its installation process aren't being persisted onto the machine correctly.
As a result, the workaround is to first reboot the machine, and then Chocolatey GUI will work as expected.
I can confirm this happens when deploying the most recent version via Ansible as well..
- name: "Chocolatey"
hosts: Win_Test
tasks:
- name: Install chocolatey
win_chocolatey:
name:
- chocolatey
- chocolatey-core.extension
state: present
- name: Install chocolateygui
win_chocolatey:
name: chocolateygui
state: present
And, rebooting the host fixes the issue here as well.