Comparing WinGet and Chocolatey

A Real-World Look at Package Management Tools

Paul Broadwith

Paul Broadwith

Technical Engineering Manager at Chocolatey Software, Inc.

  • Glasgow, Scotland
  • 30 years in IT in many different sectors

MVP Logo
Chocolatey Logo
Microsoft Certified Trainer Logo
 

Agenda

  • Comparison overview.
  • What platforms are we running on?
  • Compare functionality and performance.
  • What are our integration options?
  • Community packages, submissions and checks.
  • Privacy.
  • Summary.

Comparison Overview

  • Used Windows 10 Pro 22H2 (patched to April 2023).
  • Latest WinGet (1.4.1) and Chocolatey CLI (2.0.0-beta20230426).
  • “Chocolatey” means “Chocolatey Products”
  • Comparisons made April and May 2023.

Platforms

Supported Client Operating Systems

 

Operating SystemWinGetChocolatey
Windows 11 22H2 / 22H1 (1)
Windows 10 22H2 / 22H1 (1)
Windows 10 20H2 Education & Enterprise
 

(1) Home, Pro, Education & Enteprise editions.

Supported Server Operating Systems

 

Operating SystemWinGetChocolatey
Windows Server 2022X
Windows Server 2019X
Windows Server 2016X
Windows Server 2012 R2X
Windows Server 2012X
Windows Server 2008 R2 in AzureX

Known Working Operating Systems

 

Operating SystemWinGetChocolatey
Windows 10 1709+
Windows 10 (up to 1709)X
Windows 8.1X
Windows 8X
Windows 7X
Windows Server 2008X
Windows Server 2003X

There may be other PackageManagement providers for Chocolatey but ChocolateyGet seems to be the most used and recommended by the community.

Integrations

Chocolatey PowerShell Module and DSC Resource

Gael Colas, aka gaelcolas
  • First commit in October 2017 by Gael Colas (gaelcolas).
  • Part of the Chocolatey Community GitHub Organization.
  • PowerShell module AND DSC Resources in the one project.
  • PowerShell module can be used separately.
  • Actively maintained.

History of the official Chocolatey DSC Resource

  • The first commit made by Steve Murawski in October 2014.
  • Early code was primarily from Lawrence Gripper and Eugene Bekker, with some community help.
  • Rob Reynolds started to heavily commit to it in April 2017.
  • Paul Broadwith started to maintain it in October 2018.

Managing Chocolatey - what do we need to cover?

The five fundamental areas for Chocolatey:

  • Installing Chocolatey CLI.
  • Packages.
  • Sources.
  • Features.
  • Config.

Lets Look At cChoco

Installing Chocolatey CLI

cChocoInstaller InstallChoco
{
    # required!
    InstallDir = 'c:\choco'
}

All it does is install Chocolatey!

But you need to install Chocolatey before you do anything else because it’s not installed automatically.

Installing Chocolatey CLI In Your Org

Environment chocolateyDownloadUrl
{
    Name       = 'chocolateyDownloadUrl'
    Path       = $false
    Value      = 'https://your-internal-repo.com/chocolatey.1.1.0.nupkg'
    Ensure     = 'present'
}
cChocoInstaller InstallChoco
{
    InstallDir = 'c:\choco'
    DependsOn  = '[Environment]chocolateyDownloadUrl'
}

PR Submitted by timothy-mcroy-cengage.

Installing A Single Package

cChocoPackageInstaller InstallGoogleChromeWithVersion
{
    Name        = 'googlechrome'
    Ensure      = 'present'
    Version     = 101.0.4951.41
    Source      = 'https://internal-repo.com/api/v2/'
    # Also supports Params and MinimumVersion

    DependsOn   = '[cChocoInstaller]InstallChoco'
}

Installing Multiple Packages At Once

cChocoPackageInstallerSet InstallBaselinePackages
{
    Name      = 'googlechrome', 'git', 'putty'
    Ensure    = 'present'
    # Also supports Source

    DependsOn = '[cChocoInstaller]InstallChoco'
}

Manage Sources

cChocoSource AddInternalRepoSource
{
    Name      = 'my-org'
    Ensure    = 'present'
    Source    = 'https://internal-repo.com/api/v2/'
    # Also supports Priority and Credential

    DependsOn = '[cChocoInstaller]InstallChoco'
}

Cannot enable or disable a source.

Admin only, self-service or proxy bypass is not supported.

Enable or Disable Features

cChocoFeature allowGlobalConfirmation
{
    FeatureName = 'allowGlobalConfirmation'
    Ensure      = 'present'

    DependsOn   = '[cChocoInstaller]InstallChoco'
}

Changing Config

cChocoConfig UseVirusTotal
{
    ConfigName = 'virusScannerType'
    Ensure     = 'present'
    Value      = 'virustotal'

    DependsOn   = '[cChocoInstaller]InstallChoco'
}

Compare The Options

  • Installing Chocolatey CLI.
  • Packages.
  • Sources.
  • Features
  • Config.

Chocolatey CLI

ChocolateyGet‘Chocolatey’cChoco
Auto Install
Install Choco Separately❌ *
Org install❌ *

Chocolatey Packages

ChocolateyGet‘Chocolatey’cChoco
Install
Upgrade✔ *
Pin
Uninstall
List (Local)
List (Source)

Chocolatey Sources

ChocolateyGet‘Chocolatey’cChoco
Install
List
Manage✔ *✔ *

Chocolatey Features and Config

ChocolateyGet‘Chocolatey’cChoco
Manage Feature
Manage Config

Overview

  • The ChocolateyGet PackageManagement provider:
    • Native PowerShell integration.
    • Simple. Easy to use.
    • Mature - been around since 2016.
    • The PowerShell PackageManagement provider has limitations.
  • The ‘Chocolatey’ Chocolatey Community module:
    • Current version is a 0.2.0-preview002 release.
    • Feel more mature than its age suggests.
    • Written by Gael Colas.
    • Can be used as a PowerShell module or as a DSC resource.
  • The Chocolatey Official cChoco DSC Resource
    • The official DSC resource.
    • Been around for a long time and is mature.
    • Hasn’t had a lot of love for some time.
    • Is missing the pin feature.

Summary

  • We know what options to manage Chocolatey with DSC.
  • We know what the cChoco code looks like.
  • We know what features are offered with the providers, modules and DSC resources.
  • And we hopefully now have a better informed decision about what we should use.

Resources

Resources

blog.pauby.com
Paul Broadwith
@pauby
github.com/pauby
pau.by/linkedin

pau.by/talks