Repository navigation
Description
This was found by reading the code. It has not been reproduced.
What happens
Two paths throw away a backup of a file the player had before WrongGPU.
1. Uninstall deletes the backup of a pre-existing file that was changed after install.
In DoRestore (clean/installer/src/wg_core/record.cpp), a copy entry whose live file matches neither the installed hash nor the original hash goes into skip. It gets the warning "Left in place (changed since install)" (record.cpp:472-474). The restore loop then skips it (record.cpp:482). Only the disable branch sets keepBackup (record.cpp:510). A skipped entry that had an original (existed=1) does not. Clean-up then removes the backup folder (record.cpp:566) or the whole state folder (record.cpp:569-572). The original is gone and the player is not told.
This applies to copy entries with existed=1: a player's own OptiScaler files that WrongGPU's OptiScaler replaced, REFramework mirror copies, and wronggpu.ini (see #73). OptiScaler.ini is handled separately (record.cpp:456-460). For FSR slot names, keeping the game's newer DLL is intended (record.cpp:474).
2. Update, Repair and relocation overwrite a backup that the restore kept on purpose.
When a disable entry's path holds different content again, DoRestore sets keepBackup and returns early with a warning (record.cpp:510, 565). It does not return an error. Callers ignore it:
DoInstalltakes the warnings and carries on (clean/installer/src/wg_core/install.cpp:277). It then runs a fresh, unfilteredFindConflicts(install.cpp:500).detect.cpp:487-495removes the hosted install's ownOptiScaler.logfrom that list.install.cpp:500does not.OptiScaler.logis one of the markers (coexist.cpp:21). So the log written by WrongGPU's own OptiScaler becomes a newdisableentry (install.cpp:566-570). The backup step then copies overbackup\OptiScaler.log(install.cpp:584-591) andSaveRecordreplaces the record. The kept original is overwritten.- Relocation runs
DoRestore(..., keepState=true)and thenRemoveTree(StateDir(wrongDir))(clean/installer/src/wg_core/launcher.cpp:1001-1002). RemoveEarlierDirectdoes the same (install.cpp:44-50), but only for direct-route records.
When it can happen
1. Uninstall. Rare, but an ordinary player can hit it. Example: a player switched from their own OptiScaler, later drops a newer OptiScaler DLL over WrongGPU's by hand, or hand-edits a wronggpu.ini that existed before, and then uninstalls. What is lost is the pre-install version of a file the player has since replaced. That breaks the "put back byte for byte" promise (launcher.cpp:984-985, coexist.cpp:290), usually for a superseded file.
2. Update or Repair. Yes, for an ordinary player in the common case. Someone who had their own OptiScaler with an OptiScaler.log, switched to WrongGPU, played once, and then ran Update or Repair loses the pre-switch OptiScaler.log. That is a log, so low value, but it is the "kept in the backup" promise being broken. Worse cases need a real player file to reappear at a disabled path, for example the player reinstalls their own OptiScaler under another proxy name. That is unusual but innocent. Relocation needs the misplaced-install case together with such a file.
Related: #23.
To do
- In the check pass of
DoRestore, when a skipped entry hasexistedand is not an FSR slot name, setkeepBackup = true. Add a warning that names the kept file and the backup path. The existing early return atrecord.cpp:565then keeps the record and the backup. - Make
DoRestorereport an incomplete restore in a way callers cannot ignore. For example, return a flag, or throw a dedicatedSetupErrorcode, whenkeepBackupis set andkeepStateis true.DoInstall, the relocation atlauncher.cpp:1001andRemoveEarlierDirectthen stop beforeRemoveTreeor the new backup pass, with a message that names the file. - Leave
OptiScaler.logout of the conflict scan atinstall.cpp:500for a hosted record, asdetect.cpp:491does. The routine case then never triggers. - Cheaper alternative to a new refusal path: move the kept generation to
backup.kept-<stamp>\before the new install starts. - Cautions: the state folder will stay behind more often after uninstall. That is the safe side, but the next install has to cope with a leftover record. Updates will refuse more often until the player deals with the conflicting file (not with the alternative above).
Test
CPU-only.
- Uninstall: fake game with an existing
dxgi.dll(A). Install, overwritedxgi.dllwith C, uninstall. Assert C is in place and a file with A's bytes still exists in the backup. - Update: fake game with the player's own
OptiScaler.log(A) and an OptiScaler marker. Install with move-mods, write a differentOptiScaler.log(B), run Update. Assert a file with A's bytes still exists underwronggpu-setup.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
Launcher coexist: review fixes
phantoslayer21 commentedon Nov 15, 2026
Verified against main (e231746): fixed by #47, which closed this issue on merge.
DoRestoreinclean/installer/src/wg_core/record.cppnow plans every entry before it changes anything. When it can't put a file back (the file changed since the install, or adisablepath that holds other content again), it first copies the original intoWrongGPU-originals\<stamp>\(KeptOriginal) and says "Partly restored: ... is kept in ...". Uninstall, Update, Repair, the move out of a wrong folder andRemoveEarlierDirectall go through that path, so cleaning up the backup or state folder can no longer discard an original.Tests in
clean/installer/tests/coexist_061_tests.py:test_ownership_matrix: uninstall, repair, update and relocation, each forwronggpu.ini,OptiScaler.iniandOptiScaler.log. A and B both survive, and A is in WrongGPU-originals.test_backups_kept: Update and Repair after WrongGPU's OptiScaler wrote its log, and relocation with another OptiScaler DLL in place.CI also runs the
launcher-core"ownership: ..." checks. #47 recordsrun_coexist_tests.pyat 229 passed, 0 failed.Release notes 0.6.5: the fixes merged since (#22, #23, #63, #70, #73, #…