mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[chore] remove functions and translations that or no longer needed
This commit is contained in:
@@ -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()));
|
||||
|
||||
@@ -44,20 +44,6 @@ export class BsSteamDownloaderService {
|
||||
return path.join(this.utils.getAssetsScriptsPath(), process.platform === 'linux' ? "DepotDownloader" : "DepotDownloader.exe");
|
||||
}
|
||||
|
||||
public async isDotNet6Installed(): Promise<boolean> {
|
||||
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);
|
||||
|
||||
@@ -44,28 +44,11 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen
|
||||
this.linkOpener = LinkOpenerService.getInstance();
|
||||
}
|
||||
|
||||
public isDotNet6Installed(): Promise<boolean> {
|
||||
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<void> {
|
||||
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<string> {
|
||||
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);
|
||||
|
||||
@@ -25,7 +25,6 @@ export interface IpcChannelMapping extends Record<string, { request: unknown, re
|
||||
|
||||
/* ** bs-download-ipcs ** */
|
||||
"import-version": { request: ImportVersionOptions, response: Progression<BSVersion>};
|
||||
"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};
|
||||
|
||||
Reference in New Issue
Block a user