chocolatey / cChoco

Community resource to manage Chocolatey
Apache License 2.0
154 stars 99 forks source link

cChocoInstaller fails to install Chocolatey, chocolatey folder already exists #152

Closed mmeade-netapp closed 3 years ago

mmeade-netapp commented 3 years ago

Describe the bug We have been using cChoco for about a year with good results. This afternoon PDT, reports of failed deployments began which were caused by a failure to install chocolatey by using the resource below:

    cChocoInstaller ChocoInstall
    {
        InstallDir = 'C:\ProgramData\chocolatey'
    }

The configuration, if ran with the verbose switch, detects that chocolatey isn't installed with the test script and the set script fails to install with the stated reason that it was already installed. See attached image.

Capture

We are using cChoco version 2.4.1.0

I was able to use the web download install script to install Chocolatey successfully, then the rest of the cChoco resource functioned as expected.

After a failed run of the Choco resource, a C:\ProgramData\chocolatey folder is created with a single PowerShell script. Attached:

install.ps1.txt

mmeade-netapp commented 3 years ago

Downloaded install.ps1 script has a function called Test-ChocolateyInstalled which returns true if chocolatey is installed or the chocolatey install folder exists and is not empty. It returns true and the installer exists. The default chocolatey folder isn’t empty because the downloaded script is placed here.

gep13 commented 3 years ago

This is a duplicate of this issue: https://github.com/chocolatey/cChoco/issues/151

I am going to close this one in favour of that one.

ferventcoder commented 3 years ago

I like this title better and it more succinctly describes the problem. However the conversation has already started with the other issue and a better explanation of the security reasons why this was changed. There is also a workaround posted over there.