choco icon indicating copy to clipboard operation
choco copied to clipboard

Chocolatey MSI based installer creates a c:\Tools directory by default

Open Geogboe opened this issue 2 years ago • 6 comments

Checklist

  • [X] I have verified this is the correct repository for opening this issue.
  • [X] I have verified no other issues exist related to my problem.
  • [X] I have verified this is not an issue for a specific package.
  • [X] I have verified this issue is not security related.
  • [X] I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When using the latest version of the Chocolatey MSI based installer, a c:\Tools directory is created by default. This happens both when installed using msiexec and through the UI.

What is Expected?

It's not a huge deal and is easy enough to work around but my expectation would be that the MSI based installer would function similar to the script based installer (https://chocolatey.org/install.ps1) and NOT set a Tools directly unless explicitly requested.

How Did You Get This To Happen?

From command prompt

PS C:\> curl.exe -LO https://github.com/chocolatey/choco/releases/download/2.2.2/chocolatey-2.2.2.0.msi
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 6092k  100 6092k    0     0  8412k      0 --:--:-- --:--:-- --:--:-- 8412k

PS C:\> ls

    Directory: C:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         5/16/2022   7:55 PM                EFI
d-----          5/7/2022   1:13 AM                PerfLogs
d-r---         7/28/2023   4:04 PM                Program Files
d-r---          5/7/2022   1:19 AM                Program Files (x86)
d-----          5/7/2022   1:17 AM                sources
d-r---         7/28/2023   4:04 PM                Users
d-----         8/21/2023  12:10 PM                Windows
-a----         8/21/2023  12:26 PM        6238208 chocolatey-2.2.2.0.msi

PS C:\> cmd /c start /wait msiexec /i C:\chocolatey-2.2.2.0.msi /qn
PS C:\> C:\ProgramData\chocolatey\choco.exe --version
2.2.2
PS C:\> ls c:\

    Directory: C:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         5/16/2022   7:55 PM                EFI
d-----          5/7/2022   1:13 AM                PerfLogs
d-r---         7/28/2023   4:04 PM                Program Files
d-r---          5/7/2022   1:19 AM                Program Files (x86)
d-----          5/7/2022   1:17 AM                sources
d-----         8/21/2023  12:26 PM                Tools
d-r---         7/28/2023   4:04 PM                Users
d-----         8/21/2023  12:10 PM                Windows
-a----         8/21/2023  12:26 PM        6238208 chocolatey-2.2.2.0.msi

This can also be replicated during an interactive install: image

System Details

  • Operating System: 10.0.22621.0
  • Windows PowerShell version: 5.1.22621.1778
  • Chocolatey CLI Version: 2.2.2
  • Chocolatey Licensed Extension version: NA
  • Chocolatey License type: NA
  • Terminal/Emulator: CMD

Installed Packages

NA - Clean system and Chocolatey is not installed yet

Output Log

NA - Clean system and Chocolatey is not installed yet

Additional Context

I've found that you can work around this during a command line based install by adding the following flags: ACCEPTLICENSE=YES ADDLOCAL=Complete REMOVE=Tools and choco appears to work correctly but I'm not sure if there are any ramifications to doing this.

I searched around to see if someone had submitted this yet and didn't find anything but apologies if this is a duplicate!

Geogboe avatar Aug 21 '23 16:08 Geogboe

Thanks for raising this. Just for context this came from this Discord conversation. But I can confirm, the folder is created.

pauby avatar Aug 23 '23 19:08 pauby

i can confirm that this is still happening

PaiSolutions avatar Oct 29 '23 05:10 PaiSolutions

I can confim this is still an issue, with 2.2.2.0, just installed via MSI and C:\Tools is created.

ReverendRhyme avatar Dec 02 '23 02:12 ReverendRhyme

We've confirmed this is an issues but it hasn't been fixed as yet. Once this is being worked on, and completed, the labels will be updated to reflect that..

pauby avatar Dec 02 '23 09:12 pauby

Also affected, Choco installed a win-acme update in `C:/tools', breaking the scheduled renewal task and resulting in my system not renewing the cert in time.

mateuszdrab avatar Mar 04 '24 19:03 mateuszdrab

Also affected, Choco installed a win-acme update in `C:/tools', breaking the scheduled renewal task and resulting in my system not renewing the cert in time.

This doesn't provide enough information. Can you elaborate on why the MSI installer creating an empty folder, is the cause of your issue?

pauby avatar Mar 05 '24 08:03 pauby

@mateuszdrab fwiw I think your issue might be caused by a change to the win-acme package itself when it switched away from using the hardcoded tools path to the one set by the $env:ChocolateyToolsLocation environment variable (by default is c:\tools) See https://github.com/TheCakeIsNaOH/chocolatey-packages/issues/28. I noticed the same thing

Geogboe avatar May 16 '24 17:05 Geogboe

:tada: This issue has been resolved in version 2.3.0 :tada:

The release is available on:

Your GitReleaseManager bot :package: :rocket:

choco-bot avatar Jun 11 '24 16:06 choco-bot