First impression when you start working with a new PC:
“Everything responds so fast!”Second impression:
“All my favourite software programs are missing. Here goes the installation marathon again…
I have set up a new Windows machine about 50 times in my life. Many of them in the early days (Looking at you, Windows 98!). Nowadays, mostly at work, as my company leases these things and they get exchanged quite often per person. On top of that, there are people around me who also change their equipment from time to time: friends, family, partners, the elderly neighbour and so on.
Basically, I am the IT administrator for everyone I know.
Most of the setup involves installing a bunch of basic applications which everybody needs. These include a browser like Chrome (better use Firefox!), a decent PDF reader, a text editor, a .zip program, cloud storage, and so on.
Most setups I have done the old fashioned way: Google the application, download it, click on the *.exe, then click through the installer steps.
Hundreds of times. That is more than enough for one human life span. So let’s automate it. First, we need an App Store. Second, we create a script to programmatically call the App Store to download & install all our needed software.
Why not use the Microsoft Windows 11 App Store?
- In the past, the Windows app stores where a joke. Most software you would need was not available there, like many open source projects. With the Windows 11 App Store, many smaller software projects are still not included.
- Data privacy reasons. Microsoft already knows a lot about you (as a user) and about your machine. So they don’t need to know which applications and versions you are running. Chocolatey doesn’t even need a registration.
Fortunately, with Chocolatey, there is a free package manager available. It allows you to manage applications directly from the command line (good for automation) or via a user interface (good for beginners are simpler tasks).
We can now create a Powershell script that calls Chocolatey and installs our favourite software applications.
Fast. Reliable. Repeatable. Let’s go.
Install Chocolatey
- Open PowerShell as admin (
Win
+X
and selectPowerShell (Admin)
) - Copy&Paste the following line. This will run the official install script from Chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Chocolatey will be installed. It is normal for some warnings to appear.
After the installation, check that it was successful and run: choco list
This command lists all installed applications/packages.
If you are behind a proxy, check these instructions.
Download the Chocolatey Vanilla installer script
I have created a PowerShell script that has a predefined dictionary of common applications and their basic configuration. You can use it and modify it to your liking.
The script will ask you to install either common applications or (addtionally) developer tools.
Clone the repo or download the .zip (then unzip the folder). On the page you can also see which apps are installed by default (I tried to make a reasonable pre-selection).
Optional: Change which applications to install
- Navigate to the downloaded file
choco-install-apps.ps1
, right-click and do Edit. - Enable or disable needed applications. The
#
sign comments out a line (disables it), deleting the leading#
sign enables the line. - Save and close.
Optional: Add further applications & configurations
At the beginning of the script is the big application map (dictionary). The ‘key’ is the name of the application package from Chocolatey, the ‘value’ are configuration elements, either from the Chocolatey installer script itself or from the application. You can find information about the package’s config directly on the package’s webpage. See here the Adobe Reader example.
Execute Vanilla Script
- Open PowerShell as an Administrator (
Win
+X
and selectPowerShell (Admin)
) and navigate to the downloaded folder. We need this step, since many applications on Windows still need admin rights to be installed, including Chocolatey itself. - Run the script
choco-install-apps.ps1
. If you get an error, then local scripts are disabled on your machine. To enable them, typeSet-ExecutionPolicy Bypass -Scope Process
- The script will ask you if you want to install all basics apps, or only those related for software development tasks.
- Wait for the applications to install.
- You may want to tidy up your Windows Explorer right-click menu (Windows 10)
- Done. Now you can go and get yourself a vanilla chocolate :)
Want more content like this? Consider following me :)
Do you have a question? Leave a comment.