Skip to content

[BUG] Wintypes shim for WinRT not working for V2 Applications on GameDirection runner #131

Description

@Nidrax

Does an issue for this already exist?

  • I have searched the existing issues
  • I have ensured my environment (operating system, app launcher, etc) is up to date

Operating System and Version

Arch Linux

Launcher

Lutris (Recommended)

Launcher Installation

Native (0.5.22)

Wine Version

ElementalWarrior (Recommended)

Affinity Version

2.6.5

Desktop Environment

Niri

Description

Earlier I've been using Affinity V2 installed with ElementalWarrior and it has been running fine until I tried to install the newer Affinity by Canva on that prefix, since then I constantly experienced .Net Runtime exceptions on there.

Reinstalling using the old guide always let to the same results, so I tried the newest guide and was able to install and run Affinity by Canva successfully, but now the V2 applications crash on the Splash Screen after installation on the new GameDirection runner.

Steps to reproduce

  1. Installed the Prefix using the new Guide and provided Affinity-gd.yaml (GameDirectionWine-x86_64).
  2. Confirmed the Affinity by Canva works Correctly
  3. Duplicate the Game entries in Lutris for Designer and Photo
  4. Install the applications by runing the EXE installers
  5. Copy the Wintypes_Shim.dll.so into Photo 2 and Designer 2 directories
  6. Run either Affinity Designer 2 or Affinity Photo 2

Expected behaviour

Applications should not crash

Screenshots

n/a

Logs

Started initial process 688986 from gamemoderun /home/nidrax/.local/share/lutris/runners/wine/GameDirectionWine-x86_64/bin/wine /home/nidrax/.local/bin/Affinity/drive_c/Program Files/Affinity/Photo 2/Photo.exe
Start monitoring process.
gamemodeauto: 

Unhandled Exception: System.TypeLoadException: Could not find Windows Runtime type 'Windows.Services.Store.StoreLicense'.
   at Serif.Affinity.Application.OnServicesInitialised(IServiceProvider serviceProvider)
   at Serif.Interop.Persona.Application.OnStartup(StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at Photo.Application.Main(String[] args)
Monitored process exited.
No return code


0024:trace:loaddll:build_module Loaded L"Z:\\home\\nidrax\\.local\\bin\\Affinity\\drive_c\\Program Files\\Affinity\\Photo 2\\Serif.Windows.dll" at 0000000103B80000: native
* Assertion at /builds/mono/wine-mono/wine-mono-11.1.0/mono/mono/metadata/object.c:4676, condition `is_ok (error)' not met, function:prepare_run_main, Could not set up parent class, due to: Could not load type of field 'Serif.Affinity.Application:<CurrentMicrosoftStorePrices>k__BackingField' (19) due to: Could not load file or assembly 'Windows.Services.Store.StoreContract, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:Z:\home\nidrax\.local\bin\Affinity\drive_c\Program Files\Affinity\Photo 2\Serif.Affinity.dll type:Application member:(null) assembly:Z:\home\nidrax\.local\bin\Affinity\drive_c\Program Files\Affinity\Photo 2\Photo.exe type:Application member:(null)

Config

game:
  exe: /home/nidrax/.local/bin/Affinity/drive_c/Program Files/Affinity/Photo 2/Photo.exe
  prefix: /home/nidrax/.local/bin/Affinity
game_slug: affinity-suite
name: Affinity Suite
script:
  files:
  - setup: https://downloads.affinity.studio/Affinity%20x64.exe
  - WinMetadata: https://archive.org/download/win-metadata/WinMetadata.zip
  - Windows.winmd: https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd
  - Wintypes_Shim.dll.so: https://github.com/ElementalWarrior/wine-wintypes.dll-for-affinity/raw/refs/heads/master/wintypes_shim.dll.so
  game:
    exe: $GAMEDIR/drive_c/Program Files/Affinity/Affinity/Affinity.exe
    prefix: $GAMEDIR
  installer:
  - task:
      arch: win64
      prefix: /home/nidrax/.local/bin/Affinity
      wine_path: /home/nidrax/.local/share/lutris/runners/wine/GameDirectionWine-x86_64/bin/wine
  - merge:
      dst: $GAMEDIR
      src: WinMetadata
  - extract:
      dst: $GAMEDIR/drive_c/windows/system32/WinMetadata
      file: $GAMEDIR/WinMetadata.zip
      filename: WinMetadata.zip
  - execute:
      command: mkdir -p "$GAMEDIR/drive_c/windows/system32/winmetadata" "$GAMEDIR/drive_c/Program
        Files/Affinity/Affinity"
  - task:
      app: --unattended --force vcrun2022 dotnet48 renderer=vulkan corefonts tahoma
        win11
      arch: win64
      prefix: /home/nidrax/.local/bin/Affinity
      wine_path: /home/nidrax/.local/share/lutris/runners/wine/GameDirectionWine-x86_64/bin/wine
  - task:
      arch: win64
      env: {}
      executable: /home/nidrax/Pobrane/Affinity x64.exe
      prefix: /home/nidrax/.local/bin/Affinity
      wine_path: /home/nidrax/.local/share/lutris/runners/wine/GameDirectionWine-x86_64/bin/wine
  - move:
      dst: $GAMEDIR/drive_c/windows/system32/winmetadata/Windows.winmd
      src: Windows.winmd
  - move:
      dst: $GAMEDIR/drive_c/Program Files/Affinity/Affinity/Wintypes_Shim.dll.so
      src: Wintypes_Shim.dll.so
  metadata:
    banner_url: https://github.com/seapear/AffinityOnLinux/blob/main/Assets/Covers/Affinity-Canva-Banner.png
    cover_url: https://github.com/seapear/AffinityOnLinux/blob/main/Assets/Covers/Affinity-Canva-Cover.png
    icon_url: https://github.com/seapear/AffinityOnLinux/blob/main/Assets/Icons/Affinity-Canva.svg
    year: 2025
  system:
    gamescope: false
    xephyr_fullscreen: false
  wine:
    battleye: false
    d3d_extras: false
    dxvk: false
    dxvk_nvapi: false
    eac: false
    fsr: false
    version: GameDirectionWine-x86_64
    vkd3d: false
slug: affinity-suite
system:
  gamescope: false
  xephyr_fullscreen: false
version: GameDirectionWine-x86_64
wine:
  battleye: false
  d3d_extras: false
  dxvk: false
  dxvk_nvapi: false
  eac: false
  fsr: false
  version: GameDirectionWine-x86_64
  vkd3d: false
year: 2025

Self-service

  • I'd be willing to fix this issue myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions