Skip to content

A hand-edited wronggpu.ini is reported "Left in place" and then deleted #73

Closed

Description

@phantoslayer21

This was found by reading the code. It has not been reproduced.

What happens

On a full uninstall, DoRestore puts a wronggpu.ini that was edited by hand into skip with the warning "Left in place (changed since install): wronggpu.ini" (clean/installer/src/wg_core/record.cpp:472-474). The "provably ours" exception is switched off for .ini files (record.cpp:467), so this always happens for an edited file.

Moments later RemoveRuntimeFiles(..., settings = !keepState) deletes wronggpu.ini in every folder it visits (record.cpp:333). It does not look at the recorded set, at existed, or at what was skipped. The warning is false: the file is gone.

When it can happen

Deleting wronggpu.ini on a full uninstall is the documented behaviour: the settings file is kept on a re-install and removed on uninstall (clean/installer/README.md:225, 250; comment at record.cpp:313-315). Updates and Repair keep it. So this is mostly not a defect.

What is wrong:

  1. A player who hand-edits wronggpu.ini and then uninstalls. This is an ordinary player. They lose edits to a file the design removes anyway, but the message tells them it was kept.
  2. A wronggpu.ini that came from a manual or other non-launcher setup is deleted on uninstall, with its backup. This is rare.

Low severity. See also #70, which keeps the backup of a skipped pre-existing file. After that change the file would still be removed here, but its backup would be kept.

To do

  • Minimum: fix the message. For wronggpu.ini, say it was removed.
  • Or, if the owner prefers to keep pre-existing files: in RemoveRuntimeFiles, skip the wronggpu.ini delete for paths whose entry is existed=1 or was skipped by the restore (pass the skip set in).
  • Caution: the second option leaves wronggpu.ini files from WrongGPU's own migration (install.cpp:28-30, 51-54) behind after uninstall. That is harmless, but it changes the documented behaviour. It is the maintainer's decision.

Test

CPU-only. Fake game with wronggpu.ini = A. Install, edit it to B, run a full uninstall. Assert either that the file is present with B, or that the warnings do not contain "Left in place … wronggpu.ini" (whichever behaviour is chosen).

Activity

  1. added this to the 0.6.1 milestone on Nov 13, 2026
  2. added a commit that references this issue on Nov 13, 2026
  3. moved this from Todo to In Progress in WrongGPUon Nov 13, 2026
  4. moved this from In Progress to Done in WrongGPUon Nov 14, 2026
  5. phantoslayer21 commented on Nov 15, 2026

    @phantoslayer21
    OwnerAuthor

    Verified against main (e231746): fixed by #47, which closed this issue on merge.

    The by-name delete of wronggpu.ini on uninstall (RemoveRuntimeFiles) is gone. wronggpu.ini now counts as WrongGPU's file only when its bytes match the hash in the install record (WhatIsThere in clean/installer/src/wg_core/record.cpp; .ini files are never matched against a known release file). So a hand-edited wronggpu.ini stays where it is, and the "Left in place (changed since install)" message is now true. If the player had a wronggpu.ini before the install, that original is kept in WrongGPU-originals.

    Tests in clean/installer/tests/coexist_061_tests.py:

    • test_settings_file: hand edits B, C and D. D stays byte for byte after uninstall, B and C are kept, and the result says "partly".
    • The wronggpu.ini rows of test_ownership_matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: launcherLauncher and installerbugSomething isn't working

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions