boolean (@NotNull Path file, @Nullable JComponent parent, @NotNull IdeaPluginDescriptorImpl descriptor) { Path targetFile = installWithoutRestart(file, descriptor, parent); if (targetFile == null) { return false; } IdeaPluginDescriptorImpl targetDescriptor = PluginDescriptorLoader.loadDescriptor(targetFile, false, PluginXmlPathResolver.DEFAULT_PATH_RESOLVER); if (targetDescriptor == null) { return false; } PluginId targetPluginId = targetDescriptor.getPluginId(); if (DROP_DISABLED_FLAG_OF_REINSTALLED_PLUGINS && // IDEA-329952 PluginEnabler.HEADLESS.isDisabled(targetPluginId)) { var pluginSet = PluginManagerCore.INSTANCE.getPluginSet(); var wasInstalledBefore = pluginSet.isPluginInstalled(targetPluginId); if (!wasInstalledBefore) { // FIXME can't drop the disabled flag first because it's implementation filters ids against the current plugin set; // so load first, then enable targetDescriptor.setEnabled(true); var result = DynamicPlugins.INSTANCE.loadPlugin(targetDescriptor); PluginEnabler.HEADLESS.enable(Set.of(targetDescriptor)); return result; } } return PluginEnabler.HEADLESS.isDisabled(targetPluginId) || DynamicPlugins.INSTANCE.loadPlugin(targetDescriptor); }