Create a new folder by default when making a portable copy, warn for non-empty directories#16686
Conversation
…non-empty directories
WalkthroughThe recent updates primarily enhance the creation of portable NVDA copies. Key improvements include adding a warning for non-empty directories, the option to create a new folder for the portable installation, and better command-line options for silent installation. These enhancements aim to prevent accidental file scatter and improve user flexibility during the installation process. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GUI
participant Core
participant Filesystem
User->>GUI: Select 'Create Portable Copy' option
GUI-->>User: Prompt user to select directory
User->>GUI: Select directory
GUI-->>User: Display 'Create new folder' checkbox
User->>GUI: Check 'Create new folder'
GUI->>Core: Call `doCreatePortable` with new folder option
Core->>Filesystem: Check directory status
alt Directory Not Empty
Core->>GUI: Prompt warning for non-empty directory
GUI-->>User: Display warning for non-empty directory
User->>GUI: Confirm
end
Core->>Filesystem: Create portable copy in new folder
GUI-->>User: Notify completion
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
|
@coderabbitai the checkbox for copying current user configuration during portable copy creation is not new |
|
Tip For best results, initiate chat on the files or code changes. @seanbudd, thank you for pointing this out. The history check confirms that the If there's anything else you need, please let me know! Analysis chainScripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search the history of `installerGui.py` for the introduction or changes related to `copyUserConfigCheckbox`
git log -S'copyUserConfigCheckbox' --source --all -p src/installerGui.py
Length of output: 272 Script: #!/bin/bash
# Find the correct path for `installerGui.py`
fd installerGui.py
# Assuming the correct path is found, the following command should be used:
# git log -S'copyUserConfigCheckbox' --source --all -p -- <correct_path>
Length of output: 47 Script: #!/bin/bash
# Search the history of `installerGui.py` for the introduction or changes related to `copyUserConfigCheckbox`
git log -S'copyUserConfigCheckbox' --source --all -p -- source/gui/installerGui.py
Length of output: 22527 |
|
@coderabbitai full review |
|
I tested this PR and the GUI part is fine, however #16514 can still be reproduced through the command line |
|
@wmhn1872265132 I'd argue that |
|
@coderabbitai full review |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@gerald-hartig - I've addressed those comments |
| ### Create portable copy {#CreatePortableCopy} | ||
|
|
||
| This will open a dialog which allows you to create a portable copy of NVDA out of the installed version. | ||
| Either way, when running a portable copy of NVDA, in the extra tool sub menu the menu item will be called "install NVDA on this PC" instead of "create portable copy). |
There was a problem hiding this comment.
I don't think this is true, you can create a portable copy from a portable copy
Qchristensen
left a comment
There was a problem hiding this comment.
Good work, this will help avoid confusion.
See test results for failed build of commit 76aca61962 |
|
cc @gerald-hartig @seanbudd |
|
@cary-rowen - can you explain how it is unexpected with it being clearly flagged now with a warning? |
|
We cannot assume that all users of use this parameter are fully aware of it just because a special case is documented. |
|
The key here is that NVDA will delete the user's files, even if they have absolutely nothing to do with NVDA. |
|
@cary-rowen - are you talking particularly about the |
Fixup of #16686 Fixes #16847 Summary of the issue: When updating a portable copy either from the auto-update check UX, or through the portable copy CLI, a warning is shown to confirm if a user wants to update and overwrite the portable copy. This is not ideal UX, as the update check UX should assume the user wants to update, same with the portable copy CLI. Additionally, some translator strings in #16686 were not formatted correctly Description of user facing changes Warnings are no longer shown when updating a portable copy via the auto-update UX or via CLI. Warnings are still shown when overwriting any other directory via CLI. Messages in warning dialogs are now translatable correctly Description of development approach Fix format of translation strings check if an update is being performed when creating a portable copy via CLI, do not warn in that case. The portable copy auto-update UX uses the CLI to perform the update.
|
Question, and I'm not sure if it's intended behavior, but I notice that if I manually clear out a portable NVDA copy of everything but its userConfig directory, NVDA says that "[p]roceeding will delete and replace existing files in the directory." Once I do proceed though, the userConfig remains in existence. From reading the dialog and the issue summary, it sounds like existing files would both be deleted and replaced. While I am glad that my userConfig data wasn't deleted, should that have been the case? Or should the prompt be shortened to just: "Proceeding will replace existing files in the directory"? |
Link to issue number:
Fixes #16443
Summary of the issue:
When creating a portable copy, NVDA overwrites the contents of the folder. This may delete files like dlls.
This caused #16514 to be reported, as this can be quite destructive and unexpected.
Typical behaviour for writing to a directory like this involves creating a new folder to write the contents to.
However, portable copies can also be upgraded, so it is important to be able to support writing to existing portable copy directories.
Description of user facing changes
When creating a portable copy, a new checkbox has been added to create a new folder for the portable copy, which is checked by default.
If this box is unchecked, a warning dialog will appear if the directory is non-empty.
The directory contains
nvda.exewe assume its a portable copy directory, and confirm the user wishes to upgrade the portable copy.The directory is otherwise non-empty, a general warning dialog is opened warning the user that the contents of the folder will be overwritten.
Description of development approach
Added GUI elements to the create portable copy dialog
Testing strategy:
Manual testing
--create-portable-silent: no warning should appear--create-portable: warnings should appear for non-empty, and upgradesKnown issues with pull request:
Code Review Checklist:
Summary by CodeRabbit
New Features
Documentation
--create-portableand--create-portable-silentcommand line options.