Skip to content

Latest commit

 

History

History
228 lines (161 loc) · 7.09 KB

File metadata and controls

228 lines (161 loc) · 7.09 KB

Set Up Wine for Affinity Apps Using Rum

Preface

This guide aims to provide a way to manage wine that does not make use of launchers like Lutris or Bottles.
We will instead use rum, a small shell script that will help us manage multiple wine runners.

Dependencies

Install the following programs (or the equivalent for your distro) before proceeding.

Debian-based distros:

sudo apt update && sudo apt install wget unzip git winetricks

Arch-based distros:

sudo pacman -Sy wget unzip git winetricks

Fedora-based distros:

sudo dnf install wget unzip git winetricks

Directories Setup

First, we'll create two directories in ~/.local/share/ which will help us organize our runners and prefixes without messing up our $HOME:

mkdir -p ~/.local/share/wine/runners
mkdir -p ~/.local/share/wine/prefixes

Wine Runner Download

Then we'll download a build of ElementalWarrior's wine fork and unzip it.

Note

You can check Twig6943's GitHub releases page for newer builds of ElementalWarrior's wine fork.

pushd ~/.local/share/wine/runners &&
wget https://github.com/Twig6943/wine/releases/download/9.13/ElementalWarriorWine-x86_64.tar.gz &&
tar xvzf ElementalWarriorWine-x86_64.tar.gz &&
rm ElementalWarriorWine-x86_64.tar.gz &&
popd

rum Setup

Download rum into /opt

cd /opt/
sudo git clone https://gitlab.com/xkero/rum.git

Let the current user you're logged in as take ownership of the folder.

sudo chown -R $USER:$USER rum/

Create a symlink in /usr/local/bin/

sudo ln -sf /opt/rum/rum /usr/local/bin/rum

We also need to make a small change in rum to adapt it the custom runners path we previously set up:

nano /opt/rum/rum

Change the wines variable to:

wines="$HOME/.local/share/wine/runners"

Now let's test if it's setup correctly. Just run rum without arguments and check if it prints the following:

Not enough arguments!
Usage: rum <wine-version or /path/to/wine/version> </path/to/wine/prefix> <wine command> [wine arguments...]

Wine versions available:
ElementalWarriorWine-x86_64

Notice how rum correctly found our ElementalWarriorWine.

Alias Setup

We'll register an alias so that we don't need to always give rum the full path to the affinity wine prefix.
Open either your .bashrc or dedicated .bash_aliases file, and add the following alias:

alias wine-ew-affinity='rum ElementalWarriorWine-x86_64 $HOME/.local/share/wine/prefixes/affinity/'

I gave mine a pretty verbose name, but feel free to name it how you like.
Also remember to source the file you just modified for the changes to take effect, e.g:

source ~/.bash_aliases

Verify once again that your alias is setup correctly by calling it without arguments and checking that you see the same error as before.

If you're using Fish as your default shell, you might have to manage your aliases and environment variables in Fish's configuration files instead of .bashrc. For the alias you added, you can define it in Fish by editing nano ~/.config/fish/config.fish (create it if it doesn't exist) and adding:

alias wine-ew-affinity='rum ElementalWarriorWine-x86_64 $HOME/.local/share/wine/prefixes/affinity/

Wine Prefix Configuration

Initialization

We're now ready to actually set up the wine environment to run our Affinity installer in.

First, initialize the prefix:

wine-ew-affinity wineboot --init

Winetricks

Important

We use the remove_mono verb becase the .NET version we're installing would directly conflict with it, as stated in the Wine Mono README

Now run winetricks with the following options to install all the needed dependencies in your Affinity prefix:

wine-ew-affinity winetricks --unattended --force remove_mono vcrun2022 dotnet48  corefonts win11

Note

We set the renderer to vulkan in a separate step, after all the previews winetricks have been applied.

wine-ew-affinity winetricks renderer=vulkan

Note

This step will take a while and throw a bunch of warnings. This is expected so be patient and let it run.

Getting WinMetadata

We'll now download some Windows system files and place them in the C drive of our prefix:

pushd ~/.local/share/wine/prefixes/affinity/drive_c/windows/system32/ &&
wget https://archive.org/download/win-metadata/WinMetadata.zip &&
unzip WinMetadata.zip &&
rm WinMetadata.zip &&
popd

Installing Affinity Software

We're finally ready to actually run the installer.

I'll use the installer for Affinity Photo V1 as an example.

wine-ew-affinity wine ~/Downloads/affinity-photo-1.10.6.exe

installer

Click Install, and ignore all the warnings wine throws.
Once it completes, close the installer.

Finally, launch the software!

wine-ew-affinity wine ~/.local/share/wine/prefixes/test/drive_c/Program\ Files/Affinity/Photo/Photo.exe

Affinity on Linux Rules

Additional Tips & Tricks

Fixing Scaling on HiDPI Screens

To adjust the scaling on high resolution monitors, run:

wine-ew-affinity winecfg
  • Go on the Graphics tab
  • Temporarily enable Emulate a virtual desktop
  • Adjust the Desktop size
  • Disable Emulate a virtual desktop
  • Increase the dpi to your preference

Note

As I understand it, the dpi value is a percentage applied to the currently set Desktop Size.
So, for a 4k monitor, setting the desktop size to 1920 x 1080 and scaling it by 200% works quite well.

DPI Fix

Creating a .desktop launcher

Create a .desktop launcher by following this Desktop Launcher Guide so you can open affinity from your desktop.

Credits

Thanks to: