No longer fail to restart NVDA when running from sources and started given relative path to nvda.pyw#11904
Merged
michaelDCurran merged 1 commit intoDec 7, 2020
Conversation
…d is different to the sources dir
michaelDCurran
approved these changes
Dec 7, 2020
michaelDCurran
left a comment
Member
There was a problem hiding this comment.
Good work. That has confused me as to why that did not work for years.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None
Summary of the issue:
When running nvda from sources using a relative path such as
pythonw source\nvda.pywNVDA failed to restart. This was caused by the fact thatshellapi.ShellExecuteexecutes given process using cwd as the directory from which the given command should be running and when NVDA starts it changes cwd to its own source directory.Description of how this pull request fixes the issue:
When restarting NVDA
globalVars.appdiris used as a directory from which new process should be started. While at it I've also made the restart code more compact by removing unneeded parameters fromsys.argv.in a loop.Testing performed:
with NVDA repository at
d:\my_repos\nvdastarted NVDA with the following invocations and ensured it can be restarted successfully:I've also ensured that binary version of NVDA can be restarted successfully with these changes.
Known issues with pull request:
None known
Change log entry:
I don't think changelog entry is needed here - this would affect only developers and this issue was present for a long time.