Skip to content

Commit

Permalink
Desktop: Trying to fix issue with permission errors when installing a…
Browse files Browse the repository at this point in the history
… plugin
  • Loading branch information
laurent22 committed Nov 17, 2024
1 parent 7faed0d commit fb6a807
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/lib/services/plugins/PluginService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fb6a807

Please sign in to comment.