Skip to content

Commit

Permalink
Added version detection of 8 and 11 in Moonshine Settings and tick th…
Browse files Browse the repository at this point in the history
…e getting-started listing (#38)
  • Loading branch information
rat-moonshine committed Mar 10, 2021
1 parent 0f65c2e commit 9e6e3ff
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ package actionScripts.interfaces

function get playerglobalExists():Boolean;
function set playerglobalExists(value:Boolean):void;
function get javaVersionForTypeahead():String;
function get javaVersionInJava8Path():String;
}
}
14 changes: 12 additions & 2 deletions InstallerSharedCore/src/actionScripts/managers/DetectionManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,20 @@ package actionScripts.managers
item.isAlreadyDownloaded = model.moonshineBridge.isGrailsPresent();
break;
case ComponentTypes.TYPE_OPENJAVA:
item.isAlreadyDownloaded = model.moonshineBridge.isJavaPresent();
if (model.moonshineBridge.isJavaPresent())
{
item.isAlreadyDownloaded =
(HelperUtils.isNewUpdateVersion(model.moonshineBridge.javaVersionForTypeahead, "11.0.10") != 1) ?
true : false;
}
break;
case ComponentTypes.TYPE_OPENJAVA_V8:
item.isAlreadyDownloaded = model.moonshineBridge.isJava8Present();
if (model.moonshineBridge.isJava8Present())
{
item.isAlreadyDownloaded =
(HelperUtils.isNewUpdateVersion(model.moonshineBridge.javaVersionInJava8Path, "1.8.0") != 1) ?
true : false;
}
break;
case ComponentTypes.TYPE_GIT:
item.isAlreadyDownloaded = model.moonshineBridge.isGitPresent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ package actionScripts.utils

private var errorCloseData:String;
private var outputData:String = "";
private var onComplete:Function;

public function readVersion(javaPath:String=null):void
public function readVersion(javaPath:String=null, onComplete:Function=null):void
{
this.onComplete = onComplete;

var tmpArgs:Vector.<String> = javaPath ?
new <String>[javaPath +"\\bin\\java", "-version"] :
new <String>["java", "-version"];
Expand Down Expand Up @@ -73,6 +76,7 @@ package actionScripts.utils

// pass completion
if (errorCloseData) this.dispatchEvent(new HelperEvent(ENV_READ_ERROR, errorCloseData));
onComplete = null;
}
}

Expand All @@ -91,6 +95,10 @@ package actionScripts.utils

// pass completion
this.dispatchEvent(new HelperEvent(ENV_READ_COMPLETED, version));
if (onComplete != null)
{
onComplete(version);
}
}
}
}

0 comments on commit 9e6e3ff

Please sign in to comment.