diff options
author | dorme | 2010-07-14 22:04:31 +0000 |
---|---|---|
committer | dorme | 2010-07-14 22:04:31 +0000 |
commit | 418ac18fed0390e1931041b8b7d5a2098f8215be (patch) | |
tree | d9f44cfa323c780d83c150b5ce8918dd1773a838 | |
parent | 878932302eee9a8fdbe32c0e8d310359c790e859 (diff) | |
download | org.eclipse.e4.deeplink-418ac18fed0390e1931041b8b7d5a2098f8215be.tar.gz org.eclipse.e4.deeplink-418ac18fed0390e1931041b8b7d5a2098f8215be.tar.xz org.eclipse.e4.deeplink-418ac18fed0390e1931041b8b7d5a2098f8215be.zip |
Fixed some cross-platform path handling bugs; reimplemented the launcher.exe fix.
-rw-r--r-- | bundles/org.eclipse.e4.core.deeplink/src/org/eclipse/e4/core/deeplink/internal/InstallationLauncher.java | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/bundles/org.eclipse.e4.core.deeplink/src/org/eclipse/e4/core/deeplink/internal/InstallationLauncher.java b/bundles/org.eclipse.e4.core.deeplink/src/org/eclipse/e4/core/deeplink/internal/InstallationLauncher.java index f6b72f6..0e54e4a 100644 --- a/bundles/org.eclipse.e4.core.deeplink/src/org/eclipse/e4/core/deeplink/internal/InstallationLauncher.java +++ b/bundles/org.eclipse.e4.core.deeplink/src/org/eclipse/e4/core/deeplink/internal/InstallationLauncher.java @@ -57,7 +57,7 @@ public class InstallationLauncher { if (!commandLine.hasValue()) {
throw new IllegalArgumentException("Unable to launch installation: " + installation);
}
- String commandDir = rootFolder + "\\" + installation;
+ String commandDir = rootFolder + File.separator + installation;
startApplication(commandLine.get(), commandDir);
}
@@ -99,20 +99,35 @@ public class InstallationLauncher { } catch (IOException e) {
throw new RuntimeException("Unable to launch: " + command, e);
}
- }
+ } + + String[] startupCommands = new String[] { + "eclipse.exe", + "eclipse", + "launcher.exe", + "launcher" + };
private Option<String> computeStartupCommandLine(String installation,
- String command) {
+ String command) { + // Try whatever's in the properties file (if anything)
Option<String> result = validateCommand(installation, command);
if (result.hasValue()) {
return result;
- }
- return validateCommand(installation, "eclipse.exe");
+ } + // Fall back to Eclipse default commands + for (String possibleCommand : startupCommands) { + Option<String> possibleResult = validateCommand(installation, possibleCommand); + if (possibleResult.hasValue()) { + return possibleResult; + } + } + return none();
}
private Option<String> validateCommand(String installation, String command) {
if (command != null) {
- String commandLine = rootFolder + "\\" + installation + "\\" + command;
+ String commandLine = rootFolder + File.separator + installation + File.separator + command; if (new File(commandLine).exists()) {
return some(commandLine);
} else {
|