Skip to content

NVDA accidentally deleted a user's private files while creating a portable copy #16514

@cary-rowen

Description

@cary-rowen

background

In the NVDA Chinese community, a user reported an issue: while creating a portable copy of NVDA, they accidentally selected the root directory of the D drive as the target location, due to overlooking the fact that NVDA should be placed in a separate directory.

Below is a screenshot of a post made by a user on the BBS.

image

I have translated this user's Chinese post into English:

"Big trouble here! I was using the latest version of NVDA, 2024.1, to create a portable version. I wasn’t paying attention and just chose the D drive root directory as the location without creating a new folder. I also checked the option to copy the configuration files. There were no warnings at all, and then the creation process started! It took a really long time, maybe about a minute or more. After it was done, I opened 'This PC' and saw nothing but panes. I restarted Windows Explorer without noticing anything wrong at first. However, when I tried to open applications installed on the D drive, they all failed, reporting missing DLLs. I checked, and it turns out, every single DLL file was gone. It wiped out everything in every folder, sparing nothing—not even the corners. It deleted all my personal data, including some DLLs I had stored. So, this portable creation feature of NVDA is deadly! It wrecked my D drive without any warning. Now, I’m asking if there's any way to recover the data deleted by NVDA, though I know it’s a long shot. Also, I want to warn everyone not to choose any root directory as the location for creating the NVDA portable version. This has really done me in! I definitely need to reinstall my operating system now, and then try to recover my personal data. So annoying!"

some investigation

I read the source code of NVDA and found the cause of the problem

nvaccess/nvda/blob/master/source/installer.py#L230-L237

In simple terms, NVDA recursively removes files with specific extensions within the target directory and all its subdirectories.

Those removed include: ".pyc", ".pyo", ".pyd", ".dll", ".manifest".

From the context, it's evident that because the user set the D drive root directory as the target for creating the NVDA portable copy, the subsequent execution of the code led to the deletion of all files with the specified extensions that the user had. This resulted in the malfunction of software installed on the D drive and even the deletion of the user's valuable files.

I am hesitant to label this as the same category of issues as #3113 and #16443.
No matter the circumstances, the deletion of users' private files should not occur. It's important to note that setting the D drive as the target directory for the portable copy is not inherently a user error; in fact, it is permissible.

Steps to reproduce:

  1. Create an empty directory named "nvda" in the root of the D drive.
  2. Place test.dll, test.txt, and test.manifest in this directory.
  3. Inside d:\nvda, create a new directory named "test" and place test.dll, test.txt, and test.manifest in this newly created "test" directory.
  4. Create a portable copy of NVDA with the target directory set to d:\nvda.

Actual behavior:

After step (4) is completed, only test.txt remains; other files have been deleted.

Expected behavior:

These directories and files are unrelated to NVDA and are personal files of the user; they should not be deleted.

NVDA logs, crash dumps, and other attachments:

n/a

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

Potentially all versions

Windows version:

n/a

Name and version of other software in use when reproducing the issue:

n/a

Other information about your system:

n/a

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

n/a

If NVDA add-ons are disabled, is your problem still occurring?

yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions