Chocolatey

Making installing software easy as pie

  • Over 15 years of programming experience
     
  • Slides:  http://slides.com/digitaldrummerj
     
  • Twitter: @digitaldrummerj
     
  • Email: digitaldrummerj @ gmail.com
     
  • GitHub: https://github.com/digitaldrummerj

Justin James

  • Multiple clicks to get anywhere

  • Deja Vu - sense of installing same software on multiple machines

  • Aarg! should have downloaded 32 bit version

  • Don't install it on a directory with a space in the name

  • etc

  • etc

  • etc

Installing Software 

  • Figures out 32 bit vs 64 bit

  • Knows where to download from

  • Runs the installer silently

  • Built on top of Nuget ecosystem

Hello Chocolatey

  • Visual Studio Package Manager

  • Easy way to package code, configs, and distribute them

  • Handles:

    • Packaging

    • Dependency Management

    • Versioning

    • Hosting

Nuget?? What??

  • Any Chocolatey Feed

  • Public Gallery 

  • Web Platforms Installer

  • Windows Features

  • Windows Updates

  • Ruby Gems

  • Cygwin

  • Python

Get Software

  • Chocolatey.org

Get Chocolatey

Get Chocolatey

@powershell -NoProfile -ExecutionPolicy unrestricted 
-Command "iex 
((new-object net.webclient).DownloadString(
    'https://chocolatey.org/install.ps1'))" 
&& SET PATH=%PATH%;%systemdrive%\chocolatey\bin

Get Chocolatey

iex ((new-object net.webclient).DownloadString
    (
        'https://chocolatey.org/install.ps1'
    ))
  • cinst [package name]

  • choco install [package name]
     

  • Example: 

    • cinst notepadplusplus

Installing Application

  • cinst [package name]
          -source WindowsFeature

  • choco install [package name]
           -source WindowsFeature
     

  • Example:

    • cinst TelnetClient -source WindowsFeature

Installing Win Feature

  • clist -source WindowsFeature

Discover Win Feature

  • From the command line:

    • cinst [package name]
             -source webpi

    • choco install [package name] 
              -source webpi
       

  • Example

    • cinst IISExpress -source webpi

Web Platform Source

  • clist -source webpi

Discover WebPi 

  • From the command line:

    • cinst [package name] -source ruby

    • cinst [package name] -source cygwin

    • cinst [package name] -source python

Other Sources

  • Run ChocolateyInstall.ps1

    • Can download installers / zip files

    • Can set environment variables

    • Can add items to taskbar

    • Can add items to desktop

    • Basically anything powershell can do

Install Means?

  • Update single package

    • cup [package name]
       

  • Update All packages

    • cup all

Install Updates

  • From Command Line:

    • cunist [package name]

    • chocolatey uninstall [package name]
       

  • Unfortunately, many packages don't include uninstall

Get Rid of Package?

  • Use BoxStarter package

    • Create package on the fly from gist or text file

    • Provides reboot needed detection

    • Set options for taskbar, remote desktop, explorer

    • Turn On/Off Windows Updates

Bulk Install

  • Install Chocolatey

  • Install single package

  • Bulk Install Packages

Demo Time

Creating Packages

  • [package name].nuspec

  • ChocolateyInstall.ps1

  • ChocolateyUninstall.ps1

Included in Package?

  • choco new [package name]
     

  • creates:

    • [package name] Directory

    • [package name].nuspec

    • chocolateyInstall.ps1

    • chocolateyUninstall.ps1

Basic Steps

  • MSI/EXE Download & Run

  • Zip File Download & Run

  • Pin to Taskbar

  • Set Environment Variable

  • Explorer Context Menu Item

  • Add Desktop Link

  • Run Powershell Command

  • Run as Admin

Built-In Helpers

Hosting Your

Own Feed

  • Any Directory on your computer 

  • Any File Share on the network

Directory Based Feed

  • Hosted in IIS

  • cinst chocolatey.server

Hosted Feed

  • choco source 

    • list

    • add / remove

    • enable / disable

Source List

  • Create New Package

  • Create our own feed

  • Modifying Sources

Demo

Web Site: 

chocolatey.org
 

Must Have Package:

boxstarter.org
 

Forum: 

groups.google.com/group/chocolatey

More Information

Questions?

Chocolatey - The right way to install Windows software

By Justin James

Chocolatey - The right way to install Windows software

Learn why you should be using Chocolatey to install software onto a Windows machine. We will go through installing Chocolatey, creating our own packages, and finally hosting our packages.

  • 7,235