From 764eeff57a3471e6c57c58c9d04238dc170f2faa Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:41:37 +0200 Subject: [PATCH] [chore] remove functions and translations that or no longer needed --- assets/jsons/translations/de.json | 9 +------- assets/jsons/translations/en.json | 9 +------- assets/jsons/translations/es.json | 9 +------- assets/jsons/translations/fr.json | 9 +------- assets/jsons/translations/ja.json | 9 +------- assets/jsons/translations/ru.json | 9 +------- assets/jsons/translations/zh-tw.json | 9 +------- assets/jsons/translations/zh.json | 9 +------- .../bs-version-download/bs-download-ipcs.ts | 5 ---- .../bs-steam-downloader.service.ts | 17 +------------- .../steam-downloader.service.ts | 23 ------------------- src/shared/models/ipc/ipc-routes.ts | 1 - 12 files changed, 9 insertions(+), 109 deletions(-) diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json index db50b2b7..61139135 100644 --- a/assets/jsons/translations/de.json +++ b/assets/jsons/translations/de.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": ".NET 6 Benötigt" - }, "msg": { "401": "Steam scheint uns BeatSaber nicht herunterladen zu lassen 😢", "404": "Steam-Server können nicht kontaktiert werden.", @@ -263,11 +260,7 @@ "LicenceError": "Die Liste der Lizenzen kann nicht abgerufen werden.", "RateLimitExceeded": "Du hast es zu oft versucht, warte eine Weile und versuche es später erneut.", "TokenRejected": "Ihr Anmeldetoken wurde abgelehnt 😕 Bitte versuchen Sie es erneut.", - "AccessDenied": "Der Zugang zu Steam wurde verweigert.", - "dotnet-required": ".NET 6 Runtime muss installiert sein, um eine Version von BeatSaber herunterzuladen. Lade es herunter, indem Du auf die Schaltfläche unten klickst." - }, - "actions": { - "download-dotnet": ".NET 6 Herunterladen" + "AccessDenied": "Der Zugang zu Steam wurde verweigert." } } }, diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 29093bd6..d229c817 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": ".NET 6 Required" - }, "msg": { "401": "Steam doesn't seem to want to let us download Beat Saber 😢", "404": "Unable to contact Steam servers.", @@ -263,11 +260,7 @@ "LicenceError": "Unable to get the list of licenses.", "RateLimitExceeded": "You've tried too many times, wait a while and try again later.", "TokenRejected": "Your login token has been rejected 😕 Please try again.", - "AccessDenied": "Access to Steam has been denied.", - "dotnet-required": ".NET 6 Runtime must be installed in order to download a version of Beat Saber. Download it by clicking the button below." - }, - "actions": { - "download-dotnet": "Download .NET 6" + "AccessDenied": "Access to Steam has been denied." } } }, diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index a730b071..3c0bdb8d 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": ".NET 6 Requerido" - }, "msg": { "401": "Parece que Steam no quiere dejarnos descargar Beat Saber 😢", "404": "No se puede contactar con los servidores de Steam", @@ -263,11 +260,7 @@ "LicenceError": "No se puede obtener la lista de licencias.", "RateLimitExceeded": "Lo has intentado demasiadas veces, espera un poco y vuelve a intentarlo más tarde.", "TokenRejected": "Tu token de inicio de sesión ha sido rechazada 😕 Por favor, inténtalo de nuevo.", - "AccessDenied": "El acceso a Steam ha sido denegado.", - "dotnet-required": "Se debe instalar el tiempo de ejecución de .NET 6 para descargar una versión de Beat Saber. Descárgalo haciendo clic en el botón de abajo." - }, - "actions": { - "download-dotnet": "Descargar .NET 6" + "AccessDenied": "El acceso a Steam ha sido denegado." } } }, diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index e7b63bb1..6fc63587 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": ".NET 6 Requis" - }, "msg": { "401": "Steam ne semble pas vouloir nous laisser télécharger Beat Saber 😢", "404": "Impossible de contacter les serveurs de Steam.", @@ -263,11 +260,7 @@ "LicenceError": "Impossible d'obtenir la liste des licences.", "RateLimitExceeded": "Tu as essayé trop de fois attends un peu et recommence plus tard.", "TokenRejected": "Votre token de connexion a été rejeté 😕 Veuillez réessayer.", - "AccessDenied": "L'accès à Steam a été refusé.", - "dotnet-required": ".NET 6 Runtime doit être installé pour pouvoir télécharger une version de Beat Saber. Télécharge-le en cliquant sur le bouton ci-dessous." - }, - "actions": { - "download-dotnet": "Télécharger .NET 6" + "AccessDenied": "L'accès à Steam a été refusé." } } }, diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json index 28c7f206..7d2bd2f7 100644 --- a/assets/jsons/translations/ja.json +++ b/assets/jsons/translations/ja.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": ".NET 6が必要です!" - }, "msg": { "401": "SteamがBeat Saberのダウンロードを許可してくれないようだ。😢", "404": "Steamサーバーに接続できません。", @@ -263,11 +260,7 @@ "LicenceError": "ライセンスリストを取得できません。", "RateLimitExceeded": "何度も試しているのでしばらくたって、もう一度お試しください。", "TokenRejected": "ログイントークンが拒否されました 😕 もう一度お試しください。", - "AccessDenied": "Steamへのアクセスが拒否されました。", - "dotnet-required": "Beat Saberをダウンロードするには、.NET 6 Runtimeがインストールされている必要があります。下のボタンをクリックしてダウンロードしてください。" - }, - "actions": { - "download-dotnet": ".NET 6をダウンロード" + "AccessDenied": "Steamへのアクセスが拒否されました。" } } }, diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json index b983dfc8..03cbdb16 100644 --- a/assets/jsons/translations/ru.json +++ b/assets/jsons/translations/ru.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": "Требуется .NET 6" - }, "msg": { "401": "Похоже Steam не хочет, чтобы мы скачали Beat Saber 😢", "404": "Нет связи с серверами Steam.", @@ -263,11 +260,7 @@ "LicenceError": "Не удалось проверить наличие лицензии.", "RateLimitExceeded": "Слишком много попыток, вернитесь позже и попробуйте снова.", "TokenRejected": "Ваш токен для входа был отклонен 😕 Пожалуйста, попробуйте снова.", - "AccessDenied": "Доступ к Steam был отклонен.", - "dotnet-required": "Среда запуска .NET 6 должна быть установлена, чтобы скачать Beat Saber. Скачайте её с помощью кнопки ниже." - }, - "actions": { - "download-dotnet": "Скачать .NET 6" + "AccessDenied": "Доступ к Steam был отклонен." } } }, diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json index 34954213..dc816d45 100644 --- a/assets/jsons/translations/zh-tw.json +++ b/assets/jsons/translations/zh-tw.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": "需要 .NET 6" - }, "msg": { "401": "Steam 似乎不想讓我們下載 Beat Saber😢", "404": "無法聯繫 Steam 伺服器。", @@ -263,11 +260,7 @@ "LicenceError": "無法獲取許可證列表。", "RateLimitExceeded": "你已經嘗試了太多次,請稍等片刻,稍後再試。", "TokenRejected": "你的登錄令牌已被拒絕 😕 請重試。", - "AccessDenied": "訪問 Steam 被拒絕。", - "dotnet-required": "必須安裝 .NET 6 Runtime 才能下載 Beat Saber 版本。單擊下面的按鈕下載它。" - }, - "actions": { - "download-dotnet": "下載 .NET 6" + "AccessDenied": "訪問 Steam 被拒絕。" } } }, diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json index 0460ab54..bd5a78d7 100644 --- a/assets/jsons/translations/zh.json +++ b/assets/jsons/translations/zh.json @@ -238,9 +238,6 @@ } }, "errors": { - "titles": { - "dotnet-required": "需要 .NET 6" - }, "msg": { "401": "Steam 似乎不想让我们下载 Beat Saber😢", "404": "无法联系 Steam 服务器。", @@ -263,11 +260,7 @@ "LicenceError": "无法获取许可证列表。", "RateLimitExceeded": "你已经尝试了太多次,请稍等片刻,稍后再试。", "TokenRejected": "你的登录令牌已被拒绝 😕 请重试。", - "AccessDenied": "访问 Steam 被拒绝。", - "dotnet-required": "必须安装 .NET 6 Runtime 才能下载 Beat Saber 版本。单击下面的按钮下载它。" - }, - "actions": { - "download-dotnet": "下载 .NET 6" + "AccessDenied": "访问 Steam 被拒绝。" } } }, diff --git a/src/main/ipcs/bs-version-download/bs-download-ipcs.ts b/src/main/ipcs/bs-version-download/bs-download-ipcs.ts index d5e081be..2d8cc00d 100644 --- a/src/main/ipcs/bs-version-download/bs-download-ipcs.ts +++ b/src/main/ipcs/bs-version-download/bs-download-ipcs.ts @@ -14,11 +14,6 @@ ipc.on("import-version", (args, reply) => { // #region Steam -ipc.on("is-dotnet-6-installed", (_, reply) => { - const installer = BsSteamDownloaderService.getInstance(); - reply(from(installer.isDotNet6Installed())); -}); - ipc.on("bs-download.installation-folder", (_, reply) => { const installLocation = InstallationLocationService.getInstance(); reply(from(installLocation.installationDirectory())); diff --git a/src/main/services/bs-version-download/bs-steam-downloader.service.ts b/src/main/services/bs-version-download/bs-steam-downloader.service.ts index 111e7fd7..ceade026 100644 --- a/src/main/services/bs-version-download/bs-steam-downloader.service.ts +++ b/src/main/services/bs-version-download/bs-steam-downloader.service.ts @@ -44,20 +44,6 @@ export class BsSteamDownloaderService { return path.join(this.utils.getAssetsScriptsPath(), process.platform === 'linux' ? "DepotDownloader" : "DepotDownloader.exe"); } - public async isDotNet6Installed(): Promise { - try { - const proc = spawnSync(this.getDepotDownloaderExePath()); - if (proc.stderr?.toString()) { - log.error("no dotnet", proc.stderr.toString()); - return false; - } - return true; - } catch (e) { - log.error("Error while checking .NET 6", e); - return false; - } - } - private async buildDepotDownloaderInstance(downloadInfos: DownloadSteamInfo, qr?: boolean): Promise<{depotDownloader: DepotDownloader, depotDownloaderOptions: DepotDownloaderArgsOptions, version: BSVersion}> { const versionPath = await this.localVersionService.getVersionPath(downloadInfos.bsVersion); @@ -82,13 +68,12 @@ export class BsSteamDownloaderService { await ensureDir(await this.installLocationService.versionsDirectory()); - const isLinux = process.platform === 'linux'; const exePath = this.getDepotDownloaderExePath(); const args = DepotDownloader.buildArgs(depotDownloaderOptions); const depotDownloader = new DepotDownloader({ command: exePath, - args: args, + args, options: { cwd: await this.installLocationService.versionsDirectory() }, echoStartData: downloadVersion }, log); diff --git a/src/renderer/services/bs-version-download/steam-downloader.service.ts b/src/renderer/services/bs-version-download/steam-downloader.service.ts index 31fe58ec..12673812 100644 --- a/src/renderer/services/bs-version-download/steam-downloader.service.ts +++ b/src/renderer/services/bs-version-download/steam-downloader.service.ts @@ -44,28 +44,11 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen this.linkOpener = LinkOpenerService.getInstance(); } - public isDotNet6Installed(): Promise { - return lastValueFrom(this.ipcService.sendV2("is-dotnet-6-installed")); - } - private setSteamSession(username: string): void { localStorage.setItem(this.STEAM_SESSION_USERNAME_KEY, username); } private getSteamUsername(): string { return localStorage.getItem(this.STEAM_SESSION_USERNAME_KEY); } public deleteSteamSession(): void { localStorage.removeItem(this.STEAM_SESSION_USERNAME_KEY); } public sessionExist(): boolean { return !!localStorage.getItem(this.STEAM_SESSION_USERNAME_KEY); } - private async showDotNetNotInstalledError(): Promise { - const choice = await this.notificationService.notifyError({ - duration: 11_000, - title: "notifications.bs-download.steam-download.errors.titles.dotnet-required", - desc: "notifications.bs-download.steam-download.errors.msg.dotnet-required", - actions: [{ id: "0", title: "notifications.bs-download.steam-download.errors.actions.download-dotnet" }], - }); - - if (choice === "0") { - this.linkOpener.open("https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-6.0.12-windows-x64-installer"); - } - } - public async getInstallationFolder(): Promise { return lastValueFrom(this.ipcService.sendV2("bs-download.installation-folder")); } @@ -220,12 +203,6 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen const downloadPromise = (async () => { - const haveDotNet = await this.isDotNet6Installed().catch(() => false); - if(!haveDotNet){ - this.showDotNetNotInstalledError(); - return Promise.reject(new Error("DotNet not installed")); - } - const downloadInfo: DownloadSteamInfo = {bsVersion, isVerification} const autoDownload = await lastValueFrom(this.tryAutoDownloadBsVersion(downloadInfo)).then(() => true).catch(() => false); diff --git a/src/shared/models/ipc/ipc-routes.ts b/src/shared/models/ipc/ipc-routes.ts index 29f8da1c..0844fff2 100644 --- a/src/shared/models/ipc/ipc-routes.ts +++ b/src/shared/models/ipc/ipc-routes.ts @@ -25,7 +25,6 @@ export interface IpcChannelMapping extends Record}; - "is-dotnet-6-installed": { request: void, response: boolean}; "bs-download.installation-folder": { request: void, response: string}; "bs-download.set-installation-folder": { request: string, response: string}; "auto-download-bs-version": { request: DownloadSteamInfo, response: DepotDownloaderEvent};