From ae26dc433ef2c428fb2159c1adec7fcc1912857b Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 2 Jun 2024 15:58:07 -0400 Subject: [PATCH] simpler basic firmware updater fix #5577 --- firmware/CHANGELOG.md | 1 + .../com/rusefi/autoupdate/Autoupdate.java | 26 ++++++++++++------ misc/console_launcher/rusefi_updater.exe | Bin 88064 -> 88064 bytes misc/console_launcher/rusefi_updater.xml | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index 6c0f534b5b..c6cf068778 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -33,6 +33,7 @@ Release template (copy/paste this for new release): - configurable Open Loop Boost vertical axis #4778 - In Launch Control, add RPM Hysterisis #5610 - reduce JRE download complexity #6569 + - simpler basic firmware updater #5577 ### Fixed - knock logic not activated until any configuration change via TS #6462 diff --git a/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java b/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java index aac1e8475f..c2e5bb66b6 100644 --- a/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java +++ b/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java @@ -7,6 +7,7 @@ import com.rusefi.core.FileUtil; import com.rusefi.core.preferences.storage.PersistentConfiguration; import com.rusefi.core.ui.AutoupdateUtil; import com.rusefi.core.ui.FrameHelper; +import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; @@ -22,7 +23,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; public class Autoupdate { - private static final int VERSION = 20240531; + private static final int VERSION = 20240603; private static final String LOGO_PATH = "/com/rusefi/"; private static final String LOGO = LOGO_PATH + "logo.png"; @@ -60,18 +61,18 @@ public class Autoupdate { BundleUtil.BundleInfo bundleInfo = BundleUtil.parse(bundleFullName); String branchName = bundleInfo.getBranchName(); - if (args.length > 0 && args[0].equalsIgnoreCase("release")) { + @NotNull String firstArgument = args.length > 0 ? args[0] : ""; + + if (firstArgument.equalsIgnoreCase("basic-ui")) { + doDownload(bundleInfo, UpdateMode.ALWAYS); + } else if (args.length > 0 && args[0].equalsIgnoreCase("release")) { + // this branch needs progress for custom boards! System.out.println("Release update requested"); downloadAndUnzipAutoupdate(bundleInfo, UpdateMode.ALWAYS, ConnectionAndMeta.BASE_URL_RELEASE); } else { UpdateMode mode = getMode(); if (mode != UpdateMode.NEVER) { - System.out.println("Snapshot requested"); - if (branchName.equals("snapshot")) { - downloadAndUnzipAutoupdate(bundleInfo, mode, ConnectionAndMeta.getBaseUrl()+ ConnectionAndMeta.AUTOUPDATE); - } else { - downloadAndUnzipAutoupdate(bundleInfo, mode, ConnectionAndMeta.getBaseUrl() + "/lts/" + branchName + ConnectionAndMeta.AUTOUPDATE); - } + doDownload(bundleInfo, mode); } else { System.out.println("Update mode: NEVER"); } @@ -79,6 +80,15 @@ public class Autoupdate { startConsole(args); } + private static void doDownload(BundleUtil.BundleInfo bundleInfo, UpdateMode mode) { + if (bundleInfo.getBranchName().equals("snapshot")) { + System.out.println("Snapshot requested"); + downloadAndUnzipAutoupdate(bundleInfo, mode, ConnectionAndMeta.getBaseUrl()+ ConnectionAndMeta.AUTOUPDATE); + } else { + downloadAndUnzipAutoupdate(bundleInfo, mode, ConnectionAndMeta.getBaseUrl() + "/lts/" + bundleInfo.getBranchName() + ConnectionAndMeta.AUTOUPDATE); + } + } + private static void startConsole(String[] args) { try { // we want to make sure that files are available to write so we use reflection to get lazy class initialization diff --git a/misc/console_launcher/rusefi_updater.exe b/misc/console_launcher/rusefi_updater.exe index d106d5a0b6c232b8a08c6562277ca0a2b6ec6a9f..1476331d3ebc42affad9c15e3b673307a8cbbecc 100644 GIT binary patch delta 483 zcmZqJz}m2ZbwUSowsPFWZeOOS*CyUFV%n25`5}|>W=F<)M#epx4>CD_1j$ck|Dp<} z^}pzX>G&_A(m?Sv1~6b`U|?Zj$Y6r-KwnP&)A3(KrGesU3}C>>z`(-5kii7ufzz_yR^u3>irB6+pfn5?_OXVRQ8NJF$Yv`FX|pIjMSCiA4+y#y~5k SZwzG=+nyB4IFD(f0Sf>fM{tb* diff --git a/misc/console_launcher/rusefi_updater.xml b/misc/console_launcher/rusefi_updater.xml index 6d5ca2a703..d71487f220 100644 --- a/misc/console_launcher/rusefi_updater.xml +++ b/misc/console_launcher/rusefi_updater.xml @@ -2,7 +2,7 @@ true gui - console\rusefi_console.jar + console\rusefi_autoupdate.jar c:\stuff\rusefi\misc\console_launcher\rusefi_updater.exe basic-ui