private boolean prepareToInstallWithCallback(@NotNull PluginNode pluginNode,
                                               @NotNull List<PluginId> pluginIds) throws IOException {
    PluginId id = pluginNode.getPluginId();
    ActionCallback localCallback = myLocalInstallCallbacks.remove(id);

    if (localCallback == null) {
      ActionCallback callback = myLocalWaitInstallCallbacks.remove(id);
      if (callback == null) {
        return prepareToInstall(pluginNode, pluginIds);
      }
      return callback.waitFor(-1) && callback.isDone();
    }
    else {
      try {
        boolean result = prepareToInstall(pluginNode, pluginIds);
        removeInstallCallback(id, localCallback, result);
        return result;
      }
      catch (IOException | RuntimeException e) {
        removeInstallCallback(id, localCallback, false);
        throw e;
      }
    }
  }
private boolean prepareToInstallWithCallback(@NotNull PluginNode pluginNode,
                                               @NotNull List<PluginId> pluginIds)