Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Windows » Create Chocolatey Package: Upgrade Software with Chocolatey
  • 517443 637084112713220326 16x9 1
    How can I tell if a password is set for a user account on Linux Linux
  • File Share in Windows
    Create Folders and Enable File sharing on Windows Windows Server
  • Windows Productivity Tips
    Windows Productivity Tips To Get The Most Out Of Your PC Windows
  • PNG JPGconversion 2
    How to change the default screen capture format in macOS Mac
  • MSDTworkaround
    Microsoft Support Diagnostic Tool Vulnerability Fix Windows
  • BitLocker renamedevicefghjkl
    What are the effect of renaming an MBAM-Protected Computer Windows
  • bannerr
    How to Disable Driver Signature Enforcement in Windows 11 Windows
  • Copilot Microsoft
    How to Disable Copilot in Windows and Microsoft Edge Windows

Create Chocolatey Package: Upgrade Software with Chocolatey

Posted on 25/10/202216/12/2023 Imoh Etuk By Imoh Etuk No Comments on Create Chocolatey Package: Upgrade Software with Chocolatey
Chocolatey-Packages

Learn how to create Chocolatey Package: Upgrade Software with Chocolatey in this blog post. IT professionals must look at better ways to carry out mundane tasks as automation becomes more of a need than a nicety; one such duty is software installation. It would be better for you to come up with an alternative method than to download an MSI, double-click on it, and go through the process. Please see Windows Package Manager: How to install Winget CLI, and How to upgrade PowerShell to the latest version on macOS via Homebrew.

Chocolatey is a Windows-based machine package manager that is similar to Apt and RPM. With Chocolatey, all you have to do to install a Windows application is run a single line of code; Chocolatey will then download and install the application for you.

Although there is an official manual for creating and publishing a package, this instruction is more straightforward. As a command-line package manager and installer for Windows software, Chocolatey operates at the machine level.

To make downloading and installing software easier, it takes advantage of Windows PowerShell and the NuGet packaging architecture. Microsoft released PowerShell 5 and OneGet (later renamed to PackageManagement) in April 2014.

What is Chocolatey?

Chocolatey is a free open-source package manager for Windows. On your servers or desktops, it can help you install, manage, and upgrade software. Sometimes finding the MSI or EXE file required to install the software and then going through the installation procedures all by yourself might make life harder for you as a System Administrator.

This is the burden Chocolatey helps to relieve from you as it can help make life easier by finding the MSI or EXE file needed to install software and then walking through those installation wizards.

Chocolatey is an open-source tool, that’s open to anyone to contribute to and help evolve. It is also free at the point of use, but there are paid versions for those who may need some premium features or are using the product in their business environment.

Creating Chocolatey Packages

First thing first, to create a package Chocolatey must be installed since it is not installed by default on Windows. So I am going to jump straight to taking through the process of installing Chocolatey, adding it to a path, and creating your first package.

You can learn more about Chocolatey in the following related posts: Windows Package Manager: How to install applications using Chocolatey?, Windows Package Manager: How to install, upgrade or uninstall Chocolatey,

Chocolatey Installation

You can install Chocolatey by either running a PowerShell script or using Chef, Ansible, or Puppet. For most users installing using a PowerShell script will be the quickest way of starting with Chocolatey.

Here, I am going to run the installation with PowerShell Script. To download and install Chocolatey, run the below command in a PowerShell console:

PS> iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Choco-Installation
Chololatey Installation

Chocolatey has been installed and automatically added to the system path.

If we call choco anywhere within the Window, it will display the version and helpful tips. Let’s call it up using Windows Command Prompt Console:

Confirm-choco-installation
Chocolatey Installed

Now life is easier as you can simply execute the command choco followed by the name of the application of software you will like to install right from the command-line interface and Chocolatey will do the installation for you.

We will come to this later in the post but for now, let’s see how to create a Chocolatey package.

Create a Package

Step 1 – Create a directory with a name unique to your purpose.

To do this, follow the steps below. Here, I am creating a directory named mytestapp-package and open it with your code editor, Visual Studio Code precisely and type the below codes:

Note: To create a Chocolatey package, you must first create an NUSPEC file. An NUSPEC file is an XML package manifest that describes the package contents. This NUSPEC file must be in a particular format.

 <?xml version="1.0"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <metadata>
    <id>TestApp</id>
    <title>TestApp</title>
    <version>0.1.0.20120702</version>
    <authors>Imoh</authors>
    <owners>Imoh</owners>
    <summary>This is an example App</summary>
    <description>Your descriptions here</description>
    <projectUrl>http://www.testapp.com</projectUrl>
    <tags>some tags here</tags>
    <licenseUrl>http://www.testapp.com/license.txt</licenseUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance> <!-- or true if you require the user to accept the License before installing -->
    <iconUrl>http://www.testapp.com/logo.png</iconUrl>
  </metadata>
</package>

Replace the content above with the information of your app and save the file as shown in the screenshot below:

TestApp-code
Chocolatey Packages

Create Chocolatey Package

Now let’s create the package. To do this, navigate to the directory where you have the package file saved. My directory is mytestapp-package and then run the below command where testapp.nuspec is the name of my package file:

$ choco pack testapp.nuspec
Chocolatey-Pacjage-created
Chocolatey Package created

Now run cpack or chocolatey pack on the command line within the same directory to get the details of the package your have just created.

Package-Details
Package details

The above screenshot shows the package.  TestApp.0.1.0.20120702.nupkg in the current working directory. So, this is the package and that’s all you.

Test the package by running:

cinst TestApp -source %cd%
Testing-the-APP
Package tested

Installing and Upgrading Software Using Chocolatey

Let’s install a Notepad++ text editor using Chocolatey Package. To do so, run and press the Enter key:

$ choco install notepadplusplus
Install-Notepad-Plus-plus-with-choco
Notepad ++ Installation using Chocolatey

Notepad++ is completely installed. We can confirm this by searching for Notepad++ using the Windows Search bar.

NotePad-Editor-Installed
Search for Notepad++

Launch the Program and start using it

Launch-Notepad
Notepad++ Workspace

Upgrading Software using Chocolatey Package

We can easily upgrade all software at once or upgrade them individually. Here, I am upgrading the Azure CLI package installed on my system.

To do so, run:

choco upgrade Azure-cli
Upgrading-Azure-CLI-USing-Choco
Upgrade Azure CLI

Chocolatey Package can be so helpful in taking much of the burden of managing software and application packages on Windows through a single line of the automation process.

I hope you found this guide useful on how to create Chocolatey Package: Upgrade Software with Chocolatey. Please feel free to leave a comment below.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Scripts, Windows Tags:PowerShell

Post navigation

Previous Post: How to setup a Third-Party DNS Server on a Linux Server
Next Post: How to Fix Fatal Git Error Refusing to Merge Unrelated Histories

Related Posts

  • disable automatic updates in Windows
    How to disable automatic Windows updates via Windows Settings Windows
  • image 23
    Copy Deployment Share between Servers without using linked Deployment Shares Windows
  • Featured image   Dark mode
    How to enable dark theme in Windows 11 Windows
  • nodee
    How to install Cypress on Windows and perform Automation Windows
  • windows 10 keyboard shortcut 1024x512 1
    How to create a Desktop shortcut in Windows Windows
  • Remote Desktop Connection
    Connect to the Remote Desktop Console from Command Prompt Windows

More Related Articles

disable automatic updates in Windows How to disable automatic Windows updates via Windows Settings Windows
image 23 Copy Deployment Share between Servers without using linked Deployment Shares Windows
Featured image   Dark mode How to enable dark theme in Windows 11 Windows
nodee How to install Cypress on Windows and perform Automation Windows
windows 10 keyboard shortcut 1024x512 1 How to create a Desktop shortcut in Windows Windows
Remote Desktop Connection Connect to the Remote Desktop Console from Command Prompt Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • 517443 637084112713220326 16x9 1
    How can I tell if a password is set for a user account on Linux Linux
  • File Share in Windows
    Create Folders and Enable File sharing on Windows Windows Server
  • Windows Productivity Tips
    Windows Productivity Tips To Get The Most Out Of Your PC Windows
  • PNG JPGconversion 2
    How to change the default screen capture format in macOS Mac
  • MSDTworkaround
    Microsoft Support Diagnostic Tool Vulnerability Fix Windows
  • BitLocker renamedevicefghjkl
    What are the effect of renaming an MBAM-Protected Computer Windows
  • bannerr
    How to Disable Driver Signature Enforcement in Windows 11 Windows
  • Copilot Microsoft
    How to Disable Copilot in Windows and Microsoft Edge Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.