How to Play Age of Empires III on Linux (Invalid CD Key Error)


Update: This article is for the 2007 version of the game. Age of Empires III: Definitive Edition works much better with Proton and is now the recommended version on Steam.

Gaming on Linux is getting easier than ever thanks to huge efforts from the community, but there are still some hurdles left before you can play some of your favorite games.

As I tried to play Age of Empires III (2007) on Steam, I was greeted with the following Invalid CD Key error:

PID Generator DLL

Error loading the PID Generator DLL. The DLL could not be found!

Please make sure the file is available in the installation directory and try again,

The problem is known and there are already some instructions out there, but I could not find all the required steps in a single place. This tutorial uses Pop!_OS, but should work on any Ubuntu / Debian based distros (e.g. Linux Mint), and can be adapted to other distros using your preferred package manager. Here are the steps:

  • Install Steam (either from the Pop!_shop, Software Center or apt)
  • Log in
  • In the Steam settings, enable Proton for non-supported games (use the latest stable version)

Proton Settings

  • Install the game, run it once, then exit when you get to the CD key input

Input form for the game CD Key

  • Install winetricks if you don’t already have it (you can also find it in apt)
cd "${HOME}/Downloads"
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
sudo mv winetricks /usr/bin/winetricks
export WINETRICKS=/usr/bin/winetricks
sudo apt install python3-pip python3-setuptools python3-venv
python3 -m pip install --user pipx
~/.local/bin/pipx ensurepath
pipx install protontricks

# Maintain your version of protontricks up to date using

pipx upgrade protontricks
sudo apt install cabextract
  • Finally, install the required libraries and fonts using protontricks (105450 is the ID of the game in Steam)
protontricks 105450 mfc42 winxp l3codecx corefonts

That’s it! You should be able to (painstakingly) input your CD key and play the game. Make sure to set the game’s resolution properly, because the UI is pretty buggy otherwise. Now go settle the New World for the Queen or something.

Looking good for a game from 2005

Feel free to comment below if you are still experiencing issues playing the game.

Thanks to JT for the updated protontricks instructions, as the original project is no longer maintained.