From 734465a4f5964f98a465bbf039d672e879cccf89 Mon Sep 17 00:00:00 2001 From: Brian <18603393+brian6932@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:35:15 -0500 Subject: [PATCH] epic-games-launcher: Use `head` and properly parse query params (#1292) --- bucket/epic-games-launcher.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bucket/epic-games-launcher.json b/bucket/epic-games-launcher.json index 1f9dd63d3bab..7e822bbf8f25 100644 --- a/bucket/epic-games-launcher.json +++ b/bucket/epic-games-launcher.json @@ -23,12 +23,11 @@ "url": "https://scoop.sh", "useragent": "$app/$version", "script": [ - "$redirUrl = [System.Net.HttpWebRequest]::Create(", - "'https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi'", - ").GetResponse().ResponseUri.AbsoluteUri;", - "return $redirUrl" + "$redirUrl = [Net.HttpWebRequest]::Create('https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi')", + "$redirUrl.method = 'head'", + "[Web.HttpUtility]::ParseQueryString($redirUrl.GetResponse().ResponseUri.Query).Get('launcherfilename')" ], - "regex": "EpicInstaller-([\\d.]+).msi" + "regex": "\\AEpicInstaller-([\\d.]+)\\.msi\\Z" }, "autoupdate": { "url": "https://epicgames-download1.akamaized.net/Builds/UnrealEngineLauncher/Installers/Win32/EpicInstaller-$version.msi#/setup.msi_"