Chocolatey - the saviour is here!

"Write Once, Deploy Anywhere, with Anything, and then Simply Track & Manage" - that's the benefit of Chocolatey

Chocolatey is an answer to complaints that managing Windows software can be a frustrating or time-consuming experience. Get to know the way to simplify complex processes, save time & effort!

What is Chocolatey?

 

Chocolatey is a package manager for Windows. Similar to the ones in Linux. Its sole design is to make installing applications you like on a new OS as easy as it gets – with a single command line.

I looked up that tool because I was in that situation. I was switching to a new PC, but I forgot all of the applications I use. Plus I don’t like installing everything application by application. So that tool saves me a lot of time, and I hope it will save yours too.

 

Why choose Chocolatey instead of Scoop, WinGet?

 

Well, I wanted to cover Scoop, but unfortunately, it seems to be abandoned.

Plus Scoop has one more problem – it allows you to export installed apps to a list, but not to import them.

Ok, so why not WinGet? WinGet is a tool from Microsoft that only installs applications with .msi, .misix, and some .exe.

I think it will be a great tool, but for now, it is only available to users who are on Insider Ring updates for Windows and are registered in the Preview Flight program for the app itself.

And I wanted to cover something that can be usable right now, with as few steps as possible.

 

How does it work

 

Chocolatey allows us to install apps from Powershell without going through a lengthy clicking installation process and even installing multiple apps at once.

So normally you open your Powershell and type in, for instance, something like this:

 

choco instal vlc

 

And then you should be seeing the installation process in your terminal:

And that’s just for one app.

The key goal here is to use a single line of command and install everything you need so that you can focus on more important things for yourself.

 

Installation of Chocolatey

 

Before we begin, make sure you meet minimum requirements:

  • Windows 7+ / Windows Server 2003+
  • PowerShell v2+ (minimum is v3 for install from this website due to TLS 1.2 requirement)
  • .NET Framework 4.5+

Now, you will need to work in Administrator rights and will have to run a script to install Chocolatey. That means we need to change your Powershell Policy Execution. Preferably just type this in to allow only those scripts that are Digitally signed:

 

Set-ExecutionPolicy AllSigned

 

Now, make sure that the script from here, where it says “Now run the following command”.

Why am I not copying this script? For your safety and so you will always install from the source. Better to be safe than sorry.

Once you run this you are good to go, just restart the shell.

 

Installing Multiple Apps

 

Want to install some applications, you know which ones, but you are not sure how are they named in Chocolatey?

You can use two methods.

 

First Method – Graphical

 

Go to https://community.chocolatey.org/packages and search the application you like.

You should have some results that look like this:

Now, see that red underline inside the green box? That’s the key for the application that you will use to install it through Chocolatey.

 

Second Method – Command Line

 

Run choco search <name of the application>, like so:

 

choco search firefox

 

Now you should have search results like this:

Choco always will try to return the first results what it thinks is the right one, so in this case, the top of the list named Firefox is your application. Don’t worry about case sensitivity, chocolatey does not mind that.

 

Installing Multiple Apps With One Command

 

Ok, I prepared some applications for this, so I’m going to install VLC Player, Firefox, Pain.NET, and Blender at the same time by using this command:

 

choco install vlc firefox paint.net blender

 

You will see some graphical popups, but you will not be prompted to click anything.

Once the installation is done, you are all set. You will have all shortcuts placed on the desktop and the menu start as usual.

 

Export Installed Apps to a Single File

 

Ok, now to get packages.config file which tells what applications you have installed you will need to run the command below.

Be warned, that by default it will create a file right where you are in that folder, so for instance, if you are currently in C:\\Users it will create a file in that location (C:\\Users\\packages.config)

 

choco export

 

If you would like to tell Chocolatey where to export that file you can use -o flag, like this:

 

choco export -o "'c:\packages.config'"

 

Now where you will have that file is up to you, git repository, USB Pendrive, cloud, as long as you have saved it yourself and keep it updated via choco export you are good to go.

 

Importing Apps From a Single File

 

Now, we come to the best part.

Once you have that file we exported, called packages.config you can now import it, and Chocolatey will install it on its own!

Just run choco install <packages.config location>, like so:

 

choco install packages.config

 

or if your file is somewhere else, for instance on Desktop:

 

choco install C:\Users\k.wisznarewski\Desktop\packages.config

 

Upgrading All Apps From Chocolatey

 

Just type in:

 

choco upgrade all

 

That’s it!

Now you have everything you need to Chocolatey!

 

External Links

 

 

Chocolatey main page: https://chocolatey.org

Chocolatey Packages (or Applications) Search: https://community.chocolatey.org/packages

Chocolatey official documentation: https://docs.chocolatey.org/en-us/choco/

Official documentation: https://github.com/lukesampson/scoop/wiki

Source of “Write Once, Deploy Anywhere, with Anything, and then Simply Track & Manage” – https://chocolatey.org

Krzysztof Wisznarewski

Published:10/26/2021

Tags:

Insights Show all articles

Custom software solutions for logistics

Read more

Process efficiency

Read more

On-premise vs cloud

Read more

Chocolatey – the saviour is here!

Read more

4 steps to choose BI tool

Read more

Basics of CSS 3D

Read more

Do I need Business Intelligence?

Read more

MS Dynamics 365 vs SAP S4\HANA

Read more

Agile Teams

Read more

How to improve the defect management process?

Read more

10 hints for keeping your project well documented

Read more

The IT Revolution is upon us!

Read more