private boolean performUninstall(@NotNull IdeaPluginDescriptorImpl descriptorImpl) {
    boolean needRestartForUninstall = true;
    try {
      if (!isBundledUpdate(descriptorImpl)) {
        PluginEnabler enabler = HEADLESS;
        if (enabler.isDisabled(descriptorImpl.getPluginId())) {
          enabler.enable(Collections.singletonList(descriptorImpl));
        }
      }
      descriptorImpl.setDeleted(true);
      needRestartForUninstall = PluginInstaller.prepareToUninstall(descriptorImpl);
      InstalledPluginsState.getInstance().onPluginUninstall(descriptorImpl, !needRestartForUninstall);
      if (!needRestartForUninstall) {
        myDynamicPluginsToUninstall.add(descriptorImpl);
      }
    }
    catch (IOException e) {
      LOG.error(e);
    }
    return needRestartForUninstall;
  }
private boolean performUninstall(@NotNull IdeaPluginDescriptorImpl descriptorImpl)