nsis uninstaller not deleting registry for electron app - nsh script

  • 9 months ago
Comment

ChatGPT
1 / 1

If the NSIS uninstaller is not deleting the registry entries for your Electron app, there could be a few reasons for this issue. Here are some steps to troubleshoot and fix the problem:

  1. Check Registry Paths: Ensure that the registry paths you are using in your NSIS uninstaller script (*.nsh) are correct and match the paths used during installation. It's common for issues to arise if the paths don't match exactly.

  2. Use Correct Root Key: Make sure you are using the correct root key for the registry entries. Common root keys are HKEY_LOCAL_MACHINE (HKLM) and HKEY_CURRENT_USER (HKCU). Depending on whether your app is installed per user or for all users, you should use the appropriate root key.

  3. Use DeleteRegKey: To delete a registry key and its subkeys, you should use the DeleteRegKey function. Here's an example:

    nsis
    !include "Registry.nsh"
    Section Uninstall
    DeleteRegKey HKLM "SOFTWARE\YourAppKey"
    SectionEnd
  4. Check Uninstall Key: In Windows, applications are typically registered under the Uninstall key in the registry. Make sure that your application's uninstall information is correctly added to this key during installation.

  5. Run the Uninstaller as Administrator: Sometimes, registry changes might require administrative privileges. Ensure that your uninstaller is executed with elevated permissions.

  6. Debugging: Add debug messages to your uninstaller script to see if it's reaching the part that deletes the registry entries. This can help you identify if the problem is with the script or with the registry keys.

  7. Uninstall Sequence: Check the sequence of uninstallation. Ensure that the registry deletion is happening before any files or folders are removed.

  8. Permissions: Ensure that the user running the uninstaller has sufficient permissions to delete registry keys. Administrative privileges might be required.

  9. NSIS Versions: Ensure that you are using a stable version of NSIS. Some older versions might have issues that have been fixed in later releases.

If you've tried the above steps and still face issues, it might be helpful to provide more specific details about your NSIS uninstaller script and how it's used in your Electron app's setup. This can help diagnose the problem more accurately.