Automating Software Installations with Boxstarter and Chocolatey

Tobias Zimmergren
Tobias Zimmergren

If there's something I really dislike in my software development routines, it's installing the actual software I use to develop. You know what I mean - you don't want to install Visual Studio and wait for that only to realize that as soon as it's done you have to launch the next thing and wait for it.

During the last few years I've actually used PowerShell to automate much of my installation processes, but as new releases of software comes out I've had to update them accordingly and test them.

I now use Chocolatey and Boxstarter in these scenarios:

  • Re-installing my Surface Pro 4
  • Setting up a new Virtual Machine in Azure
  • Configuring any dev-machine I'm going to use

Meet my friend Chocolatey

Well, it's not really a new tool nor a new friend. We've known each other for a while, but I haven't really utilized the opportunity as well as I would have liked to in the past.

What is chocolatey, you ask?

Short and sweet, it's a type of package installer for software packages. Think NuGet, but for software on your environment rather than assemblies in your code.

As per their website, where they put it well:

Chocolatey NuGet is a Machine Package Manager, somewhat like apt-get, but built with Windows in mind!

The stats are pretty good and the amount of packages is pretty impressive.

What types of packages would I want to automate with Chocolatey?

Wow, I have a long list of packages I always enjoy installing. Of course they differ depending on whether it's a dedicated dev machine or my main working machine. Here's some of the top favorites I'd recommend checking out.

Developer related:

General packages:

As you can imagine it's pretty convenient to have installations taken care of by a package manager for the machine. What's even better, is that there's another good friend called Boxstarter which we'll check out now - this is something that ties the magic together and automates a lot of this for me.

Meet my other friend, Boxstarter

The Boxstarter tools allow you to easily run setup of these packages automatically on your windows environment. Consider that you've just re-installed your machine and have the dire work of re-downloading and installing each and every one of the applications you're using.

With Boxstarter, you can do this - and you'll simply point to the packages you want to install, and you'll get the latest version of those applications.

NOTE: You'll need to verify that the Chocolatey packages are actually kept up to date as well. Some packages seem to have been dropped out of the update loop, and as such may not contain the latest version.

Quote from Boxstarter.org

Repeatable, reboot resilient windows environment installations made easy using Chocolatey packages. When its time to repave either bare metal or virtualized instances, locally or on a remote machine, Boxstarter can automate both trivial and highly complex installations. Compatible with all Windows versions from Windows 7/2008 R2 forward.
Download v2.6.25

Launch from a Url

One of my favorite features is to quickly and without the need to first download and install anything, run Boxstarter from a url. This is done using the Boxstarter WebLauncher

As explained on their website all you need is to do is to launch IE, navigate to the following URL and append the packages you want to install:

http://boxstarter.org/package/Git,cmder,curl

Upon launching this Url with a few packages, you'll install the WebLaunch for Boxstarter and you're on your way!

After that's done, it'll run whatever package installation you've selected. Should you want to, you can enter your machine password so Boxstarter can reboot your machine while setting things up and continue processing when a reboot has occured.

I love automation.

PowerShell Remoting allows for Remote launch

If you're using this as part of a CI process or in other ways prefer PowerShell, then you'll be happy to know that the Boxstarter tools also allows for PowerShell Remoting.

Read more about that here.

Summary

With that said I would like to wish you happy automation!
I'm currently using Boxstarter and Chocolatey to set up my Surface Pro 4 and I'm using it to configure my development environments.

The packages I deploy in each environment differ a bit, and the list I mentioned above are a few of the packages I'm deploying to give you an idea of what it has to offer.

See you on the other side.

Cheers / Tobias Zimmergren.

AutomationChocolatey

Tobias Zimmergren Twitter

Hi, I'm Tobias! 👋 I write about Microsoft Azure, security, cybersecurity, compliance, cloud architecture, Microsoft 365, and general tech!

Reactions and mentions


Hi, I'm Tobias 👋

Tobias Zimmergren profile picture

Find out more about me.

Recent comments

Mastodon