Fix-up of pr #9679: Once again allow to copy configuration when installing from a portable NVDA.#12076
Conversation
|
Is it possible to postpone the release of 2020.4 to incorporate this fix PR? |
|
hello @lukaszgo1 |
LeonarddeR
left a comment
There was a problem hiding this comment.
2020.4 has been released. This fix will be in 2021.1.
feerrenrut
left a comment
There was a problem hiding this comment.
Generally this looks good @lukaszgo1
Could you please run through the testing for #9679 and add the procedure and results to the testing section of this PR? I'm a little concerned this may break cases for that. Does this change now allow config to be copied to itself with the --copy-portable-config option?
I think the help for --copy-portable-config is now misleading, to me it sounds like you must also specify --config-path for it to work? Could you confirm or clarify the help please?
|
@feerrenrut wrote:
Done. As expected all cases from #9679 were working correctly with this PR as it only affects the checkbox being enabled and disabled and not the actual install procedure.
I'm afraid I don't understand what you're asking here. You cannot copy the config directory to itself obviously.
No you don't need to specify configPath for it to work. For me current help message is pretty clear - that is if you specify |
|
Perhaps you can explain the full flow for processes, rather than just the changes you are making. This would help anyone reading this to be on the same page with how the underlying system works. Since the failsafe in The help for It doesn't say what happens when there is no provided path. It should probably mention where the config is copied from when run as a portable copy explicitly. IE don't assume the reader know where a portable config is kept. |
|
@feerrenrut wrote:
In the
I've reworded the help message in a way which avoids mentioning |
|
@feerrenrut Would you be able to review latest changes here? It is pretty annoying to copy config from the portable version after installation each time. |
| # and configPath is not overridden by the user copying config during installation is rather pointless | ||
| # as we would copy it into itself. | ||
| # However, if a user wants to run the launcher with a custom configPath, | ||
| # it is likely that he wants to copy that configuration when installing. |
There was a problem hiding this comment.
configPath here sounds like the command line argument -c CONFIGPATH | --config-path=CONFIGPATH. Given this function is all about copying the configuration, I'd suggest using the terms 'source' or 'origin' configuration and 'destination' config to clarify. This also applies to variable names.
There was a problem hiding this comment.
Using configPath in this comment is appropriate because this function decides if config can be copied or not by looking at the value of globalVars.appArgs.configPath.
|
I think the docs for these commands could still be clarified, but first lets make sure we are on the same page about the behavior and intentions here. My understanding of this is:
The copy portable config code seems to consider running with the launcher, but what happens when this argument is used on an installed version of NVDA. I think it should probably give an error. |
In both these cases location of the config can be overwritten by providing
That's not true - if
That is an interesting point. Currently nothing happens but it is no different to other command line options which are not applicable in the current situation. Consider the following two cases:
I agree we should clean this up and present an error for options which are not applicable in the given state, however I don't think this should be done as part of tis PR. |
Can you clarify this. Running which executable from the CLI (launcher, portable NVDA, installed NVDA)? I seem to have confused two use cases here:
It might be helpful to explicitly mention (and give examples) of some of the CLI use cases in the docs. There are a lot permutations of arguments, ways to run them, and NVDA state. It would be easy for one of these situations to be broken. Anything we can do to reduce this would be good. It seems to me to only make sense to use the |
|
I feel most of the confusion here comes from naming of the argument since |
IMO, the flag may be renamed if it adds some clarity; also the flag documentation should be updated to cover all use cases. |
|
I'm in support of adding a new alias for this argument. But it would be good to name it carefully. I don't like the word "current", I think it is ambiguous between the running copy which is potentially very temporary and the already installed or about to be installed copy. What about
Then in the help for
|
This comment has been minimized.
This comment has been minimized.
|
|
|
@feerrenrut While I do share your concerns about better naming of this option, documentation not being extensive enough to cover all possible use cases and giving warnings when options not applicable in the current situation are provided from the CLI I feel it is way more important not to break GUI installations from the portable copies than improving command line arguments. Since it would be great to move this PR forward and include it in 2021.1 would you agree to proceed as follows:
I'd more than happy to work on this subsequently given I needed to familiarize myself with this code during this PR. Doing it as a follow up ensures that more common use case i.e installing from the GUI is not negatively affected by discussion about way less commonly used CLI options which it seems can take a while. |
|
Ok, I'm fine with that plan. Could you create an new issue to track improving the docs around these CLI arguments? |
…NVDA from the portable version on an user account without previous config in appdata.
…hen config should not be copied
|
@feerrenrut As a result of our discussion on this PR I've created:
I'm pretty sure all discussed points are captured in these issues but feel free to add to them if you feel something has been missed. |
Link to issue number:
Fixes #12071
Fixes #12205
Summary of the issue:
PR #9679 introduced additional command line parameter which allows to copy config from a portable NVDA during installation. Unfortunately it also made it impossible to copy config from a portable copy when installing manually on an user account without NVDA config in appdata (the corresponding option was disabled in the GUI).
Description of how this pull request fixes the issue:
Rather than disabling this option when result of
config.getUserDefaultConfigPathis the same as the current config path (which was also true for portable copies) I've added additional method which disables this option only when NVDA is started from the launcher and configPath is not overridden by the user, or in case of portable copies when config currently in use is placed in appdata, and therefore NVDA would copy it into itself.Please note that first two commits are merely updating copyright header (1f8a0fa), and cleaning up unused imports from the installer GUI (741c20b) there are no functional changes in them.
Testing strategy:
Manual testing:
-c %appdata%\nvdaensured that "copy portable config to the current user account" was disabled.It should be possible to create system test for this PR but it would require a big refactoring so that first test is executed in a portable copy and ensures that right options are shown in the installer and then subsequent tests are being run for an installed NVDA. I don't thing small change like this justifies the required effort.
I've also repeated tests from #9679:
Known issues with pull request:
None known
Change log entry:
Section: Bug fixes
Code Review Checklist:
This checklist is a reminder of things commonly forgotten in a new PR.
Authors, please do a self-review and confirm you have considered the following items.
Mark items you have considered by checking them.
You can do this when editing the Pull request description with an x:
[ ]becomes[x].You can also check the checkboxes after the PR is created.