New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinUpdater: Quote path for args when relaunching Dolphin. #11666
WinUpdater: Quote path for args when relaunching Dolphin. #11666
Conversation
|
since it only broke recently, i think it's better to only do this for CreateProcess path. also, if it's taking the ShellExecute path...it means the user is running dolphin as admin (or, the updater decided it needed to elevate), which Is Bad. And it appears to be in My Documents, which doesn't require admin, anyway. |
3f9cde9
to
33d0ec9
Compare
|
Fair enough. |
|
Also, you can use test-updater.py to repro the bug and check that it’s fixed (passing dir param to temporarydirectory). Maybe the test should just be changed to ensure there’s always a space and Unicode in the path or something… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to msdn both args to create process need quotes. Try using the test script :)
|
I did test this yesterday and it works as written, but yeah maybe some dumb Windows fallback is saving me here... (seriously though why is the API like this? yeah backcompat and all but this really feels like someone should have made a saner variant in a later windows version...) |
|
Btw the way I'm reading the MSDN doc is that the application name only needs to be quoted if either |
|
Okay, I tested this out under the following scenario taking into account the Security stuff on the MSDN page:
C# Code
We now attempt to launch this in a few different ways using Both parameters, both unquoted==> Launches correct executable (prints So we launched the correct file, but with the argument Both parameters, both quoted==> Does not launch anything. Prints Both parameters, lpApplicationName unquoted, lpCommandLine quoted==> Launches correct executable (prints So the process launched and did not get any arguments, exactly what we want. Both parameters, lpApplicationName quoted, lpCommandLine unquoted==> Does not launch anything. Prints For completeness sake: lpCommandLine only, unquoted==> Launches the wrong executable ( That's not too surprising, that's exactly what the MSDN article warns against doing. lpApplicationName only, unquoted==> Launches the correct executable ( This one actually surprises me! I would have expected this to behave the same as the lpCommandLine only variant based on the documentation. If we delete the correct executable this fails. ( lpApplicationName only, quoted==> Fails to launch anything. ( lpCommandLine only, quoted==> Launches the correct executable ( If we delete the executable it fails. ( |
|
Based on this:
|
|
tldr: The PR should be correct as-is. I'll also test |
Launches the correct executable, regardless of if I pass it quoted or unquoted. So that should also be fine as-is. If I delete the executable it just opens Explorer (in My Documents), which is weird but at least not harmful. |
|
It's been confirmed that this resolved the issue. https://forums.dolphin-emu.org/Thread-recent-update-triggering-this-error-on-auto-update?pid=529406#pid529406 |



This should fix https://forums.dolphin-emu.org/Thread-recent-update-triggering-this-error-on-auto-update
I think just adding quotes on both ends is enough, because a valid path on Windows cannot contain quotes by itself.