Uninstall Cleanup #836
Labels
Priority: 4 - Low
Severity: 3 - Low
Minimal impact, typically cosmetic issues or minor bugs affecting a few users.
Type: Enhancement
New feature or request
We will need to implement cleanup after uninstallation, generally the uninstall needs to clean up the following:
Windows:
Linux:
rm -rf
MacOs
What brought the issue?
Why do we need the above?
If we keep up the registry or any form of files, that means there won't be any clean install and may some issues persist. One of the issue did is the
URL SCHEME Protocol
, this will remain in the registry therefore when user tries with the new CTA toPlay/Install Game
if the launcher was once installed, and than uninstalled, it will by default think it is still installed and it breaks as unable to find the applicationHow to handle this on Windows?
For Electron apps packaged with Electron Builder, when you're working with custom NSIS scripts like build/customUninstall.nsh, you need to place these scripts in a location where Electron Builder can find them during the build process. The typical approach is to create a directory within your project structure dedicated to build configurations and scripts. Here's how you can organize it:
Create a Directory for Build Configurations: Inside your Electron project's root directory, create a folder named build. This is a conventional name, but you can choose another name if you prefer.
Place customUninstall.nsh in the Build Directory: Move or create your customUninstall.nsh script inside the build directory. This script contains your custom NSIS commands for handling uninstallation cleanup, as discussed.
Reference the Script in package.json: In your package.json file, under the build section, specifically within the nsis configuration, you need to reference the path to customUninstall.nsh relative to the project root. Assuming you've placed the script in the build directory as suggested, it would look something like this:
This setup tells Electron Builder to include and execute your custom NSIS script during the installation process. It's a neat way to ensure that your app cleans up after itself upon uninstallation, especially for custom URL schemes and other system-level changes your app might make.
The content example of the
.nsh
Elctron-Builder: https://www.electron.build/configuration/nsis.html
There is more to this, the testing part requires you to build the actual app, install and uninstall and check the registry everytime
If is root (All Users)
If single user
While through script as below:
The text was updated successfully, but these errors were encountered: