From abf3a656953166c00e59e6635ad3b1c697046255 Mon Sep 17 00:00:00 2001 From: 2lay Date: Mon, 26 Jan 2026 19:39:21 +0100 Subject: [PATCH] feat: curseforge modpack downloading via binaryname:// uri Signed-off-by: 2lay --- launcher/ui/MainWindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index d6c4ccbec..d5408ab39 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -941,10 +941,20 @@ void MainWindow::processURLs(QList urls) QUrl local_url; if (!url.isLocalFile()) { // download the remote resource and identify QUrl dl_url; - if (url.scheme() == "curseforge") { + if (url.scheme() == "curseforge" || (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME && url.host() == "install")) { // need to find the download link for the modpack / resource // format of url curseforge://install?addonId=IDHERE&fileId=IDHERE + // format of url binaryname://install?platform=curseforge&addonId=IDHERE&fileId=IDHERE QUrlQuery query(url); + + // check if this is a binaryname:// url + if (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME) { + // check this is an curseforge platform request + if (query.queryItemValue("platform").toLower() != "curseforge") { + qDebug() << "Invalid mod distribution platform:" << query.queryItemValue("platform"); + continue; + } + } if (query.allQueryItemValues("addonId").isEmpty() || query.allQueryItemValues("fileId").isEmpty()) { qDebug() << "Invalid curseforge link:" << url;