fix: #22: Downloads the correct file for the PCUAE main install for version 4.

Also downloads the correct files for the different mode packs.
This commit is contained in:
lantzelot-swe 2024-04-08 23:04:12 +02:00
parent 5025e760b5
commit 291ed4068f
2 changed files with 14 additions and 8 deletions

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>se.lantz</groupId> <groupId>se.lantz</groupId>
<artifactId>PCUAEManager</artifactId> <artifactId>PCUAEManager</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<name>PCUAEManager</name> <name>PCUAEManager</name>
<properties> <properties>
<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding> <project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>

View File

@ -43,11 +43,12 @@ public abstract class BaseInstallManager implements AWTEventListener
public static final String INSTALL_FOLDER = "./pcuae-install/"; public static final String INSTALL_FOLDER = "./pcuae-install/";
protected static final String PCUAE_INSTALL_NAME = "pcuae"; protected static final String PCUAE_INSTALL_NAME = "pcuae";
protected static final String AMIGA_MODE_INSTALL_NAME = "amiga"; protected static final String PCUAE_MAIN_INSTALL_NAME = "main";
protected static final String ATARI_MODE_INSTALL_NAME = "atari"; protected static final String AMIGA_MODE_INSTALL_NAME = "amiga-mode";
protected static final String LINUX_MODE_INSTALL_NAME = "linux"; 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 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 SCUMMVM_MODE_INSTALL_NAME = "scummvm";
protected static final String MSX_COLECO_MODE_INSTALL_NAME = "msx"; protected static final String MSX_COLECO_MODE_INSTALL_NAME = "msx";
@ -211,7 +212,11 @@ public abstract class BaseInstallManager implements AWTEventListener
for (JsonElement asset : assets) 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) switch (assetsName)
{ {
case AMIGA_MODE_INSTALL_NAME: case AMIGA_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) || 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(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(); downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
} }