diff --git a/updater/src/com/intellij/updater/Bootstrap.java b/updater/src/com/intellij/updater/Bootstrap.java index e749adfa29a6..2406ae30f644 100644 --- a/updater/src/com/intellij/updater/Bootstrap.java +++ b/updater/src/com/intellij/updater/Bootstrap.java @@ -25,6 +25,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * @author Konstantin Bulenkov @@ -38,6 +39,12 @@ public class Bootstrap { InvocationTargetException, IllegalAccessException, InterruptedException { if (args.length != 1) return; String path = args[0].endsWith("\\") || args[0].endsWith("/") ? args[0] : args[0] + File.separator; + if (isMac() && path.endsWith(".app/")) { + final File file = new File(path + "Contents"); + if (file.exists() && file.isDirectory()) { + path += "Contents/"; + } + } cleanUp(); @@ -107,4 +114,8 @@ public class Bootstrap { //noinspection CallToPrintStackTrace ex.printStackTrace(); } + + private static boolean isMac() { + return System.getProperty("os.name").toLowerCase(Locale.US).startsWith("mac"); + } }