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.
When starting Chocolatey GUI, it is possible to be met with the following error message:
This problem is reproducible on any machine by:
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
ChocolateyInstallenvironment variable. When this doesn't exist, or contains nothing, the directory for the currently executing assembly is returned. When running Chocolatey GUI, this location isC:\Program Files (x86)\Chocolatey GUIas 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.