nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.07k stars 624 forks source link

Add a silent uninstaller #16892

Closed Nael-Sayegh closed 3 weeks ago

Nael-Sayegh commented 1 month ago

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

NVDA offers a silent installer that can be used by specifying a configuration, which is very convenient for deployments on remote computers, such as with WAPT. However, it does not provide a silent uninstaller, which poses a problem if you want to uninstall it remotely when the user doesn't need it, as WAPT would. .Or it is not documented

Describe the solution you'd like

It would be practical to have a silent uninstall key available or to provide an argument to the uninstall.exe file to specify that it should be silent and remove the user's configuration.

Describe alternatives you've considered

None

Additional context

Nael-Sayegh commented 1 month ago

Does this function already exist @SaschaCowley ?

SaschaCowley commented 1 month ago

@Nael-Sayegh Not as far as I know.

wmhn1872265132 commented 1 month ago

NVDA can be uninstalled silently through uninstall.exe /S, but please note:

  1. The configuration files in %appdata%\NVDA need to be deleted manually;
  2. Since the uninstaller runs under ordinary user rights by default, it needs to be executed in a command line with administrator rights to uninstall correctly.
SaschaCowley commented 1 month ago

@wmhn1872265132 Is this documented anywhere?

wmhn1872265132 commented 1 month ago

This is a function provided by NSIS. NVDA has not found any documentation describing this function.

SaschaCowley commented 1 month ago

Thanks, @wmhn1872265132.

gerald-hartig commented 1 month ago

This is a duplicate of https://github.com/nvaccess/nvda/issues/16150, however it could be better documented. @Qchristensen

Qchristensen commented 1 month ago

Per @wmhn1872265132's Comment above, it sounds like this already works using the /S switch as an administrator, except for the %appdata%\NVDA folder. There are several issues which reference this:

6869 notes how add-ons are left after uninstall.

9596 requests an option to prompt whether to use or remove old configurations on install. I created that one out of the need that some users were uninstalling / reinstalling NVDA to fix an issue with a non-working configuration (they'd set the speed too fast, NVDA volume to silent, etc and thought reinstalling might fix it).

So, two or possibly three actions for this:

Can anyone confirm, are these (config & add-ons not being removed) the issues referred to about running uninstall with /S as a regular user rather than administrator, or are there more?

1) If the routine needs to run as administrator, can we prompt for admin access when running it?

2) Document in https://www.nvaccess.org/files/nvda/documentation/userGuide.html#CommandLineOptions the silent uninstall switch.

3) Should we consider an uninstall option (and associated command-line switch) to force deletion of add-ons and configuration files. This may resolve #9596, but in any case, is also likely the behaviour expected by corporate users.

wmhn1872265132 commented 1 month ago

It should be pointed out that NVDA's uninstaller does not support clearing user configuration files, so whether it is uninstalled through the command line or through the GUI, the configuration cannot be deleted.

Nael-Sayegh commented 1 month ago

@Qchristensen I think the default user directory should either be removed upon uninstallation, as this is the behavior expected by many users, or, as proposed, an option should be added to choose to remove it, which should also be possible via CMD. I believe that uninstallation via CMD should be indicated in the documentation, as it would make the work easier for IT services for the deployment of NVDA. One thing I haven't tested yet: is it possible to install NVDA via CMD by specifying a configuration to load for the user?

SaschaCowley commented 1 month ago

I think the default user directory should either be removed upon uninstallation, as this is the behavior expected by many users, or, as proposed, an option should be added to choose to remove it, which should also be possible via CMD.

I would vote for the latter. Many programs leave their user config present upon uninstallation to make things like repair installs easier. Nevertheless, a complete uninstall that removes all (reasonable) traces of NVDA should be an option.

I believe that uninstallation via CMD should be indicated in the documentation, as it would make the work easier for IT services for the deployment of NVDA.

Absolutely agreed. @coderabbitai please open an issue to document command line uninstallation of NVDA in the user guide.

One thing I haven't tested yet: is it possible to install NVDA via CMD by specifying a configuration to load for the user?

I don't know, but I doubt it. One thing that might work as a work around is to create a portable copy, configure as desired, then install from portable keeping the config. I think this is possible from the GUI, but I'm not sure about from the CLI.

coderabbitai[bot] commented 1 month ago

[!TIP] For best results, initiate chat on the files or code changes.

@SaschaCowley, I've opened an issue to document the command line uninstallation of NVDA in the user guide. This will help IT services in deploying NVDA more efficiently. You can find the new issue here: Issue #16966.

Regarding the installation via CMD by specifying a configuration to load for the user, it might be possible to create a portable copy, configure it as desired, and then install from the portable copy while keeping the configuration. However, this needs to be verified for CLI usage.

Analysis chain @SaschaCowley, I've opened an issue to document the command line uninstallation of NVDA in the user guide. This will help IT services in deploying NVDA more efficiently. Regarding the installation via CMD by specifying a configuration to load for the user, it might be possible to create a portable copy, configure it as desired, and then install from the portable copy while keeping the configuration. However, this needs to be verified for CLI usage.
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash gh issue create --title "Document command line uninstallation of NVDA in the user guide" --body "Per [@wmhn1872265132's Comment](https://github.com/nvaccess/nvda/issues/16892#issuecomment-2244047838), NVDA can be uninstalled silently through uninstall.exe /S. However, this process is not documented. The following actions are suggested: 1. Document the silent uninstall switch in https://www.nvaccess.org/files/nvda/documentation/userGuide.html#CommandLineOptions. 2. Consider adding an uninstall option (and associated command-line switch) to force deletion of add-ons and configuration files. This documentation would greatly assist IT services in deploying NVDA more efficiently. Referenced Issues: - #6869: Add-ons left after uninstall. - #9596: Option to prompt whether to use or remove old configurations on install. For further context, see the discussion in [Issue #16892](https://github.com/nvaccess/nvda/issues/16892)." --assignee SaschaCowley ``` Length of output: 1010

Learnings added ``` Learnt from: SaschaCowley URL: https://github.com/nvaccess/nvda/issues/16892 Timestamp: 2024-08-05T23:09:38.256Z Learning: Document the command line uninstallation process for NVDA in the user guide. ``` --- ``` Learnt from: SaschaCowley URL: https://github.com/nvaccess/nvda/issues/16892 Timestamp: 2024-08-05T23:09:38.256Z Learning: Document the command line uninstallation process for NVDA in the user guide. ``` > Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure [review instructions](https://docs.coderabbit.ai/guides/review-instructions). You can manage existing learnings in the [app](https://app.coderabbit.ai/learnings).
Nael-Sayegh commented 1 month ago

@SaschaCowley It is true that many programs leave their configuration behind, and NVDA would do well to follow this way of functioning. Adding an option to delete it seems like a good alternative. I think your solution of installing a portable copy could work, thanks to the --copy-portable-config argument which seems to copy the portable configuration of NVDA to the new installation. What do you think?

SaschaCowley commented 1 month ago

Yes, I believe that's currently the only option to install with a custom config (short of making your own build that does what so).

Nael-Sayegh commented 3 weeks ago

@SaschaCowley Yes, I think we can close this ticket since @coderabbitai has created another issue to document the uninstallation function.

coderabbitai[bot] commented 3 weeks ago

[!TIP] For best results, initiate chat on the files or code changes.

@Nael-Sayegh, that sounds like a good plan. Closing this ticket makes sense now that the documentation issue has been created. If there's anything else you need, feel free to reach out!


Learnings used ``` Learnt from: SaschaCowley PR: nvaccess/nvda#0 File: :0-0 Timestamp: 2024-08-05T23:09:38.422Z Learning: Document the command line uninstallation process for NVDA in the user guide. ``` --- ``` Learnt from: SaschaCowley PR: nvaccess/nvda#0 File: :0-0 Timestamp: 2024-08-05T23:09:38.422Z Learning: Document the command line uninstallation process for NVDA in the user guide. ```
SaschaCowley commented 3 weeks ago

Closed as this is currently possible. Documentation recommended, see https://github.com/nvaccess/nvda/issues/16966 for progress.