Skip to content

Instantly share code, notes, and snippets.

@myyc
Last active April 29, 2024 13:50
Show Gist options
  • Save myyc/4b57f9a5637362d37961a10cd32b8f0b to your computer and use it in GitHub Desktop.
Save myyc/4b57f9a5637362d37961a10cd32b8f0b to your computer and use it in GitHub Desktop.
Manually install recent Windows GOG games on Arch Linux

If you're gaming on Linux you should probably use Steam. This is pathetic as GOG's initial selling point was "fuck DRM" and all that, but nowadays probably because of the Steam Deck Steam's Windows launcher on Linux is just seamless.

If you made the mistake of buying Windows games on GOG because you thought no DRM was a good idea, well, this guide is for you.

First things first, the setup

  • Recent hardware. Good CPU and recent-enough GPU (I have a Nvidia 3060 Ti).
  • A working installation of Steam, making sure that Proton works. 6.3, Experimental, whichever.
  • Make sure that you're able to run Steam games with Proton with no hardware issues
  • Make sure just in case that you're able to run native Linux games
  • yay or whichever AUR helper
  • proton-ge-custom-bin. Probably not necessary, but use this one just in case.

None of this is necessarily Arch Linux specific, so if you manage to install the packages mentioned here and there (gamehub, Proton GE, etc.) you can potentially adapt this to whichever distro you're using, with some path tweaks.

The procedure

From now on I'll assume the game you're installing is Cyberpunk 2077, but you can try with any other game you're struggling with.

Choose one path where you'll keep your games that you install this way:

$ mkdir -p ~/Games/Custom

Then you should download the setup files. Cyberpunk 2077 has loads of them so it's probably worth having Gamehub installed (yay -S gamehub) just to download the setup files

$ cd ~/Games/_Collection/GOG/Cyberpunk\ 2077

or wherever you downloaded the setup files.

$ mkdir ~/Games/Custom/Cyberpunk\ 2077

Then, this is the most important trick, and we will use it to run the game too.

$ cd /where/the/install/files/are   # e.g. ~/Games/_Collection/GOG/Cyberpunk\ 2077
$ STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/$USER/.local/share/Steam \
  STEAM_COMPAT_DATA_PATH="/home/$USER/Games/Custom/Cyberpunk 2077" \
  /usr/share/steam/compatibilitytools.d/proton-ge-custom/proton run \
  setup_cyberpunk_2077_build_3551602change_4457769_galaxydll_\(64bit\)_\(50001\).exe

Relevant facts:

  • you may need to run proton from the directory where you downloaded the install files (but maybe not, try it out)
  • obviously replace setup_... with the main .exe file in case it's a different game

This should launch the GOG setup. Accept the licence, wait for it to install and, obviously, don't launch it.

Launching the game

Find the .exe of the game, and launch it this way:

$ cd ~/Games/Custom/Cyberpunk\ 2077/pfx/drive_c/GOG\ Games/Cyberpunk\ 2077
$ PROTON_ENABLE_NVAPI=1 VKD3D_CONFIG=dxr \
  STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/$USER/.local/share/Steam \
  STEAM_COMPAT_DATA_PATH="/home/$USER/Games/Custom/Cyberpunk 2077" \
  /usr/share/steam/compatibilitytools.d/proton-ge-custom/proton run \
  bin/x64/Cyberpunk2077.exe

Note: PROTON_ENABLE_NVAPI=1 is used to enable DLSS which at the time of writing is not enabled by default.

Warning: VKD3D_CONFIG=dxr is used to enable ray tracing. Support is currently extremely limited and it might depend on installing vkd3d-proton (pretty much replacing Wine's d3d12.dll in the prefix. At the time of writing, ray tracing can be enabled this way in Cyberpunk 2077 but doesn't actually work, while Control supports it fine (be sure to launch Control_DX12.exe). This is a mess and it shouldn't involve these ridiculous steps, but considering that even on Windows the support is generally not the best, it's better than nothing!

It's important that you launch the game in the root path of the game, which in GOG's case I believe it's always C:\GOG Games\Game. In this case the .exe file is somewhere else, but sometimes it's in the root path.

This should be it!

Did it work?

If it didn't work I'm not sure how to help you but you can try commenting here.

If it did work, then make stuff pretty by creating a .desktop file. You should first figure out where the icon is, and assuming you have imagemagick installed, from the game's root:

$ convert goggame-1423049311.ico goggame-1423049311.png

Again, this is Cyberpunk 2077, but I've tested it in other games too, the ID will be different.

Create your desktop file, e.g. ~/.local/share/applications/Cyberpunk_2077.desktop

[Desktop Entry]
Encoding=UTF-8
Value=1.0
Type=Application
Name=Cyberpunk 2077
GenericName=Cyberpunk 2077
Comment=Cyberpunk 2077
Icon=/home/your_user/Games/Custom/Cyberpunk 2077/pfx/drive_c/GOG Games/Cyberpunk 2077/goggame-1423049311-6.png
Exec=env VKD3D_CONFIG=dxr PROTON_ENABLE_NVAPI=1 STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/your_user/.local/share/Steam STEAM_COMPAT_DATA_PATH="/home/your_user/Games/Custom/Cyberpunk 2077/" /usr/share/steam/compatibilitytools.d/proton-ge-custom/proton run bin/x64/Cyberpunk2077.exe
Categories=Game;
Path=/home/your_user/Games/Custom/Cyberpunk 2077/pfx/drive_c/GOG Games/Cyberpunk 2077

Replace your_user where applicable.

Then run update-desktop-database and it'll appear among your GNOME apps, with a pretty icon.

@step21
Copy link

step21 commented Jan 23, 2024

Ok, thanks. Mostly I don't want to buy it again. I read that you can also use "add non-steam game" and then first point to the setup file and then the actual file. But so far this only worked for me for for the setup, then the "play" button just becomes green again after a while and easy to parse log output. But anyway, this might also be because of the 2.0 update I write this mostly in case you are interested.

@myyc
Copy link
Author

myyc commented Jan 24, 2024

@step21 just tried. it works. use proton-GE, it's based on proton 8 and it's ideal for this sort of custom solution. also, this script does everything this gist does but automatically and also adds an icon. let me know!

@step21
Copy link

step21 commented Feb 4, 2024

Thanks. Somehow, both normal Proton and and Proton-GE don't do anything. Like, they start but with little output. If starting with debug output, there is some in steam log about unhandled query and an exception. But all very generic looking.
This is the general output. This is with proton-ge installed via asdf.

PROTON_LOG=1 STEAM_COMPAT_CLIENT_INSTALL_PATH="/home/user/.local/share/Steam" STEAM_COMPAT_DATA_PATH="/home/user/Games/Custom/Cyberpunk 2077" /home/user/.steam/root/compatibilitytools.d/GE-Proton8-27/proton run '/home/user/Games/_Collection/GOG/Cyberpunk 2077/setup_cyberpunk_2077_build_4984974change_6525662_0_(64bit)_(56123).exe'
Proton: Upgrading prefix from None to GE-Proton8-26 (/home/user/Games/Custom/Cyberpunk 2077/)
fsync: up and running.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment