diff options
author | Ed Merks | 2016-08-18 11:58:18 +0000 |
---|---|---|
committer | Ed Merks | 2016-08-18 11:58:58 +0000 |
commit | 6b8afcf45a14c07ec831774ba668ff1bf3cd7e73 (patch) | |
tree | e00d074b9d537b20bb606566e8016ea0a84f9a0b /plugins/org.eclipse.oomph.util/src/org | |
parent | b269b2a1b6179c9569cd52554e43dfc7d4c0c715 (diff) | |
download | org.eclipse.oomph-6b8afcf45a14c07ec831774ba668ff1bf3cd7e73.tar.gz org.eclipse.oomph-6b8afcf45a14c07ec831774ba668ff1bf3cd7e73.tar.xz org.eclipse.oomph-6b8afcf45a14c07ec831774ba668ff1bf3cd7e73.zip |
[463967] Oomph should not use cGit resources
https://bugs.eclipse.org/bugs/show_bug.cgi?id=463967
Diffstat (limited to 'plugins/org.eclipse.oomph.util/src/org')
-rw-r--r-- | plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java | 40 |
1 files changed, 40 insertions, 0 deletions
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(); |