Windows: language from Windows settings, honest saved figures, and part 3 with an existing install (wintest-4) #38

Manually merged
SkyfaR merged 10 commits from windows-wintest4 into main 2026-10-06 15:56:17 +02:00
Owner

Fixes what the third real-PC run (wintest-3, ogc-messungen issue #6) showed, and the test package for the next run (wintest-4).

From the real PC

  • Language on Windows: the app and ogc.exe were English on a German Windows 11. The language came only from LANG/LC_*/LANGUAGE, which Windows does not set.
    • Now, when none is set, Windows' display languages from GetUserPreferredUILanguages are used, in order: the first shipped one wins, otherwise English. Explicitly set variables and the app's own setting still win. Linux is unchanged (src/i18n/locale.rs, locale/windows.rs).
    • The app also sets LANGUAGE to its language before GTK starts (with g_setenv, which libintl sees), so GTK's and libadwaita's own texts match. pt becomes pt_BR and zh becomes zh_CN, the bundle's folder names. RESTART NOW keeps the original LANGUAGE.
  • "SAVED 11.8 GiB" with nothing compressed:
    • Cause: on NTFS, size minus allocation also counts sparse holes, LZNT1 and other tools' WOF compression.
    • The analysis now reports separately how much smaller files are without WOF, and the app counts that as room taken, so savings estimates stay right.
    • On Windows, the card chip, the library's SAVED, the dashboard's TOTAL SAVED and the drive tiles count only games this program compressed (games.tsv).
    • DECOMPRESS is offered for games compressed here or stored with WOF. The analysis.tsv format is unchanged; btrfs behaves as before.
  • "Compress 20 games" vs "Compress 17 games": only the moment in time, as analysis results came in. A new test pins that the dashboard and the library always offer the same work (library/totals_tests.rs).

wintest-4 (run-tests.ps1 5, package run 4)

  • Part 3 with an existing install: part 3 no longer skips when OpenGameCompressor is already installed.
    • With a setup in the package, Enter installs it over the existing install and keeps it.
    • p checks the existing install as it is.
    • n uninstalls first and runs the full fresh test.
    • a skips part 3.
  • The report names the build it checked: DisplayVersion, ogc --version, the SHA-256 of ogc.exe, ogc-gui.exe and the setup, and whether the installed ogc.exe is the package's.
  • Guide: ANLEITUNG.txt has a short "only part 3" path (-NurInstallation).

Also

  • A layout test of the toasts measured them mid-animation on a busy machine; it now turns GTK's animations off while measuring.

Tests

  • Linux: fmt, both clippy runs, and cargo test --all-features with Broadway and OGC_TEST_REQUIRE_BTRFS=1: all pass, apart from the toast test fixed in the last commit, which passes on its own.
  • PowerShell: ps-test.sh passes, both suites.
  • Container: check.sh; wine-test.sh (with a real GetUserPreferredUILanguages call); check-gui.sh; build-gui.sh; gui-test.sh (GLib says "5 Bytes" after LANGUAGE=de); gui-smoke.sh; the installer tests; and dist.sh with the app, which builds ogc-wintest-0.1.0-4.zip.
  • Review: each piece had a review with adversarial verification. Its one finding, that Enter would have checked the old install, is fixed.

Known, not fixed here

  • Half-Life 2 and its episodes each count the whole shared folder in TOTAL SIZE and the compress amounts; Linux does the same.
  • One Task Scheduler message (scheduler.rs:435) is still untranslated.
Fixes what the third real-PC run (wintest-3, ogc-messungen issue #6) showed, and the test package for the next run (wintest-4). ## From the real PC - **Language on Windows:** the app and `ogc.exe` were English on a German Windows 11. The language came only from `LANG`/`LC_*`/`LANGUAGE`, which Windows does not set. - Now, when none is set, Windows' display languages from `GetUserPreferredUILanguages` are used, in order: the first shipped one wins, otherwise English. Explicitly set variables and the app's own setting still win. Linux is unchanged (`src/i18n/locale.rs`, `locale/windows.rs`). - The app also sets `LANGUAGE` to its language before GTK starts (with `g_setenv`, which libintl sees), so GTK's and libadwaita's own texts match. `pt` becomes `pt_BR` and `zh` becomes `zh_CN`, the bundle's folder names. RESTART NOW keeps the original `LANGUAGE`. - **"SAVED 11.8 GiB" with nothing compressed:** - Cause: on NTFS, size minus allocation also counts sparse holes, LZNT1 and other tools' WOF compression. - The analysis now reports separately how much smaller files are without WOF, and the app counts that as room taken, so savings estimates stay right. - On Windows, the card chip, the library's SAVED, the dashboard's TOTAL SAVED and the drive tiles count only games this program compressed (`games.tsv`). - DECOMPRESS is offered for games compressed here or stored with WOF. The `analysis.tsv` format is unchanged; btrfs behaves as before. - **"Compress 20 games" vs "Compress 17 games":** only the moment in time, as analysis results came in. A new test pins that the dashboard and the library always offer the same work (`library/totals_tests.rs`). ## wintest-4 (`run-tests.ps1` 5, package run 4) - **Part 3 with an existing install:** part 3 no longer skips when OpenGameCompressor is already installed. - With a setup in the package, Enter installs it over the existing install and keeps it. - `p` checks the existing install as it is. - `n` uninstalls first and runs the full fresh test. - `a` skips part 3. - **The report names the build it checked:** DisplayVersion, `ogc --version`, the SHA-256 of `ogc.exe`, `ogc-gui.exe` and the setup, and whether the installed `ogc.exe` is the package's. - **Guide:** `ANLEITUNG.txt` has a short "only part 3" path (`-NurInstallation`). ## Also - A layout test of the toasts measured them mid-animation on a busy machine; it now turns GTK's animations off while measuring. ## Tests - **Linux:** fmt, both clippy runs, and `cargo test --all-features` with Broadway and `OGC_TEST_REQUIRE_BTRFS=1`: all pass, apart from the toast test fixed in the last commit, which passes on its own. - **PowerShell:** `ps-test.sh` passes, both suites. - **Container:** `check.sh`; `wine-test.sh` (with a real `GetUserPreferredUILanguages` call); `check-gui.sh`; `build-gui.sh`; `gui-test.sh` (GLib says "5 Bytes" after `LANGUAGE=de`); `gui-smoke.sh`; the installer tests; and `dist.sh` with the app, which builds `ogc-wintest-0.1.0-4.zip`. - **Review:** each piece had a review with adversarial verification. Its one finding, that Enter would have checked the old install, is fixed. ## Known, not fixed here - Half-Life 2 and its episodes each count the whole shared folder in TOTAL SIZE and the compress amounts; Linux does the same. - One Task Scheduler message (`scheduler.rs:435`) is still untranslated.
wintest-3 left part 3 out because the tester had installed OpenGameCompressor
by hand. Now the script asks what to do with such an install: check it as it
is (everything but installing and uninstalling, kept at the end), install over
it (kept at the end), or uninstall it first and run the whole part 3. The
choice, the installed version and folder, and whether the background task was
set up before go into the report; the data question at the end comes only
where the script uninstalls. The H23 task checks move to app-test.ps1 to keep
installer-test.ps1 under 500 lines. The guide describes the choice and a short
path for part 3 alone.
Windows sets none of LANG, LC_ALL, LC_MESSAGES and LANGUAGE, so the app and
ogc.exe spoke English on a German Windows 11 (wintest-3). Where none of the
locale variables is set, LANGUAGE still counts there, then the user's display
languages from GetUserPreferredUILanguages, the first one shipped, else
English. Variables set explicitly and the app's setting still win; Linux keeps
to the locale variables as before. The locale functions move to
i18n/locale.rs.
libintl takes GTK's, libadwaita's and GLib's translations from LANGUAGE,
else on Windows from the regional format (g_win32_getlocale), which need not
be the display language the app speaks nor the language picked in its
settings. The app now sets LANGUAGE to its own language at the start of main,
before GTK starts, through GLib's g_setenv: Rust's set_var does not reach the
C runtime's copy that libintl reads (checked under Wine). RESTART NOW starts
the app again with the LANGUAGE it was started with. Linux is unchanged.
The WOF analysis now counts apart what the files no WOF algorithm stores take
less than their size: the holes of sparse files and what NTFS' LZNT1
compression saves (WofReport::smaller_without_wof), so that the app can tell
it from what WOF saves.
The library's SAVED showed 11.8 GiB on a PC where no game was compressed
(wintest-3): the app counted a game's size less the room it takes, which on
NTFS also holds the holes of sparse files, LZNT1 and other tools' WOF
compression. The app's estimate now counts the holes and LZNT1's savings as
room taken (worker::facts::app_report), what compressing would save stays
the same, and on Windows the chip, the library's SAVED, the dashboard's TOTAL
SAVED and its drives count only the games this program compressed, as GAMES
COMPRESSED does. DECOMPRESS is offered for a game compressed here or stored
with WOF, and its question says what decompressing takes back. btrfs counts
as before.
The dashboard offered "Compress 20 games ≈ 4.2 GiB", the library two minutes
later "Compress 17 games ≈ 6.5 GiB" while the games were being analysed
(wintest-3). Both take the same games with the same estimates; what they
offer moves as estimates come in, a game found too small leaving both. The
tests pin that for excluded games, games waiting for Steam, left alone, with
DirectStorage or a known problem, queued, too small, failed or compressed,
and that the library's SAVED is the dashboard's TOTAL SAVED.
The friend still has the wintest-3 build installed by hand. With Enter
checking the existing install as it is, run 4 would have checked that old
build instead of the fixes. Where the package has an installer, Enter now
installs it over the existing install and keeps it; "p" checks the install
as it is, "n" removes it first, "a" leaves part 3 out. Without an
installer, Enter still checks the existing install.

The report now records which build part 3 checks: the uninstall entry's
DisplayVersion, the installed ogc.exe --version, the SHA-256 of bin\ogc.exe
and bin\ogc-gui.exe and of the installer that ran, and whether bin\ogc.exe
is the package's ogc.exe. Where this package's installer ran, another
ogc.exe is a failed step; where the install was checked as it is, a note.

ANLEITUNG.txt asks for Enter in this run and keeps "p" for a run that
should install nothing. The plain helper checks move to run-tests.tests.ps1
to keep installer-test.tests.ps1 under 500 lines.
Measure the toast in its place, not sliding in
All checks were successful
CI / Windows, MSYS2 sysroot (pull_request) Successful in 23s
CI / Windows, command line (clippy with tests) (pull_request) Successful in 44s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m54s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m30s
CI / Windows, GTK with AccessKit (pull_request) Successful in 47s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 2m33s
CI / Format, lint and test (pull_request) Successful in 5m54s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 2m47s
CI / Bundle programs, command line and helper (pull_request) Successful in 2m26s
CI / Arch package (pull_request) Successful in 3m9s
CI / Windows, installer and portable zip (pull_request) Successful in 6m40s
CI / Bundle programs, desktop app (pull_request) Successful in 3m0s
CI / Bundle for any distribution (pull_request) Successful in 40s
CI / Release (pull_request) Has been skipped
VM test / Migrations in a VM (pull_request) Successful in 17m40s
a536b12e64
On a busy machine the layout test found the toast mid-animation, still
over the page's bottom bar. It now turns GTK's animations off while it
measures, and back on afterwards.
SkyfaR manually merged commit 33454a3947 into main 2026-10-06 15:56:17 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LevelXStudios/OpenGameCompressor!38
No description provided.