Fixed some cross-platform path handling bugs; reimplemented the launcher.exe fix.
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 @@
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 @@
} 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 {