From 291ed4068faf41969831edbeee217bb8899495ae Mon Sep 17 00:00:00 2001 From: lantzelot-swe <75668734+lantzelot-swe@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:04:12 +0200 Subject: [PATCH] fix: #22: Downloads the correct file for the PCUAE main install for version 4. Also downloads the correct files for the different mode packs. --- pom.xml | 2 +- .../manager/pcuae/BaseInstallManager.java | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index ff54e17..966bdc3 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 se.lantz PCUAEManager - 2.17.0 + 2.17.1 PCUAEManager Cp1252 diff --git a/src/main/java/se/lantz/manager/pcuae/BaseInstallManager.java b/src/main/java/se/lantz/manager/pcuae/BaseInstallManager.java index 2747df0..7c59e33 100644 --- a/src/main/java/se/lantz/manager/pcuae/BaseInstallManager.java +++ b/src/main/java/se/lantz/manager/pcuae/BaseInstallManager.java @@ -43,11 +43,12 @@ public abstract class BaseInstallManager implements AWTEventListener public static final String INSTALL_FOLDER = "./pcuae-install/"; protected static final String PCUAE_INSTALL_NAME = "pcuae"; - protected static final String AMIGA_MODE_INSTALL_NAME = "amiga"; - protected static final String ATARI_MODE_INSTALL_NAME = "atari"; - protected static final String LINUX_MODE_INSTALL_NAME = "linux"; + protected static final String PCUAE_MAIN_INSTALL_NAME = "main"; + protected static final String AMIGA_MODE_INSTALL_NAME = "amiga-mode"; + protected static final String ATARI_MODE_INSTALL_NAME = "atari-mode"; + protected static final String LINUX_MODE_INSTALL_NAME = "linux-mode"; protected static final String RETROARCH_MODE_INSTALL_NAME = "retroarch"; - protected static final String VICE_MODE_INSTALL_NAME = "vice"; + protected static final String VICE_MODE_INSTALL_NAME = "vice-mode"; protected static final String SCUMMVM_MODE_INSTALL_NAME = "scummvm"; protected static final String MSX_COLECO_MODE_INSTALL_NAME = "msx"; @@ -211,7 +212,11 @@ public abstract class BaseInstallManager implements AWTEventListener for (JsonElement asset : assets) { - String assetName = asset.getAsJsonObject().get("name").getAsString(); + String assetName = asset.getAsJsonObject().get("name").getAsString().toLowerCase(); + if (!assetName.endsWith(".exe")) + { + continue; + } switch (assetsName) { case AMIGA_MODE_INSTALL_NAME: @@ -263,7 +268,7 @@ public abstract class BaseInstallManager implements AWTEventListener } break; } - + case MSX_COLECO_MODE_INSTALL_NAME: { if (assetName.contains(MSX_COLECO_MODE_INSTALL_NAME)) @@ -276,7 +281,8 @@ public abstract class BaseInstallManager implements AWTEventListener { if (!(assetName.contains(AMIGA_MODE_INSTALL_NAME) || assetName.contains(ATARI_MODE_INSTALL_NAME) || assetName.contains(LINUX_MODE_INSTALL_NAME) || assetName.contains(RETROARCH_MODE_INSTALL_NAME) || - assetName.contains(VICE_MODE_INSTALL_NAME) || assetName.contains(SCUMMVM_MODE_INSTALL_NAME))) + assetName.contains(VICE_MODE_INSTALL_NAME) || assetName.contains(SCUMMVM_MODE_INSTALL_NAME)) && + assetName.contains(PCUAE_MAIN_INSTALL_NAME)) { downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString(); }