Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent creation of Tools folder via the MSI installer #3307

Closed
5 tasks done
Geogboe opened this issue Aug 21, 2023 · 8 comments
Closed
5 tasks done

Prevent creation of Tools folder via the MSI installer #3307

Geogboe opened this issue Aug 21, 2023 · 8 comments

Comments

@Geogboe
Copy link

Geogboe commented Aug 21, 2023

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • 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!

@pauby
Copy link
Member

pauby commented Aug 23, 2023

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

@PaiSolutions
Copy link

i can confirm that this is still happening

@ReverendRhyme
Copy link

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

@pauby
Copy link
Member

pauby commented Dec 2, 2023

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..

@mateuszdrab
Copy link

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.

@pauby
Copy link
Member

pauby commented Mar 5, 2024

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?

@Geogboe
Copy link
Author

Geogboe commented May 16, 2024

@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 TheCakeIsNaOH/chocolatey-packages#28. I noticed the same thing

corbob added a commit to corbob/choco that referenced this issue Jun 10, 2024
The MSI was generating a C:\Tools directory, but never actually using
it. This commit removes the Tools directory from the install so it is
never created.
@gep13 gep13 modified the milestones: 2.4.0, 2.3.0 Jun 10, 2024
@gep13 gep13 changed the title Chocolatey MSI based installer creates a c:\Tools directory by default Prevent creation of Tools folder via the MSI installer Jun 11, 2024
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.3.0 🎉

The release is available on:

Your GitReleaseManager bot 📦 🚀

gep13 pushed a commit that referenced this issue Jun 12, 2024
The MSI was generating a C:\Tools directory, but never actually using
it. This commit removes the Tools directory from the install so it is
never created.
josh-cooley added a commit to josh-cooley/choco that referenced this issue Jul 8, 2024
…evelop

* 'develop' of https://github.com/josh-cooley/choco: (145 commits)
  (maint) Add CODEOWNERS files
  (build) Add templated notifications to all builds
  (build) Add verification of source scripts
  (doc) Further tweak docgen for Chocolatey.PowerShell
  (doc) Tweak docgen for Chocolatey.PowerShell
  (chocolatey#3446) Update GenerateDocs.ps1
  (chocolatey#3307) Do not create Tools directory from MSI
  (maint) Do not create Chocolatey directory in MSI
  (chocolatey#310) Fix path to chocolatey.lib files
  (maint) Corrected casing of file
  (chocolatey#23) Move call to SetRemotePackageNamesIfAllSpecified
  (chocolatey#1901) Revert commit to display location
  (maint) Update Authenticode Signature
  (tests) Some minor tweaks for test consistency
  (chocolatey#310) Set-EnvironmentVariable: delete values properly
  (tests) Remove v2 import tests
  (chocolatey#310) Fix test issues
  (chocolatey#310) Fixup v2 compatibility
  (tests) Working on tests during pairing session
  (chocolatey#2050) Add Pester test for --ignore-pinned option
  ...
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

7 participants