Skip to content

Latest commit

 

History

History
294 lines (211 loc) · 9.91 KB

File metadata and controls

294 lines (211 loc) · 9.91 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 GUI 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 ElementalWarrior-x86_64 page for newer builds of ElementalWarrior's wine fork.

pushd ~/.local/share/wine/runners &&
wget https://github.com/seapear/AffinityOnLinux/releases/download/Legacy/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 tahoma 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. You need an installer of Affinity software in the EXE format, not MSIX format.

Note

For Affinity by Canva, you need to select "Enterprise (Intel/AMD)" from the "Download for Windows" drop-down menu on the official download page to download the EXE installer.

We'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/affinity/drive_c/Program\ Files/Affinity/Photo/Photo.exe

Affinity on Linux Rules

Commands to launch Affinity software

You can launch the various Affinity apps by running the following commands:

Affinity by Canva:

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

Affinity Photo V2:

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

Affinity Designer V2:

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

Affinity Publisher V2:

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

Affinity Photo V1:

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

Affinity Designer V1:

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

Affinity Publisher V1:

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

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 we 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

Dark Theme for Wine

To enable the dark theme for Wine, follow these steps:

  1. Visit the repository's wine-dark-theme.reg file page to download the .reg file by clicking the download button on the top right just like we did for the .yaml file earlier.
  2. Save the file to your Downloads folder.
  3. Launch your terminal app, then type cd Downloads to change to your Downloads folder.
  4. Run the following command:
    wine regedit wine-dark-theme.reg
  5. Press Enter. You might get a message again saying "Wine could not find a wine-mono package...". Just click Install.

If you also want to enable dark theme for the Wine prefix for Affinity, run the following command, and replace username with your local user name:

WINEPREFIX="/home/username/.local/share/wine/prefixes/affinity" wine regedit wine-dark-theme.reg

Note

When running wine regedit to install an .reg file, the WINEPREFIX environment variable only accepts an absolute path as its value, so including another environment variable in the value, such as $HOME/.local/share/wine/prefixes/affinity would not work.

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: