def _delete_plugin_key_from_windows_registry(self) -> None:
        """
        Deletes the PluginsKey dir in the Windows registry.
        """
        from winreg import ConnectRegistry, OpenKey, HKEY_LOCAL_MACHINE

        command = f'delete "{self.keyfile_windows}" /f'
        self._run_win_regedit_as_admin(command)

        try:
            # do a sanity check to see if the key has been deleted
            with ConnectRegistry(None, HKEY_LOCAL_MACHINE) as hkey:
                with OpenKey(hkey, r'SOFTWARE\Electrum\PluginsKey'):
                    raise Exception(f'Key {self.keyfile_windows} still exists, deletion failed')
        except FileNotFoundError:
            pass

        Deletes the PluginsKey dir in the Windows registry.
        
electrum/plugin.py