nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Feature to automatically Create a new folder and put all files there when creating a portable copy

Open Adriani90 opened this issue 4 months ago • 13 comments

Is your feature request related to a problem? Please describe.

Summary of #3113. When creating a portable copy, over 100 files are being thrown in the location chosen in the portable installer. However, if a folder with many other files is chosen accidentally, the files are scattered all around and it is overly complicated to collect them and put them into a separate folder.

Even worse, as described in #16514, our cleanup code for DLLs and similar files, will delete important existing files from the current folder.

Describe the solution you'd like

Among the solutions proposed in #3113, most people agreed they wish to have NVDA creating a folder upon installing the portable copy. Drawbacks pointed out by @jcsteh:

  • People might want to specify folder name by themselves
  • Adding a subfolder automatically might add confusions to the path when accessing it via the run dialog or when an external device should contain NVDA portable copy on the root.
  • Backwards compatibility from an UX perspective.

Mittigants:

  1. The label of the current edit field called "portable directory" could be renamed to "location for the portable copy"
  2. There could be a checkbox in the portable copy installer called "create a sub directory for the portable copy" located right next to the browse button
  3. When an user activates the checkbox, an additional edit field appears with the label "name of portable sub directory". This edit field could be automatically populated with "NVDA". This way, users could decide tehmselves if they want to throw all files in the "location for the portable directory", or if they prefer to activate the checkbox to create a sub directory with a specific name in that location.

Describe alternatives you've considered

As proposed by Jamie, A dialog warning the user that the location chosen contains already other files. However, this will be also shown when overriding an existing portable copy and could be confusing for users from an UX perspective.

Additional context

n/a

Adriani90 avatar Apr 23 '24 20:04 Adriani90

@seanbudd if such summaries are prefered by NV Access, I can start working on things like this for old issues that contain very long discussions. I guess #3113 is quite well summarized here now.

Adriani90 avatar Apr 23 '24 20:04 Adriani90

  1. There could be a checkbox in the portable copy installer called "create a sub directory for the portable copy" located right next to the browse button
  2. When an user activates the checkbox, an additional edit field appears with the label "name of portable sub directory"

Sincerely, imho this risks to be further confusing for users, that probably avoid to change anything. Did you considered the @Qchristensen comment? It seems very reasonable...

ABuffEr avatar Apr 23 '24 20:04 ABuffEr

@ABuffEr that comment I saw, but I thought populating the edit field with /nvda automatically will add the risk that the user forgets this and installs NVDA accidentally to a subdirectory without removing the /nvda. That's why I thought adding the checkbox makes it more obvuious that a decision can be taken, and NVDA is still populated automatically in that new edit field. If the user doesn't want to change anything, the checkbox can stay disabled by default. But maybe I didn't fully understand that comment.

Adriani90 avatar Apr 23 '24 21:04 Adriani90

Another possible solution I thought of is to make the NVDA directory less complex by changing the folder structure of NVDA so that I don't have to add NVDA subfolders.

Implementation

  • Move files other than configuration files to a folder named with a version number (similar to the lib folder)
  • Create an NVDA.exe to start the NVDA.exe in the version folder

After doing this, only a few files/folders will exist in the NVDA root directory:

  • Version number folder (NVDA core file)
  • systemConfig/userConfig (NVDA configuration file)
  • NVDA.exe (NVDA launcher
  • Other required documents (if any)

Therefore, even if the user places the portable version where a large number of files exist, it will not be particularly troublesome to maintain. Doing this will also solve:

  • Error in which files cannot be replaced when NVDA is updated
  • Possibility of seamless updates in the background

Known issues:

If the version folder cannot be deleted when updating NVDA, several version folders may be generated after multiple updates.

wmhn1872265132 avatar Apr 24 '24 02:04 wmhn1872265132

@wmhn1872265132 thanks for this proposal, I'd rather see it as a further optimization of the current situation, but it doesn't solve the root problem. Still people will have to grab those files manually, but ofcourse your proposal goes into the right direction as well. However, I don't know how the paths are defined in NVDA and which files are imported from the root directory, so the implementation might have some higher complexity.

Adriani90 avatar Apr 24 '24 08:04 Adriani90

@wmhn1872265132 The simplification of directory contents idea is an interesting one. IMHO it needs its own issue however, as it might effect more than just this problem and should be triaged separately.

I would not want to wait on solving this one, while NV Access considers implications of that reorganization.

XLTechie avatar Apr 24 '24 09:04 XLTechie

For me the current situation i.e. NVDA placing its files exactly in the specified folder is the ideal behavior. I understand that this is suitable only for power users, so its not a good default. To mitigate this concern I'd suggest to go the other way around i.e. create the folder by default, but ad a check box named "Create NVDA folder in the specified location" or similar. This check box should be checked by default and when unchecked the current behavior should be preserved.

lukaszgo1 avatar Apr 27 '24 17:04 lukaszgo1

What @lukaszgo1 says is exactly what I was thinking as well. It seems like the most simple approach.

@Qchristensen's approach may be technically simpler, but I think it has too much potential for users to do something accidental or unexpected.

XLTechie avatar Apr 28 '24 22:04 XLTechie

We now consider this a p1 because of the arguments in #16514

On the folder selection dialog, there should be a checkbox that is default checked, for creating a new folder. When the checkbox is unchecked, there should be a warning dialog when selecting writing to a non-empty folder. if this is an existing NVDA folder it will upgrade safely.

seanbudd avatar May 10 '24 00:05 seanbudd

@seanbudd I may work on this if that is okay with you. Before starting I'd like to have clarification on the following:

there should be a warning dialog when selecting writing to a non-empty folder. if this is an existing NVDA folder it will upgrade safely.

Should this warning occur even for non-empty folders containing NVDA portable copy? On one hand warning users just wanting to upgrade their portable copy to the next version seems strange, but since there is no certainty they do not have other files there presenting the warning maybe safer in some edge cases. Note that we don't (and probably never would, as coming up with a reasonable UX seems impossible) present such warning when user uses updater to update a portable copy - there is no guarantee there are no additional files in the folder in which this copy resides.

lukaszgo1 avatar May 10 '24 16:05 lukaszgo1

I think it's worth always warning. Perhaps there can be two separate warnings:

  • existing portable copy detected, please confirm you'd like to update this copy and overwrite contents of this folder
  • no portable copy detected, please confirm you'd like to overwrite contents of this folder

seanbudd avatar May 13 '24 07:05 seanbudd

@seanbudd

  • existing portable copy detected, please confirm you'd like to update this copy and overwrite contents of this folder

However, if updating a portable copy, the folder contents are not all overwritten. Configuration, for example, is preserved.

It's more that contents other than NVDA will potentially be damaged, is it not?

XLTechie avatar May 13 '24 10:05 XLTechie

I think a folder being overwritten doesn't imply every file will be damaged. I'd rather not get into the semantics of the wording here, we can discuss that in the PR

seanbudd avatar May 14 '24 00:05 seanbudd