Skip to content

Affinity 3.3: the manager, pinned Wine 11.19/11.18 builds, and installer fixes - #230

Merged
ryzendew merged 181 commits into
ryzendew:mainfrom
jfacemyer:main
Oct 22, 2026
Merged

ryzendew merged 181 commits into
ryzendew:mainfrom
jfacemyer:main

Conversation

@jfacemyer

@jfacemyer jfacemyer commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

This adds Affinity 3.3 support, the Affinity on Linux Manager, and pinned Wine and plugin-loader builds. It is 158 commits, all tested on Manjaro/KDE Plasma (Wayland) with an Intel Arc, and it merges cleanly on current main. Your 2026-10-10 changes (the two-version picker, WebView2, docs) are merged in.

The manager (AffinityManager/)

A Qt window for managing several Affinity prefixes, run the same way as the installer:

curl -sSL <repo>/raw/main/AffinityManager/run.py | python3
  • Prefix management: a list of prefixes with their state. It can create, adopt, clone, back up and restore, take settings snapshots, clean, check fonts, protect and delete prefixes.
  • Rename / Move: a new name for a prefix, and optionally its folder moved to match. The log, snapshots, menu entries, launchers and Wine's own menu entries follow, each rewritten file kept beside itself as .before-move-*. When the prefix is the Default, its entries and document associations are re-applied for the new name and path.
  • The Default prefix: the menu entry, double-clicked documents and the Canva sign-in (affinity://) all go to one chosen prefix. Other prefixes can get menu entries of their own.
  • Copy settings: brings preferences, workspaces, recent files and drive letters in from another prefix. It can be chosen when the prefix is created, and is offered once Affinity is installed.
  • Configure: runs this installer inside the window, one operation at a time.
  • Running-instance guard: shows what is running in a prefix, so nothing is changed under a running Affinity.
  • Crash safety: an exception escaping a Qt callback is logged to logs/manager-errors.log instead of aborting the manager mid-install.
  • Tests: about 500 tests, run off-screen.

The AffinityManager/ directory is a git-subtree copy of the manager.

Installer (AffinityScripts/AffinityLinuxInstaller.py)

Pinned downloads (marked POC SOURCE)

The Wine builds, the plugin loader and the installer's own fetch location point at jfacemyer releases and the jfacemyer/Linux-Affinity-Manager repository, because the matching builds are not released here yet. Each is a single constant beside its SHA-256, so repointing them at your releases is a one-line change per item: SOURCE_REPO, APL_RELEASE_REPO/APL_RELEASE_TAG, and the two wine_url entries.

.github/README.md is this fork's front page (GitHub shows it in place of the root README) and describes the manager. Leave it out when merging, or your repository's front page will show it; the root README.md is the installer's and is meant for you.

Docs: docs/CHANGELOG.md, docs/WINE-VERSIONS.md, docs/AFFINITY-3.3-TESTING.md, docs/Known-issues.md.

Double-clicking a .af/.afphoto/.afdesign/.afpub file has never opened it in
Affinity: the desktop entry carries no MimeType= and no %F, and there are no
shared-mime-info definitions for the extensions, so the file manager does not
recognise them in the first place.

This adds the three pieces that were missing, and does nothing unless
affinity-on-linux.exe is present in the prefix, so an install without it behaves
exactly as before.

  * mime/ -- shared-mime-info definitions for the four extensions.
  * create_desktop_entry() and _build_affinity_exec_line() launch through
    affinity-on-linux.exe when it is installed and append %F. The handler is
    preferred over AffinityHook.exe because a cold start still goes through the
    hook, so the plugin loader keeps loading; patching the entry for the plugin
    loader therefore no longer undoes the association.
  * register_document_types() installs the definitions and rebuilds the mime and
    desktop databases plus KDE's ksycoca. A MimeType= line does nothing on its
    own -- the association is only picked up once those are rebuilt, and on KDE
    the old one keeps being used until kbuildsycoca runs.

Why a handler is needed at all: Wine converts argv[0] to a DOS path but passes
arguments through verbatim, so a file manager's /home/you/x.afphoto reaches
Affinity unchanged and cannot be opened. Something inside the prefix has to
convert it. The handler also serialises concurrent double-clicks and chooses the
warm or cold route.

The MIME definitions follow the same local-checkout-then-download fallback the
icons already use, because the documented install pipes this script straight
into python3, where __file__ does not exist.
Two pieces the document-open path needs in the prefix.

AffinityHandler/ carries affinity-on-linux.exe with the Program.cs it is built
from, so the binary is reviewable rather than opaque, and a README explaining
why it has to exist at all: Wine converts argv[0] to a DOS path but passes
arguments through verbatim, so a file manager's /home/you/art.afphoto reaches
Affinity unchanged and cannot be opened.

install_winrt_interop_facade() extracts System.Runtime.WindowsRuntime.dll from
the .NET Framework 4.8 redistributable into the prefix GAC. Without it Affinity
starts normally but silently ignores a document handed to it -- no exception,
nothing in the log, the file just never opens. It supplies AsTask(), which
Affinity awaits on SharedStorageAccessManager.RedeemTokenForFileAsync().

The assembly is absent by design, not by a broken install: it ships only in the
Windows 8/10 payload cabs, and winetricks' dotnet verbs set the prefix to win7
because on a real Windows 8+ the standalone installer refuses to run at all.
Re-running it with the prefix reporting Windows 10 does not help -- it detects
4.8 and exits without doing anything. It must land in the GAC: signed with the
ECMA pseudo key, it carries no real signature and is trusted only because the
GAC is trusted, so from an application directory the CLR rejects the genuine
file with "Strong name validation failed" (0x8013141A).

This reuses what the installer already has: 7z is an existing dependency, and
winetricks' dotnet48 verb caches the redistributable in the same place, so an
install that already ran it does not download 72MB twice. The download is
checksum-pinned. Extraction was verified end to end against the real file.

Both steps degrade to a warning rather than failing the install, and both are
skipped when already present.
WinMetadata setup was gated on a version list and skipped for 11.12+ on the
grounds that it is "not needed". That is true of 11.12, but for the wrong
reason: its RoResolveNamespace is a stub, so nothing ever reads
C:\windows\system32\WinMetadata and installing metadata there changes nothing.

A Wine build that implements RoResolveNamespace does need it -- that is what
lets a document handed to Affinity on the command line actually open. So ask the
build what it supports instead of maintaining a version list: the implementation
resolves by name against the WinMetadata directory, so the string is present in
wintypes.dll exactly when the capability is.

Such a build gets ONLY the combined Windows.winmd, not the whole archive, and
that difference decides whether a document opens. RoResolveNamespace walks up a
namespace -- Windows.Storage.Streams, Windows.Storage, Windows -- and the first
file that exists wins. With the per-namespace files present it stops at, say,
Windows.Foundation.winmd, and the CLR then fails on assembly identity, because
those types reference one another as members of the single "Windows" assembly
rather than of per-namespace ones.

Measured on a patched Wine 11.16, same prefix, same document:

  all 21 files from the archive   window opens, document silently never does
  Windows.winmd alone             cold and warm both open, running instance
                                  survives the handoff

9.14 and 10.10 keep the existing behaviour untouched.

The archive is the one this project already publishes, so no new download and
no redistribution of anything that was not already hosted here.
Adds 11.16 alongside the existing versions in all three selection dialogs, in
_get_wine_version_config, in the known-version list, and in the installed-version
detection, which previously mapped every 11.x to "11.12".

11.16 is the version that carries the patches this feature needs: a real
RoResolveNamespace, so a document handed to Affinity on the command line
actually opens, and a wineserver that lets an application bring its own window
forward. On any other version the installer's capability check quietly skips the
WinRT metadata and the desktop entry does not claim the document types, so
behaviour there is unchanged.

The download URL is a PERSONAL FORGEJO BUILD and is marked as such in the code.
It is there so this can be proven end to end on a clean machine before anything
is proposed upstream; it must be repointed at an upstream 11.16 release before
merging.
setup_wine() returns False when it gives up -- most often because the Wine
download failed -- but its return value was discarded at the call site. The
failure appeared only in the log, and the flow carried straight on to DPI
configuration and everything after it, against a prefix with no Wine in it.

Check it, say so in a dialog rather than only the log, and stop.

Easy to hit: any transient network failure during the ~100MB Wine download, or
a release asset that is not there. Nothing downstream can work once it happens,
so continuing only produces confusing secondary errors.

Cancellation is not treated as failure -- setup_wine() also returns False when
the user cancels, and that already has its own path.
The Wine version chooser is a custom Qt dialog built from QRadioButton widgets,
not the generic question dialog. Adding 11.16 to the option lists that feed the
generic path left it invisible: _show_question_dialog_safe() detects a wine
version dialog and hands off to _show_wine_version_dialog_safe(), which builds
its own radios and ignores the list it was passed.

Adds the 11.16 radio alongside the others, reads it back in the result handler,
and makes it the default, since it is the only build where a double-clicked
document opens.
install_file_manager_handler() and register_document_types() fall back to
downloading when there is no local checkout -- which is the normal case, since
the documented install pipes this script straight into python3 and __file__ does
not exist there. Both fallbacks pointed at raw.githubusercontent.com/ryzendew,
which does not carry AffinityHandler/ or mime/, so both 404'd.

The effect was silent and looked like nothing had happened: the handler was
never installed, so create_desktop_entry() correctly saw no handler, left the
Exec line alone and claimed no document types. The install otherwise succeeded.

Repointed at the fork that has the files. Marked POC, like the Wine URL: these
must move to the upstream raw URLs before merging.
Everything needed to open a document by double-clicking it -- the WinRT interop
facade, Windows.winmd, the handler, the desktop entry and the MIME registration
-- only ran as part of a full install. Any one of them can fail independently:
a download that does not resolve leaves the rest of the install perfectly good
but documents still not opening, and the only recovery was to re-run the whole
thing and re-fetch Wine and Affinity for no reason.

Adds a menu action that runs just those steps. Each already skips itself when
already done, so it is safe to run repeatedly, and it reports plainly when the
Wine build cannot support the feature at all -- a build that stubs
RoResolveNamespace will never read the metadata, so saying so is more use than
installing it anyway.
The handler was installed, and the desktop entry pointed at it and claimed
.af/.afphoto/.afdesign/.afpub, on any Wine version. But a build that stubs
RoResolveNamespace silently ignores a document handed to it on the command line,
so double-clicking opened an empty Affinity and looked like a broken
association -- worse than not claiming the types at all.

Both the handler install and the desktop entry now require the build to
implement RoResolveNamespace. Checked in both places rather than once, so that
switching to a build without it and re-running gives the association up again
instead of leaving a stale one behind.
A real install ends up with Wine's own ten generated winmd files in
system32/WinMetadata, picked up when the prefix is created. Adding the combined
Windows.winmd alongside them does nothing, because they shadow it:
RoResolveNamespace walks a namespace up -- Windows.Storage.Streams,
Windows.Storage, Windows -- and returns the FIRST file that exists. With
windows.storage.winmd present it never reaches Windows.winmd and resolves
against Wine's own metadata instead, which fails with

  System.TypeLoadException
     at Serif.Affinity.Application.ProcessCommandLineArguments(...)

the moment Affinity is handed a document. Diagnosed on a second machine; a
hand-built test prefix did not reproduce it, because the setup script used
during development clears the directory first and a real install never does.

They are moved aside rather than deleted -- they are Wine's, not ours -- and the
clearing now happens even when Windows.winmd is already present, so this repairs
an affected prefix instead of returning early and leaving it broken.
Three downloads in the installer point at a personal Forgejo mirror rather than
upstream. That was only recorded in POC SOURCE comments next to each one, where
a reviewer finds it after wondering why an unfamiliar host appears in a curl.

Say it once in the handler README instead: what each URL is, why it is a
download at all -- the documented install pipes the script into python3, so
there is no checkout to copy from -- and what it must become before merging.
The Wine entry needs an upstream 11.16 release to point at, which is a
prerequisite rather than a follow-up, so note that too.

Also give the install command for the branch. The published one-liner installs
main, which has none of this, so anyone asked to try it has had to be told the
URL out of band. The clone form is there as well: run from a checkout the
installer copies the handler and the MIME files locally and never touches two
of the three URLs, which is worth knowing when a test passes.
Installing AffinityPluginLoader fails outright against the current release.
The asset lookup matches apl-winefix-*.zip, and since v0.3.0 the asset is
published as winefix-v0.3.0.zip, so it reports

  Could not find apl-winefix-*.zip in release assets

and aborts before anything is installed -- taking the automatic step 5 of a
fresh install with it. Match either name so releases from before the rename
still install, and fix the message to say what is now looked for.

The verification afterwards was wrong in the same direction: it checks for
apl/d2d1.dll, and the zip puts d2d1.dll at the root. That is not incidental
to the layout -- it is the only place the file works, because Wine resolves
it through the executable's own directory, which is also why it takes
precedence over Wine's own d2d1. Checking apl/ warned on every successful
install and would have stayed quiet if the file went missing.
The installer is a single-prefix tool. It installs into ~/.AffinityLinux, or
into the one path remembered in ~/.config/AffinityOnLinux/install_location,
and the only way to say otherwise is a dialog that appends .AffinityLinux to
whatever folder is picked. Anything wanting a second prefix -- a manager
handling several, a test install that must not touch the working one -- has no
way to ask for it.

AFFINITY_INSTALL_DIR names the directory, verbatim, with no suffix appended:
the caller is choosing the name, which is the point. It beats the remembered
location, because a caller that asked for this prefix must not be redirected to
whichever one was used last, and it skips the custom-location question rather
than asking something already answered.

AFFINITY_INSTALLER_FILE pins the build. downloads.affinity.studio serves
whatever the current release is and there is no versioned URL, so today every
install and every update silently takes the newest Affinity -- 3.3 as of this
morning -- with no way back short of an installer someone happened to keep.
Pointing at a kept installer is the only way to reinstall a known version, and
it skips the download-or-provide dialog so a click cannot undo the pin. A path
that no longer exists falls back to the normal download rather than failing.

Environment rather than only argv, because the caller is a subprocess launcher
and because the documented install pipes this script into python3, where argv
is not ours. --install-dir and --installer-file set the same variables, so
there is one path to test and the two cannot disagree.
Affinity 3.3 shipped this morning and the installer already installs it: the
download URL carries no version and serves the current release, so every fresh
install and every Update has silently moved to 3.3 with no opt-out. The thing
worth documenting is not how to get 3.3 but that there is no way back, because
no URL serves the previous release -- a kept installer is the entire rollback
story and nobody is told to keep one.

Records the two variables this branch adds, the side-by-side recipe they make
possible, and the one version assumption that was checked rather than changed:
the settings schema folder is 3.0 for all of Affinity v3, the installer prefers
an existing folder and only falls back to 3.0, so it is left alone until a 3.3
install shows otherwise.
A finished install could still have both sets of WinRT metadata in
system32/WinMetadata: the combined Windows.winmd we install, and Wine's ten
per-namespace files. The ten shadow the combined one -- RoResolveNamespace
returns the first file it finds walking a namespace up, so it stops at
windows.applicationmodel.winmd and never reaches Windows.winmd -- and the
result is an install that looks complete and in which double-clicking a
document silently does nothing.

The clearing was already written and already correct. It just ran too early.
The ten files are not a leftover: wine.inf lists them under [WinmdFiles] with
DestinationDirs 11,winmetadata, from [BaseInstall] and [BaseWow64Install],
which wineboot re-runs through InstallHinfSection on every prefix update. So
every later step -- winetricks, .NET, the Affinity installer itself -- copied
all ten back over the clearing done during setup_wine().

It now runs again as the last step of run_installation, after the plugin loader
install, which is the last thing that can boot the prefix. The handler install
asserts it too, so the repair action does not depend on what ran before it.

Extracted into clear_shadowing_winmds() so those three call sites share one
implementation, and given the guard the inline version lacked: with no
Windows.winmd present it refuses and says so, because removing the ten would
then leave the prefix with no WinRT metadata at all -- worse than the wrong
metadata. Exercised against a reproduction of the broken prefix, against a
wineboot restoring the files afterwards, against a prefix with no combined
metadata, against an already-clean one, and against a repeat run colliding
with its own .wine-shadowed.
Closing Affinity and double-clicking a document straight afterwards opened a
blank window with no tab. Watched live, the cause is plain:

  08:08:54  procs=2  threads=[3 152]  windows=1  docs-open=1
  08:09:00  procs=2  threads=[3 3]    windows=0  docs-open=0   <- closed
  08:09:09  LOG: warm handoff: ...v3.af                        <- saw "running"
  08:09:28  procs=3  threads=[3 3 62] windows=1  docs-open=0   <- window, no doc

The close leaves husks: no window, no document, three threads, and they linger
holding Affinity's single-instance registration. IsAffinityRunning took the
process list as proof of life, chose a warm handoff, and the document went to a
dying process which dropped it. The forwarder then started up on its own,
without the document.

A process list is no longer proof. A window is, and so is a thread count of 40
or more -- live runs at 150+, starting passes fifty within seconds. A low count
proves nothing: a closing instance descends through every value, and one was
caught at 17, which is why an earlier threshold-only version of this fix was
wrong. Where there are processes but neither signal, the handler waits out the
whole startup window for one to appear, because anything genuinely starting
produces one; the hook exists for ~30s before Affinity.exe does and missing it
there is what cold starts a rival. Only then are the remains treated as husks
and cleared, so the cold start's handoff cannot land on one.

Deliberately biased: mistaking a husk for a live instance costs an unopened
document, mistaking a live instance for a husk kills the session and anything
unsaved in it. Nothing is declared dead early.

Verified against both paths -- close-then-click clears the husks, cold starts
and opens the document; clicking again while it is open still takes the warm
path and opens, with the running instance untouched at 178 threads.
Waiting for a window to prove a start was correct and unusable: on a
close-then-click it spent the full stall window before concluding, and only
then cold started.

  08:18:45  invoked
  08:18:45  processes present with no window; waiting...
  08:19:31  no window appeared; treating as husks     <- 46s
  08:19:32  cold start                                <- ~18s more

A minute of nothing is indistinguishable from a broken double-click, which is
what it was reported as.

Age settles it without waiting. A start that has not yet produced a window is
seconds old; a husk has been alive since Affinity was started, which is however
long the session lasted. So processes older than a startup with no window and
no thread count to vouch for them are husks immediately, and the wait is kept
only for the genuinely ambiguous case of something that did start recently --
where it also now gives up as soon as the youngest process ages out.

Unknown start time counts as recent. The bias is unchanged: an unopened
document beats killing something that is alive.
The handoff races Affinity finishing its startup, and the forwarding process
exits 0 either way -- it has done its job once the command line is delivered,
so its exit code says nothing about whether the document opened. Caught
failing: the instance was seventeen seconds old and twenty-four threads into a
startup that ends near a hundred and fifty, the forward was accepted, and the
document was dropped. Nothing in the handler noticed, so a double-click
produced an empty window and no error.

Affinity writes "<document>~lock~" beside a document it has open, so that file
answers the question the exit code cannot. The handoff now waits up to twenty
seconds for it and hands the document over again if it never appears -- three
times on a cold start, twice on a warm one, which is where the race is
narrower. Where a lock file already exists, a crash having left one behind,
there is nothing to watch for and the handoff is made once without
confirmation rather than guessing.

This replaces guessing at readiness. Every attempt to infer when Affinity is
ready to receive a document has been wrong at least once here -- a window is
up long before the singleton is listening -- and the outcome is observable,
so observe it.
Affinity deadlocks during startup when OpenCL initialises on a real GPU, on
every Wine from 11.11 onward. It is not a crash: the rasteriser waits on an
event that is never signalled, so the splash never clears, the UI never builds,
and the process sits at a couple of dozen threads instead of the ~150 a
finished startup reaches. Log.txt stops after the path banner. The backtrace is
ntdll <- kernelbase(WaitForMultipleObjects) <- libkernel <- libraster <-
libpersona, with nothing anywhere in win32u, winex11, vulkan or vkd3d.

The installer never disabled it. Answering yes to "Enable OpenCL Support?"
installs OpenCL packages and vkd3d-proton, which is a different thing from
letting Affinity load opencl.dll, and nothing wrote the DLL override -- so a
fresh install on 11.16 produced a prefix that hangs every time it starts.

It goes in the prefix registry rather than a launcher, because it has to hold
however Affinity is started. That is precisely where this hid: the failure only
appeared through the desktop entry, while every launch made by hand during
debugging passed WINEDLLOVERRIDES on the command line and started cleanly.
Reproduction disagreed with the report for hours because of it.

Applied at the end of Wine setup and again at the end of the install, so a
prefix whose Wine changed along the way still ends up correct, and gated on the
Wine version so anyone who wants OpenCL can still have it by choosing 11.0 or
older, where it works.
run_update reinstalled WinMetadata unconditionally, and always through
setup_winmetadata() -- the per-namespace archive. Two things wrong with
that, and they compound.

The archive is right only for Wine 9.14 and 10.10. On a Wine that
resolves WinRT namespaces itself, the per-namespace files SHADOW the
combined Windows.winmd rather than supplement it: RoResolveNamespace
walks a namespace up and returns the first file that exists, so
windows.storage.winmd means Windows.winmd is never reached. The
reinstall path next door already knew this and gated on it. The update
path did not, so every update quietly undid the thing that lets a
document open from the file manager.

And it deleted before installing. A prefix observed in the field had 85
metadata files against the 21 in the archive; a routine update replaced
the curated set with the smaller one and left no way back.

Both paths now share refresh_winmetadata(), which gates by Wine version,
moves the old directory aside instead of removing it, clears the
shadowing per-namespace files last -- after anything that can run a
wineboot, because wine.inf puts them back -- and says so when a prefix
ends up with fewer files than it started with, naming where the previous
set is.
Two installer windows can be open at once -- one on a working prefix and
one on a copy of it -- and they share a single log file. The title bar
said "Affinity Linux Installer" in both, and log lines carried no marker,
so there was no way to tell them apart on screen or afterwards.

An interleaved log then reads as one process doing contradictory things:
a settings patch against ~/.AffinityLinux at 15:35 and an update against
a managed copy at 15:41, six minutes apart, looked like the installer
ignoring the prefix it was handed. It was not. Checking
/proc/<pid>/environ showed the running instance correctly pointed at the
copy; the earlier lines belonged to a window opened before it.

The title now names the prefix, the full path is its tooltip, and startup
logs the directory with the pid -- and says when the directory came from
the caller rather than from what was used last, which is the distinction
that matters when a manager launches this against a specific prefix.
An update reported success and left the application untouched. The log
shows why, in three seconds:

  Using system Wine for Affinity installation
  Running (updater) attempt 1: wine .../Affinity-x64.exe
    wine client error:0: version mismatch 961/931.
  Installer is running despite error, continuing...
  Installer file removed

A prefix belongs to the Wine that created it. This one was built by
ElementalWarrior 11.16 and the Wine on PATH is 11.1, so wineserver
refused the connection and the 673 MB installer exited immediately. The
heuristic that exists to tolerate Wine's noisy debugger output then read
a hard failure as "it must be running", deleted the installer, and ran
every post-install step against a prefix still holding the old version.
WinMetadata, settings and the DLL patch all "succeeded". The popup said
the application had been updated.

Two changes. System Wine is used only when it can actually attach to the
prefix -- asked beforehand with `wine --version` under that WINEPREFIX,
falling back to the prefix's own Wine when it cannot, and falling back
also when the question cannot be answered, because the prefix's own Wine
is always right. And a version mismatch is now fatal rather than a marker
to weigh against others: the installer did not run, so there is nothing
to continue to.
The check added a moment ago asked `wine --version` under the prefix and
looked for "version mismatch" in the output. That text never appears:
--version prints and exits without contacting wineserver, so the check
passed in precisely the case it was written to catch. Tested against both
prefixes on this machine and it reported no mismatch for either, while
system wine is 11.1 and the prefixes are 11.12 and 11.16.

Compare the two versions instead. It is deterministic, needs no running
wineserver, and catches the other half of the problem as well: with no
server running there is no mismatch to observe, and an older Wine will
happily wineboot over a prefix a newer one built.

Unknown counts as a mismatch -- the prefix's own Wine is always right for
its own prefix.
_install_affinity_settings_thread did shutil.rmtree on
AppData/Roaming/Affinity/Affinity/3.0/Settings "to force fresh copy",
then copied the repository's stock files in. That directory is not only
stock configuration -- RecentFiles.xml lives there, and so does anything
the user has changed -- so every Unified update silently reset
preferences and emptied the recent-documents list.

It goes unnoticed because the list regenerates as documents are opened.
Observed on this machine: four wipes in one day across three prefixes,
one of them the user's working prefix, and the only reason it was caught
is that a copy had not been used since and stayed at the 227-byte
default.

Move the directory aside instead. A few hundred kilobytes, and the step
becomes reversible.
Two corrections.

The block was duplicated -- the previous commit fixed one of two, so an
update through the other path still deleted the directory. Both now move
it aside.

And the reasoning in that commit was wrong. It said the recent-documents
list "regenerates as documents are opened", which the numbers contradict:
the prefix wiped at 11:18 holds 269 entries, not the handful opened
since. The log shows the deletion succeeded, so nothing regenerated.

What actually happens is that Affinity keeps the list in memory and
writes it back, so deleting the file underneath a running application is
invisible -- it re-persists what it already had. The loss is real and
permanent precisely when the application is NOT running, which is the
normal case for an update: the prefix wiped at 15:41 with nothing running
stayed at the 227-byte default.

That makes the defect worse than described, not better.
Moving the old Settings directory aside stopped the deletion but not the
loss: the stock set was still copied over the top, so every install and
every update still reset preferences and emptied RecentFiles.xml. The
user got the old directory back as Settings.replaced-<stamp>, which is
better than nothing and still not what anyone wants.

Measured on a prefix updated yesterday: 89 recent documents before, 0
after, and fifteen preference files reverted to stock.

The step exists to seed a fresh prefix, because Affinity v3 will not save
settings until the files are there. That purpose is served by filling in
what is missing. _seed_settings does exactly that and never writes over a
file that already exists, so a fresh prefix still gets the complete set
and a prefix in use is left alone. Both call sites use it -- the
duplicate block is why the first fix only half worked.
The copy here had drifted 511 lines from the development copy's, and it still ran
the startup retry watchdog that was retired there on 2026-09-16: no window
within 45 seconds and it kills Affinity, AffinityHook and wineserver in the
prefix. It was retired because it could not recognise Affinity 3.3's main
window -- GetWindowRect reports left = 22369618 and a negative width while X
reports a sane 3850x2101 -- so on 3.3 it kills the session it is meant to be
watching. Anyone installing this branch was getting that.

In its place the handler now clears the 3.3 shutdown zombie: Affinity logs
"Exit" and then deadlocks in libnetwork.dll's process detach, and the corpse
answers "running" while being unable to take a handoff, so every launch
after it silently does nothing. Three conditions, all required, all measured
-- see THE SHUTDOWN ZOMBIE in the source.

Also fixed: the handoff confirmation watched for "<doc>~lock~", which never
exists. Affinity sets a Dropbox ignore attribute on that sidecar, Wine
materialises the NTFS stream as "<doc>~lock~:com.dropbox.ignored", and no
plain sidecar is written. Every successful open was reported as a failure
after three retries.

This file is synced from the handler's development repository.
Edit it in one place: it drifted once and shipped a session-killer.
Synced from the handler's development repository. One refusal was seen once and could not be
reproduced; six consecutive runs against the same corpse then succeeded. The
refusal is fail-safe -- a bad read declines, never kills -- but one message
covered four different failures, so it was undiagnosable. Each now says
which.

Verified end to end against a real corpse with this binary: the handler
cleared it and the next launch started cleanly.
Pin the r8 release (sha256 0f93d1b3...9881300) and describe it, with the
installer changes since r7, in the changelog.
…ween components

winetricks' corefonts verb waits for Wine to shut down after each of its
ten font families and starts Wine again for every registry value: 94 s of
a fresh install, and tahoma 16 s more. The installer now unpacks the same
files (same downloads and checksums, shared with winetricks' cache),
copies them and registers them in one regedit run that writes the keys
winetricks fills in both registry views, then records the verbs in
winetricks.log. Font files and registry entries are identical to
winetricks' result; 6 s per verb. winetricks remains the fallback.

Between components, a winedevice.exe that survives wineserver -k was
waited for 20 s and then killed, five times per install. Once wineserver
-k has returned, stragglers get 2 s.
The WebView2 setup leaves MicrosoftEdgeUpdate.exe /c running, which never
exits, so `wine start /wait` on the setup waited out the whole 1-hour
stall timeout: a fresh install sat at "Installing WebView2" after the
runtime was in place. While the setup runs, a watcher stops the updater
once msedgewebview2.exe exists and the updater is all that is left
besides Wine's services, for 10 s. Edge Update is disabled right after.
…launch text

Ten dialogs were created without a parent, so each was a window of its
own; on Wayland one could sit behind the main window while still blocking
it (a finished install in the manager waited on an "Installation
Complete" box nobody could see). They now belong to dialog_parent(), the
installer's window or, hosted, the manager's.

The closing "You can now launch it from your application menu" comes
from launch_instructions(), so a host that writes the menu entries itself
can say where to start Affinity instead.
90797d5 Name the way back from Configure "Affinity on Linux Prefix Manager"
1a4256b Tell a hosted install where to start Affinity, not the application menu

git-subtree-dir: AffinityManager
git-subtree-split: 90797d50f40d5354d45baf135c238c42451731f0
Under the progress line: "Started 08:12:03 · Elapsed 4:32", ticking each
second, then "Finished in 12:34" (also logged) once it ends. One-Click
Full Setup ends the Wine setup's own operation partway through, so the
clock stops 3 s after the last end and counts a start within that as the
same run; the time shown runs to the last end.
The two-second grace after `wineserver -k` also covered the wineserver,
which writes the registry to disk on SIGTERM. Killing it mid-write lost
what the last winetricks verb had set: a fresh install came up without
renderer=vulkan, on the OpenGL renderer. The wineserver now always gets
the full wait; other stragglers keep the short grace. Zombies count as
gone.
Pin the plugin loader release wine-fixes-4 (wine-fixes-3 plus the
sub-tool panel fix) and describe today's installer changes in the
changelog.
Pin the r9 release (sha256 79c21583...0eaa9): Affinity's flyouts and
tooltips are no longer black on Wine's OpenGL renderer, and the floating
Help panel keeps its frame after a studio switch.

After the Wine components, the installer checks the prefix has a
renderer setting and sets Vulkan again if it is missing; a chosen
renderer is kept.
e327f21 Put back a prefix's missing renderer setting

git-subtree-dir: AffinityManager
git-subtree-split: e327f212abd8f8a4e8207face59e7d45bb6ef61c
The direct font install wrote to drive_c/windows/Temp. Wine's folder is
"temp"; host names are case-sensitive and Wine's are not, so the new
"Temp" is what Wine then opened for C:\windows\Temp, while winetricks
writes its .reg files into "temp". Every winetricks registry change after
the fonts failed with "file not found": vcrun2022's and msxml's DLL
overrides and renderer=vulkan were never set. Affinity ran on Wine's own
C++ runtime and crashed in libraster, and its setup failed on .NET.

prefix_temp_dir() returns Wine's "temp" and folds a stray copy in another
case back into it; the font install and repair use it, and both component
loops call it first, so a prefix that has both is healed on the next run.
A second click on One-Click Full Setup, four seconds after the first,
started a second setup beside it: the two downloaded Wine together, one
unpacked and deleted the archive, and the other stopped with "Wine setup
failed" while the first carried on.

While an action runs (an operation is marked and a thread the click
started is alive), the action buttons now say so and do nothing. Both
conditions are required so that neither a path that skips
end_operation() nor a lingering helper thread can lock the buttons.
The Wine-choice cancel and Wine-setup failure exits of One-Click now end
the operation.
…ller

Pin the r10 release (sha256 637a0ec5...9a626e). Affinity's installer
asks WMI for the processor architecture from its WPF window; Wine gave
no answer, it took that for ARM64 and warned that installing is not
recommended. r10's four COM/WMI fixes make the query answer.
offer_after_install() is called after the closing message of an
Affinity install. It does nothing when the installer runs by itself,
which writes the menu entry for the prefix it installed; the prefix
manager uses it to offer making the new prefix its Default.
e582fe9 Offer to make a newly installed prefix the Default

git-subtree-dir: AffinityManager
git-subtree-split: e582fe9e6f6cf0bd2f6d99eb75ff285221bd3017
A section listing what One-Click Full Setup sets up (the patched Wine, Windows components, Affinity, GPU rendering, Help, WineFix, the menu entry, document double-click and the Canva sign-in, the checks at the end), that the installer keeps one Affinity, and a short section on the manager with its run command.
2abc94a README: rewritten for people who use it

git-subtree-dir: AffinityManager
git-subtree-split: 2abc94a8f19fad9dd4d37ab7335d95bd935733d6
065d8db README: open with the manager; the installer comes in where Setup does

git-subtree-dir: AffinityManager
git-subtree-split: 065d8db4ae2ca28dea24687b5da67e246b186b9d
4aa2823 README: a screenshot of the manager's window

git-subtree-dir: AffinityManager
git-subtree-split: 4aa28237359fca3a77a328bd95e14d7dccf9c9d4
GitHub shows .github/README.md in place of the root README, so the
fork's front page now describes the manager, with its run command, a
screenshot and what it does, and points to the installer and its README.
The root README, the installer's, is unchanged.
02e3a99 Tests: the recommended Wine comes first, whichever it is; Wine 11.20's pin

git-subtree-dir: AffinityManager
git-subtree-split: 02e3a999e3b748c76632964aec90ac1d69a227c7
11.20-r1 carries 11.19-r10's Affinity patch set plus the fix for the
white setup window, pinned by SHA-256. The choices are now 11.20 and
11.19; 11.18 stays installable but is no longer offered.
@ryzendew
ryzendew merged commit 436329e into ryzendew:main Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants