From 6b8afcf45a14c07ec831774ba668ff1bf3cd7e73 Mon Sep 17 00:00:00 2001 From: Ed Merks Date: Thu, 18 Aug 2016 13:58:18 +0200 Subject: [463967] Oomph should not use cGit resources https://bugs.eclipse.org/bugs/show_bug.cgi?id=463967--- .../src/org/eclipse/oomph/util/OS.java | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'plugins/org.eclipse.oomph.util/src/org') diff --git a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java index 506b9afae..9ddfa0637 100644 --- a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java +++ b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java @@ -232,6 +232,46 @@ public abstract class OS return launcherName; } + public static String getCurrentLauncher(boolean console) + { + try + { + String launcher = PropertiesUtil.getProperty("eclipse.launcher"); + if (launcher != null) + { + File launcherFile = new File(launcher); + if (launcherFile.isFile()) + { + File result = IOUtil.getCanonicalFile(launcherFile); + if (INSTANCE.isWin()) + { + // If we don't need a console, but actually ended up here with eclipsec.exe, we don't try to find the product-specifically named executable. + if (console) + { + File parentFolder = result.getParentFile(); + if (parentFolder != null) + { + File consoleLauncher = new File(parentFolder, "eclipsec.exe"); + if (consoleLauncher.isFile()) + { + return consoleLauncher.getPath(); + } + } + } + } + + return result.getPath(); + } + } + } + catch (Throwable ex) + { + //$FALL-THROUGH$ + } + + return null; + } + public abstract String getGitPrefix(); public abstract String getJREsRoot(); -- cgit v1.2.3