|
@@ -3,7 +3,6 @@ package tools.hxinst;
|
|
class Main {
|
|
class Main {
|
|
|
|
|
|
static var SYS = neko.Sys.systemName();
|
|
static var SYS = neko.Sys.systemName();
|
|
- static var TMP = "tmp.txt";
|
|
|
|
static var NULL = if( SYS == "Windows" ) "NUL" else "/dev/null";
|
|
static var NULL = if( SYS == "Windows" ) "NUL" else "/dev/null";
|
|
static var wnd : xcross.Winlog;
|
|
static var wnd : xcross.Winlog;
|
|
|
|
|
|
@@ -54,6 +53,11 @@ class Main {
|
|
error("Command '"+cmd+"' failed !");
|
|
error("Command '"+cmd+"' failed !");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function commandOutput( cmd ) {
|
|
|
|
+ var p = try new neko.io.Process(cmd,[]) catch( e : Dynamic ) return "";
|
|
|
|
+ return p.stderr.readAll() + p.stdout.readAll();
|
|
|
|
+ }
|
|
|
|
+
|
|
function run() {
|
|
function run() {
|
|
try {
|
|
try {
|
|
install();
|
|
install();
|
|
@@ -116,9 +120,7 @@ class Main {
|
|
|
|
|
|
// GET haxe Version
|
|
// GET haxe Version
|
|
display("Getting Local haXe Version");
|
|
display("Getting Local haXe Version");
|
|
- neko.Sys.command("haxe 2>"+TMP);
|
|
|
|
- var content = neko.io.File.getContent(TMP);
|
|
|
|
- neko.FileSystem.deleteFile(TMP);
|
|
|
|
|
|
+ var content = commandOutput("haxe");
|
|
var r = ~/^Haxe Compiler ([0-9]+)\.([0-9]+)/;
|
|
var r = ~/^Haxe Compiler ([0-9]+)\.([0-9]+)/;
|
|
var haxeVersion = null;
|
|
var haxeVersion = null;
|
|
if( r.match(content) )
|
|
if( r.match(content) )
|
|
@@ -130,9 +132,7 @@ class Main {
|
|
|
|
|
|
// GET Neko Version
|
|
// GET Neko Version
|
|
display("Getting Local Neko Version");
|
|
display("Getting Local Neko Version");
|
|
- neko.Sys.command("neko >"+TMP+" 2>"+NULL);
|
|
|
|
- var content = neko.io.File.getContent(TMP);
|
|
|
|
- neko.FileSystem.deleteFile(TMP);
|
|
|
|
|
|
+ var content = commandOutput("neko");
|
|
var r = ~/^NekoVM ([0-9]+)\.([0-9]+)(\.([0-9]+))?/;
|
|
var r = ~/^NekoVM ([0-9]+)\.([0-9]+)(\.([0-9]+))?/;
|
|
var nekoVersion = null;
|
|
var nekoVersion = null;
|
|
if( r.match(content) )
|
|
if( r.match(content) )
|