#54364: fix: match Windows login items when the executable path contains spaces
Description of Change
Fixes #53911.
After this change app.getLoginItemSettings() on Windows finds the entries setLoginItemSettings() wrote when the executable path contains a space (C:\Program Files\..., a user profile with a space), and executableWillLaunchAtLogin reports true for them.
The lookup ran the executable path through CommandLine::FromString, which splits an unquoted path at the first space, so it never matched the quoted Run values that setLoginItemSettings() writes and returned no launchItems.
The lookup now compares the path as a plain executable path, stripping surrounding quotes if the caller passed them, and the two existing quote-stripping sites share one helper. A spec round-trips an entry whose path contains spaces.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- tests are changed or added
Release Notes
Notes: Fixed app.getLoginItemSettings() not finding login items on Windows when the executable path contains spaces.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron