Chocolatey Install Windows

Jun 15, 2017  The developers have included a new PowerShell module PackageManagement in Windows 10. PackageManagement (earlier called OneGet) allows to install, manage and uninstall applications and programs from an external (or local) repository, and manage the list of connected repositories from the PoSh console.In other words, now you can install programs.

Installing apps manually in Windows can be time-consuming and has several steps, including searching for the most recent version of the app or program, downloading the installer file, signing agreements, pressing Next to get to a subsequent step, and manually unchecking ads, toolbars or bundles you don’t want. Some even require users to close all other running apps during installation.

In this article, we will show you how to use a Windows package manager to install apps and programs using the command prompt.

Chocolatey Package Manager

Windows package managers are a collection of tools that enable users to automate the installation, configuration, and updating of apps and programs.

Chocolatey is a secure and simple Windows package manager. Using a few bits of code, you can install apps and programs as well as manage and track updates.

It is free and open-source for personal and business use. For users who need advanced functionality, Chocolatey offers premium upgrades.

Install Chocolatey

  • From the Windows Start menu, search for Command Prompt and click Run as administrator.
  • The command prompt will pop up in a window like the image below.
  • Type the following code into the command prompt and hit Enter.

During the installation process, you will see a lot of text scrolling by in the command window.

Install Apps Using the Chocolatey Windows Package Manager

To install apps, start by opening a text document on your desktop to make a list of the apps you want to install. Next, from a web browser, navigate to Chocolately’s app directory, the Community Maintained Packages.

For each app you want to install, type the following command on your text file:

choco install [name of package] -fy

For [name of package] use the name as it appears in the app directory. For example, if you want to install Mozilla Firefox, use the following code:

choco install firefox

The -fy part of the command is a designation that tells Chocolatey to choose yes when any prompt pops up during installation. This helps to automate the process and make it as simple as possible.

Every app you want to install should be on a separate line on your text file. Each line should be the same except for the name of the app.

After listing all the apps you want to include, you can use a single line to install them all at the same time using the following code for the example above:

Save your text tile and close it. It should have a .txt extension. If it doesn’t, you will need to enable File name extensions from File Explorer by following the steps below:

Enable File Extensions

  • Open File Explorer by clicking on the file icon at the bottom of your screen.
  • You can also open File Explorer by typing file explorer in the Windows search bar.
  • Click on the View tab at the top and tick off the checkbox next to File name extensions to enable it.
  • Once you can save your text file with .txt extension, rename it with a .bat extension. Right-click on your new .bat file and choose Run as Administrator.
  • This action will trigger Chocolatey to start and install all your apps. Save your .bat file for future reference or use.

Install Everything Using One Line

It is also possible to install all your apps and the Chocolatey Windows package manager at the same time with one .bat file.

  • Open the .bat file you created and add it after the Chocolatey installation command as follows:

@”%SystemRoot%System32WindowsPowerShellv1.0powershell.exe” -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command “iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1′))“ && SET “PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin”

choco install firefox -fy

choco install install firefox -fy

choco install adobereader -fy

choco install 7zip.install -fy

choco install notepadplusplus -fy

choco install skype – fy

The above command includes word wrap to make it easier to read. However, when you run the command, it should be one line as you can see below:

Save your file so you can use it again when you need it to install all your favorite apps and Chocolatey at the same time.

Use Chocolatey to install your apps and programs with the command prompt. It has a massive database of Windows packages that go through a rigorous review process.

It is an automated tool that handles the mundane and time-consuming steps of getting and installing programs and apps for you. Users simply choose what they want to install, and Chocolatey will download the latest version without needing any input from you.

Consider the situation where you want to upgrade all the programs and apps on your computer to make sure you are using the latest and most secure versions. To do this manually, you must:

  • Find the most recent version
  • Select the correct download
  • Oversee the installation process so you don’t download anything you don’t want such as toolbars that are included by default and require you to uncheck them
  • Go through this process for every program

Or, use the Chocolatey Windows package manager to open a command line, type:

choco upgrade all -y

Done.

It's 12:12 am on Monday morning and I've just accepted what feels like my 10th Microsoft EULA after fighting to re-install a fresh version of Windows 10 over my Windows Insider Program technical preview that I managed to keep running for the last 6 or so months.

I can see the light at the end of the tunnel. The end of a marathon that started when I still had some of my Sunday afternoon ahead of me. This fresh Windows 10 installation is almost complete. Until I have to actually have to start installing 3rd-party software, that is.

Finishing the Windows 10 install means two things happen in quick succession. First, tackling driver updates so my video card isn't showing me a 2001-era screen resolution. Second is installing the myriad of 3rd-party software such as browsers, text editors, media players, etc. required to be installed in order to get my PC to the point where I can actually use it.

So continues the masochistic PC OS re-install ritual I've completed so many times before and am destined to repeat ad infinitum.

Now, I'm sort of an edge-case user, though, so it's important to point out that most consumers don't actually have to deal with this but every few years (and that is being generous). I'm a web developer and computer hobbyist that goes through OS-installs quite a bit for things such as for virtual machines, a personal web server, Boot Camp on my Mac, and running technical previews alongside my stable OS builds. I'm on my fifth install for 2016 and I'm likely to complete a few more in 2017.

There has to be a simpler way.

Good news! There's a brilliant package manager for Windows called Chocolatey and it provides a means for you to automate the installation of your 3rd-party software on the Windows platform. Similar to nuget for .NET, apt-get for Linux, Gems for Ruby, or npm for NodeJS (just to name a few), Chocolatey is a free, open-source platform that manages installation and removal of software packages maintained through a community-managed central library. Chocolatey even offers a few paid tiers that include additional benefits beyond basic package management, but this post will focus on the basic functionality provided in their free tier.

What does this mean for you/me/humanity? For starters, I'm able to write this blog post while all the remaining 3rd party software installs in the background. Most importantly, we (yes, as in we, humanity) get to take advantage of the following enhancements to the PC OS-install experience:

  1. Automated scripting for installing 3rd-party software when rebuilding Windows
  2. Running list of the software you installed with your last fresh copy of Windows
  3. You get your life back.. sorta (a couple of hours, at least)

I first learned about Chocolatey from the MS Dev Show podcast in 2014 when Jason Young shared his Boxstarter + Chocolatey install script with the world. Check out his script if you want to know more about using Boxstarter to speed up your install process. For the rest of this post, however, we'll use just Chocolatey.

Let's jump in.

Choco install chrome

Getting started with Chocolatey

The rest of this post explains how to use Chocolatey for automating basic software package installation along the following primary topics:

  • Installing Chocolatey on Windows 10
  • Finding packages on chocolatey.org
  • Putting together your install script

Installing Chocolatey

Before you can install any packages with Chocolatey, you first have to install the Chocolatey .exe file and add the `choco` command to the PATH environmental variable. This can be a bit confusing for folks that aren't used to editing their PATH in Windows, so I recommend following along with the Chocolatey install documentation if you want to dig deeper.

The following command can be run in the Windows Command Prompt to install Chocolatey:

If you want to follow along, wait to execute this until the end of the post when we'll combine this portion of the install script with package install declarations so we only have to execute one file for the entire installation.

Now that Chocolatey is installed, you'll need to find packages for the software you want to install.

Finding packages on chocolatey.org

Chocolatey packages represent community-maintained distributions of software titles. In the public repository all packages can be installed free-of-charge and many are even open-source - meaning you can fork these packages and re-host your own version of them if you wanted to.

The package site is a simple search engine that looks similar to other package managers such as npm or bower:

Screenshot from https://chocolatey.org/packages.

Like many of you, one of the first pieces of software I put onto a fresh Windows install is Google Chrome.

Searching the Chocolatey package directory for 'chrome' returns 91 packages, but the one I'm looking for is the first result:

In the search results, the package name is shown in the skeoumorphic command line on the right half of the UI, with this particular package name listed plainly as `googlechrome`:

Repeat this search process for each software package you want to install and take a note of each one. While you're looking through search results a few things are important to consider:

  • Number of downloads
  • Package version (some packages might be unstable builds such as Google Chrome Canary)
  • Is this package from a reputable source?

It's important to call out that Chocolatey packages are published and maintained by the community. While I hope to think that this type of distribution platform won't be used for nefarious reasons, there isn't a foolproof way that I know of to prevent malicious packages from masquerading as the real deal.

It's worth noting here, too, that Chocolatey implemented package moderation a few years back which is a huge positive step for trust in a community-managed ecosystem. Always be aware of where your software is coming from.

Putting together your install script

Now that we have Chocolatey installed and have a list of package names in the Chocolatey library, we need to combine them together into a single .bat file (or .sh file if you have Git for Windows already installed) and then set the script into motion. To keep things simple, we'll use a .bat file as those can be run from a vanilla Windows installation.

In addition to the Chocolatey install script and install commands for individual software packages, there are a number of other commands to allow you to further customize your PCavailable via chocolatey.org.

Your script will vary depending on which commands you decide to take advantage of. If you stay with `choco install <package_name>', your final install script will look something like this:

Be sure to run your .bat file with elevated privileges or else you'll run into issues getting the packages to install correctly.

There's a shorthand syntax for the install command that is a little less verbose, although I prefer the one-package-per-line syntax to make it easy for me to add/remove packages over time:

That's it! As long as there weren't any foundational issues along the way, you should now be well along the path to automating 3rd-party software installs on your new Windows installation. You might have seen a number of informational warnings from Chocolatey during the install, too, but these can—for the most part—be disregarded. Research and troubleshoot as needed.

Here's a link to the Chocolatey install script I wrote for this post via GitHub.

z.

How do you use Chocolatey? Are there other tools you like to use for configuring fresh OS installs? Do you have any tips to share?

If so, leave a comment below!Buku biologi kelas 10.

Update 12/24/2016 - Corrected destination URL pointing to full list of Chocolatey commands.