jahed.dev

Install Microsoft Windows.

I've found myself needing to install and re-install Windows almost every year or so. Here's how I usually do it.

Download an installation image

There are multiple ways to download a Windows installation image. These are ISO or IMG files which contain the data to install Windows.

The official way is to download from Microsoft. This requires running a Windows application which then downloads the image. Make sure to choose the option to only download the image, not to create a USB installation as we'll use a better application for that later.

Microsoft provides other ways to directly download installation images. For example, for Surface Pro devices, there are specific recovery images which have Surface Pro-specific drivers pre-installed.

To avoid any issues, always make sure the image is downloaded directly from Microsoft.

Create an installation USB

First, we'll need an empty USB flash drive with enough storage. Typically, a Windows 10 installation requires 8GB of storage but some installations may require a bit more.

The best application to write disk images to USB is Rufus. When writing with Rufus, we'll have some options to speed up the setup process. Stuff like creating a default user account, language and disabling telemetry.

Rufus is open source, but it's only available on Windows. On Linux there are plenty of alternatives, there's at least one included by the distro such as GNOME Disks. On macOS, there's Balena Etcher.

Add a descriptive text file

Once the image has been written to USB, we can add a simple text file describing the installation so that we don't need to remember in the future. This is useful if we have multiple USB drives, need a specific Windows edition or version, and so on.

Open PowerShell as an administrator and run this, where D: is our USB drive's mount point, change it as needed.

dism /Get-WimInfo /WimFile:D:\sources\install.wim /index:1 > D:\wiminfo.txt

Typically to add additional files to an installation, the installation media needs to be written in ISO mode. If the file can't be written, skip this step.

Windows To Go

Rufus can create a "Windows To Go" (WTG) drive. Instead of creating an installation USB, Rufus will install Windows directly on the chosen drive which can then boot Windows from on any computer. Make sure to use an SSD or HDD, not a typical flash drive. Flash drives are too slow to run Windows off of. Also, choose the option to hide internal drives so that Windows doesn't accidentally mess with them.

WTG is deprecated, so it might not work properly in the future. It's ideal as a test environment, especially if we're using Linux Surface on a Surface Pro. We can use it to easily update firmware and troubleshoot without having to create a dual boot setup.

Boot the installation USB

Plug-in the USB and boot the device. If the USB isn't booted to automatically, reboot the device and immediately and continuously press the BIOS key to enter the BIOS menu. This key depends on the motherboard. It can be F2, F12, F8 and so on, either look up the key in a manual or press everything and try again until it works.

Install Windows

From here on, it's pretty straight forward. Follow the installation instructions, skip and deny all the Windows junk and install. We don't need to connect to the internet at this point, it's best to do so afterwards to avoid Microsoft download a bunch of junk.

Tidy up Windows

Windows tends to come with a lot of junk. So much so that even Microsoft employees provide clean-up scripts. There are other third-party clean-up scripts, but I'll just go through Microsoft's one since it's more official.

To run these scripts, we'll need to open PowerShell as an administrator. We cannot run these scripts as .ps1 files as Microsoft requires scripts to be signed to be run as an administrator. Instead, copy and paste the content directly into the shell.

There are tons of other scripts and Registry hacks to disable and enable features. Things like disabling Bing in the Start menu and removing "3D Objects" in File Explorer.

In general, it's also best to go through all of Windows' Settings and make sure most options are disabled. Remove the junk from the taskbar. Disable Spotlight adverts on the Desktop and Lock Screen. Disable most things under "Privacy". And so on.

Connect to the Internet

Now that everything's cleaned up, we can connect to the Internet to install updates.

Activate Windows

Windows activation is typically automatic if the device was previously activated with the same Windows edition. If Windows is not activated, it'll go into "Evaluation" mode after a few hours, which shows a watermark and disables some features like personalisation.

Conclusion

That's about everything when it comes to installing Windows.

Thanks for reading.