|
|
@ -2,7 +2,7 @@ package com.fr.start; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.stable.OperatingSystem; |
|
|
|
import com.fr.stable.os.OperatingSystem; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
@ -17,13 +17,15 @@ public class Demo { |
|
|
|
|
|
|
|
|
|
|
|
String executorPath; |
|
|
|
String executorPath; |
|
|
|
|
|
|
|
|
|
|
|
if (OperatingSystem.isMacOS()) { |
|
|
|
if (OperatingSystem.isMacos()) { |
|
|
|
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app"); |
|
|
|
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app"); |
|
|
|
} else { |
|
|
|
} else if(OperatingSystem.isWindows()){ |
|
|
|
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo"); |
|
|
|
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo"); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.sh demo"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (OperatingSystem.isMacOS()) { |
|
|
|
if (OperatingSystem.isMacos()) { |
|
|
|
ProcessBuilder builder = new ProcessBuilder(); |
|
|
|
ProcessBuilder builder = new ProcessBuilder(); |
|
|
|
builder.command("open", "-a", executorPath, "--args", "demo"); |
|
|
|
builder.command("open", "-a", executorPath, "--args", "demo"); |
|
|
|
try { |
|
|
|
try { |
|
|
@ -31,7 +33,7 @@ public class Demo { |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else if(OperatingSystem.isWindows()){ |
|
|
|
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
|
|
|
|
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
|
|
|
|
Runtime rt = Runtime.getRuntime(); |
|
|
|
Runtime rt = Runtime.getRuntime(); |
|
|
|
try { |
|
|
|
try { |
|
|
@ -39,6 +41,14 @@ public class Demo { |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
//先用和win一样的方式
|
|
|
|
|
|
|
|
Runtime rt = Runtime.getRuntime(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
rt.exec(executorPath); |
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
System.exit(0); |
|
|
|
System.exit(0); |
|
|
|