Merge remote-tracking branch 'origin/master' into prendota/plugin-manager-new-protocol
[idea/community.git] / platform / platform-impl / src / com / intellij / ide / plugins / PluginInstaller.java
index aad574287059f2097ba6d3c9afdc2c063885219d..8ff50f580e64912c56579d20dcaa7247f7abcf75 100644 (file)
@@ -224,9 +224,19 @@ public final class PluginInstaller {
         return false;
       }
 
-      if (PluginManagerCore.isIncompatible(pluginDescriptor)) {
-        String message = "Plugin '" + pluginDescriptor.getName() + "' is incompatible with this installation";
-        MessagesEx.showErrorDialog(parent, message, CommonBundle.getErrorTitle());
+      String incompatibleMessage = PluginManagerCore.getIncompatibleMessage(PluginManagerCore.getBuildNumber(),
+                                                                            pluginDescriptor.getSinceBuild(),
+                                                                            pluginDescriptor.getUntilBuild());
+      if (incompatibleMessage != null || PluginManagerCore.isBrokenPlugin(pluginDescriptor)) {
+        StringBuilder builder = new StringBuilder().append("Plugin '").append(pluginDescriptor.getName()).append("'");
+        if (pluginDescriptor.getVersion() != null) {
+          builder.append(" version ").append(pluginDescriptor.getVersion());
+        }
+        builder.append(" is incompatible with this installation");
+        if (incompatibleMessage != null) {
+          builder.append(": ").append(incompatibleMessage);
+        }
+        MessagesEx.showErrorDialog(parent, builder.toString(), CommonBundle.getErrorTitle());
         return false;
       }