From 83a434a1a936acecc97c7843cf51a0de19ce8c8b Mon Sep 17 00:00:00 2001 From: moehreag Date: Fri, 5 Jun 2026 17:06:26 +0200 Subject: [PATCH] add fallback platform to retrieve installer version --- public/installer.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/public/installer.js b/public/installer.js index 64e0d9a..dbbe6f6 100644 --- a/public/installer.js +++ b/public/installer.js @@ -13,21 +13,24 @@ "
Download native installer for " + getPlatformName(platform) + "
" + ""; downloadDiv.style = ""; + } else { + // Fallback platform to check the version for + platform = "linux-x86_64"; } - let nativeVersion = await getLatestVersion(platform, "ornithe-installer-rs/ornithe-installer-rs-" + platform + "?extension=" + getPlatformExtension(platform)); + let nativeVersion = await getLatestVersion("ornithe-installer-rs/ornithe-installer-rs-" + platform + "?extension=" + getPlatformExtension(platform)); setLatestVersion("native", nativeVersion.version); - let jarVersion = await getLatestVersion(platform, "ornithe-installer"); + let jarVersion = await getLatestVersion("ornithe-installer"); setLatestVersion("jar", jarVersion.version); - async function getLatestVersion(platform, artifact) { + async function getLatestVersion(artifact) { const res = await fetch("https://maven.ornithemc.net/api/maven/latest/version/releases/net/ornithemc/" + artifact); return res.json(); } function setLatestVersion(sort, version) { let div = document.getElementById("latest-version-" + sort); - if (div != null) { + if (div != null && version != undefined) { div.style = ""; div.innerHTML = "Latest Installer Version: " + version; } @@ -41,7 +44,7 @@ platform = navigator.platform; } if (platform.indexOf("Linux") != -1 || platform.indexOf("X11") != -1) { - if (platform.indexOf("aarch64") != -1) { + if (platform.indexOf("aarch64") != -1 || platform.indexOf("arm") != -1) { return "linux-aarch64" } return "linux-x86_64";