1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-02-01 19:15:01 +02:00

Desktop: Trying to fix issue with permission errors when installing a plugin

This commit is contained in:
Laurent Cozic 2024-11-17 18:21:49 +00:00
parent 7faed0d291
commit fb6a807a37

View File

@ -584,7 +584,17 @@ export default class PluginService extends BaseService {
// from where it is now to check that it is valid and to retrieve
// the plugin ID.
const preloadedPlugin = await this.loadPluginFromPath(jplPath);
await this.deletePluginFiles(preloadedPlugin);
try {
await this.deletePluginFiles(preloadedPlugin);
} catch (error) {
// Deleting the plugin appears to occasionally fail on Windows (maybe because the files
// are still loaded?), and it prevents the plugin from being installed. Because of this
// we just ignore the error - it means that there will be unnecessary files in the cache
// directory, which is not a big issue.
//
// Ref: https://discourse.joplinapp.org/t/math-mode-plugin-no-longer-works-in-windows-v3-1-23/41853
logger.warn('Could not delete plugin temp directory:', error);
}
// On mobile, it's necessary to create the plugin directory before we can copy
// into it.