feat: 1.1.1.2 hybrid Go installer (online 5.8M/offline 98M, выбор C:\ZernMC + ярлык ZernMC Launcher.lnk, uninstall.exe, DataDir ~/.zernmc) — hollow-ромбы, custom-сборки, моды с правами, ПКМ без Reload, sticky Играть, онбординг Config persist + /launcher/download/jre

This commit is contained in:
SashegDev
2026-09-01 06:35:15 +00:00
parent 592de204b6
commit bcd10cce06
15 changed files with 1653 additions and 69 deletions
+18
View File
@@ -323,6 +323,8 @@
const dlVersion = document.getElementById('download-version');
const dlSize = document.getElementById('download-size');
const dlBtn = document.getElementById('download-btn');
const dlOnline = document.getElementById('download-online-btn');
const dlOffline = document.getElementById('download-offline-btn');
const pvVersion = document.getElementById('preview-version');
if (heroVersion) heroVersion.textContent = version;
@@ -338,6 +340,22 @@
if (dlBtn && data.new_format && data.new_format.download_url) {
dlBtn.href = API + data.new_format.download_url;
}
// Online/Offline hybrid (Go, 1.1.3)
if (dlOnline) {
// online setup is Go exe (~5.8M) — try to discover via /launcher/version or static name
try {
const v = version && version !== '—' ? version : '1.1.1.2';
dlOnline.href = API + '/launcher/download/jre'; // JRE endpoint validated, exe name is ZernMC-Online-Setup-<ver>.exe
dlOnline.setAttribute('data-version', v);
// probe if online exe exists
fetch(API + '/launcher/file/' + v + '/ZernMC-Online-Setup-' + v + '.exe', {method:'HEAD'}).then(r=>{
if (r.ok) dlOnline.href = API + '/launcher/file/' + v + '/ZernMC-Online-Setup-' + v + '.exe';
}).catch(()=>{});
} catch(e){}
}
if (dlOffline && data.new_format && data.new_format.download_url) {
dlOffline.href = API + data.new_format.download_url;
}
} catch (e) {
console.warn('[site] failed to load launcher info', e);
}