The previous implementation joined std::env::args() with single spaces,
which silently broke any argument containing whitespace, double quotes,
or trailing backslashes — most importantly manifest paths under
'C:\Program Files' or 'C:\Users\<name with space>'. After elevation
the relaunched process saw a different argv than the original.
quote_command_line_arg follows the standard MSVCRT / CommandLineToArgvW
encoding: quote on space/tab/quote/empty, escape embedded quotes with a
preceding backslash, and double any run of backslashes that would
otherwise be consumed by a following quote (including the closing one).
Tests cover the canonical edge cases plus a round-trip that re-parses
each encoded form with a reference argv parser to confirm fidelity.
Wine runs the test binary cleanly when targeting x86_64-pc-windows-gnu,
so wire that target's runner to wine in .cargo/config.toml. The default
windows-msvc build is unaffected.
README gains a 'Linux Cross-Build (Optional)' section with the dotnet
10 / mingw-w64 / wine prerequisites and the EnableWindowsTargeting=true
recipe needed to cross-build the net8.0-windows C# UI from Linux.
program_files_x86 and windows_dir were stored but never read after
construction; only their string forms via admin_roots are used.
Compute them as locals in PathResolver::new instead, silencing the
dead_code warning without expanding the public surface.
Replace the hardcoded "c:\\program files" / "c:\\windows" prefix
heuristic with a PathResolver::requires_admin method that matches
against runtime-resolved FOLDERID_ProgramFilesX64,
FOLDERID_ProgramFilesX86, and FOLDERID_Windows. Honors the MVP
"no hardcoded paths" rule, catches Program Files (x86) explicitly,
and works on non-C: Windows installs.
Match logic uses path-component boundaries so "C:\\Program Files
Custom" no longer false-positives against "C:\\Program Files".
Adds unit tests for the new method via a #[cfg(test)] constructor
that lets us seed roots without invoking Win32.