Skip to content

Commit 8b642e7

Browse files
Merge pull request #28 from CommonWealthRobotics/kh/fix-networkless-startup
close #27
2 parents 034f77a + 2a0b3b6 commit 8b642e7

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

CaDoodleUpdater/src/main/java/com/commonwealthrobotics/CadoodleUpdater.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ public void launchApplication() {
195195
yesButton.setDisable(true);
196196
noButton.setDisable(true);
197197
});
198-
198+
// Run this later to show downloading the JVM
199+
Platform.runLater(() -> stage.close());
199200
new Thread(() -> {
200201
String command;
201202
try {
@@ -207,8 +208,7 @@ public void launchApplication() {
207208
return;
208209
}
209210

210-
// Run this later to show downloading the JVM
211-
Platform.runLater(() -> stage.close());
211+
212212

213213
try {
214214
Thread.sleep(100);
@@ -443,9 +443,9 @@ void initialize() {
443443
try {
444444
readCurrentVersion("https://api.github.com/repos/" + project + "/" + repoName + "/releases/latest");
445445
binary.setText(project + "\n" + repoName + "\n" + jarName + "\n" + (sizeOfJar / 1000000) + " MB");
446-
} catch (IOException e) {
446+
} catch (Exception e) {
447447
// TODO Auto-generated catch block
448-
e.printStackTrace();
448+
//e.printStackTrace();
449449
noInternet=true;
450450
}
451451
}

CaDoodleUpdater/src/main/java/com/commonwealthrobotics/JvmManager.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static String getCommandString(String project, String repo, String versio
9090
String name = vm.get("name").toString();
9191
List<String> jvmargs = null;
9292
Object o = vm.get("jvmargs");
93-
System.out.println("jvmargs: " + jvmargs);
93+
System.out.println("jvmargs: " + o);
9494
if (o instanceof List) {
9595
@SuppressWarnings("unchecked")
9696
List<String> tmp = (List<String>) o;
@@ -271,11 +271,18 @@ public static long getRemoteSize(String url) throws IOException {
271271
private static File download(String version, String downloadURL, ProgressBar progressBar, Label progressLabel,
272272
String bindir, String filename) throws MalformedURLException, IOException, FileNotFoundException {
273273
File exeFinal = null;
274+
275+
274276

275-
System.out.printf("Downloading %s %n", downloadURL);
276277
File folder = new File(bindir + version + "/");
277278
File exe = new File(bindir + version + "/" + filename + "_TMP");
278279
exeFinal = new File(bindir + version + "/" + filename);
280+
if(exeFinal.exists()) {
281+
System.out.println("Skip Downloading "+ exeFinal+" exists already");
282+
return exeFinal;
283+
}
284+
285+
System.out.printf("Downloading %s %n", downloadURL);
279286

280287
if (downloadURL != null) {
281288
long sizeOfJson = getRemoteSize(downloadURL);

0 commit comments

Comments
 (0)