Search code examples
pluginspycharmintellij-plugin

Plugin verification after install


I am developing a plugin that requires some additional software to be installed. What I am trying to do is, when I install for the first time the plugin it checks if the software is installed in the machine. If it isn't installed it prompts a dialog, for example that have a button to install it. Is it possible? I am developing this plugin for PyCharm using gradle.


Solution

  • I'd register a listener to com.intellij.openapi.project.ProjectManagerListener topic (see https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_listeners.html) and on project opening I'd check if the software is installed.

    Once the check is done, I'd save some flag to settings (see https://www.jetbrains.org/intellij/sdk/docs/basics/persisting_state_of_components.html) and read it on the next project opening before checking if the software is installed.