Compare commits

...

11 Commits

Author SHA1 Message Date
MathieuG-P 7f71d3006c bumb to 1.3.1-alpha.2 2023-09-25 08:12:50 +02:00
MathieuG-P 120470de5e Merge pull request #326 from Zagrios/bugfix/bsm-was-using-the-parent-of-bs-content-folder
[bugfix] fix of using the parent of installation folder when it was set in the config
2023-09-23 16:14:27 +02:00
MathieuG-P 8efe5be63f [bugfix] fix of using the parent of installation folder when it was set in the config 2023-09-23 16:09:24 +02:00
MathieuG-P 7378b234eb Merge pull request #325 from Insprill/fix/liv-linux
Skip Liv initialization on Linux
2023-09-21 17:17:37 +02:00
Pierce Thompson d256f2989f Pass noError instead of using a dummy impl 2023-09-21 10:59:13 -04:00
Pierce Thompson 85d43639af Skip Liv initialization on Linux 2023-09-20 22:47:59 -04:00
MathieuG-P f849b0d570 Merge pull request #323 from Zagrios/bugfix/steam-and-oculus-are-not-at-the-top
[bugfix] Steam and Oculus are not at the top of the versions list
2023-09-20 17:38:37 +02:00
MathieuG-P 34936f6666 [bugfix] Steam and Oculus are not at the top of the versions list 2023-09-20 17:32:45 +02:00
MathieuG-P d8a4889298 Merge pull request #321 from Zagrios/bugfix/add-no-yeet-args-prevent-mods-to-be-yeeted
[bugfix] Add no-yeet agrs to prevent mods to be yeeted
2023-09-18 15:29:35 +02:00
MathieuG-P 21c7f9d225 [bugfix] Add no-yeet agrs to prevent mods to be moved when UserData folder is linked 2023-09-18 15:24:53 +02:00
MathieuG-P 1048ca6b9b remove code sign verification 2023-09-18 15:14:09 +02:00
8 changed files with 51 additions and 37 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ https://user-images.githubusercontent.com/40648115/213435051-7feb815d-f32b-4135-
<div>
<h1><b>Credits</b></h1>
<ul>
<li><a href="https://github.com/Zagrios">Zagrios</a> - Founder & Lead Developer (Mathieu GRIES)</li>
<li><a href="https://github.com/Zagrios">Zagrios</a> - Founder & Lead Developer</li>
<li><a href="https://github.com/Iluhadesu">Iluhadesu</a> - Project Team & Developpement help</li>
<li><a href="https://github.com/GaetanGrd">GaetanGrd</a> - Project Team & Developpement help</li>
<li><a href="https://github.com/cheddZy">cheddZy</a> - Icon creator</li>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "bs-manager",
"version": "1.3.1-alpha.1",
"version": "1.3.1-alpha.2",
"description": "BSManager",
"main": "./dist/main/main.js",
"author": {
+1 -1
View File
@@ -80,7 +80,7 @@ export class BSLauncherService {
}
private buildBsLaunchArgs(launchOptions: LaunchOption): string[]{
const launchArgs = [];
const launchArgs = ["--no-yeet"];
if (launchOptions.oculus) {
launchArgs.push("-vrmode");
@@ -38,11 +38,11 @@ export class InstallationLocationService {
}
public async setInstallationDirectory(newDir: string): Promise<string> {
newDir = path.basename(newDir) === this.INSTALLATION_FOLDER ? newDir : path.join(newDir, this.INSTALLATION_FOLDER);
newDir = path.basename(newDir) === this.INSTALLATION_FOLDER ? path.join(newDir, "..") : newDir;
const oldDir = await this.installationDirectory();
await ensureFolderExist(oldDir);
await copyDirectoryWithJunctions(oldDir, newDir, { overwrite: true });
await copyDirectoryWithJunctions(oldDir, path.join(newDir, this.INSTALLATION_FOLDER), { overwrite: true });
this._installationDirectory = newDir;
this.installPathConfig.set(this.STORE_INSTALLATION_PATH_KEY, newDir);
@@ -57,23 +57,27 @@ export class InstallationLocationService {
}
public async installationDirectory(): Promise<string> {
if(this._installationDirectory) {
return this._installationDirectory;
}
if(this.installPathConfig.has(this.STORE_INSTALLATION_PATH_KEY)) {
this._installationDirectory = this.installPathConfig.get(this.STORE_INSTALLATION_PATH_KEY) as string;
return this._installationDirectory;
}
const oldPath = path.join(app.getPath("documents"), this.INSTALLATION_FOLDER);
if(await pathExist(oldPath)){
this._installationDirectory = oldPath;
return this._installationDirectory;
}
const installParentPath = async () => {
if(this._installationDirectory) {
return this._installationDirectory;
}
this._installationDirectory = path.join(app.getPath("home"), this.INSTALLATION_FOLDER);
return this._installationDirectory;
if(this.installPathConfig.has(this.STORE_INSTALLATION_PATH_KEY)) {
return this.installPathConfig.get(this.STORE_INSTALLATION_PATH_KEY) as string;
}
const oldPath = path.join(app.getPath("documents"), this.INSTALLATION_FOLDER);
if(await pathExist(oldPath)){
return app.getPath("documents");
}
return app.getPath("home");
};
this._installationDirectory = await installParentPath();
return path.join(this._installationDirectory, this.INSTALLATION_FOLDER);
}
public async versionsDirectory(): Promise<string> {
+3 -3
View File
@@ -20,13 +20,13 @@ export class LivService {
}
public isLivInstalled(): Promise<boolean> {
public async isLivInstalled(): Promise<boolean> {
return execOnOs({
win32: async () => {
const regRes = await regedit.promisified.list([this.livRegeditKey]).then(res => res[this.livRegeditKey]);
return regRes?.exists;
}
});
},
}, true);
}
public async createLivShortcut(entry: LivEntry): Promise<void> {
@@ -30,7 +30,7 @@ export function NavBar() {
if (downloadingVersion){ versions.push(downloadingVersion); }
const sorted = versions.sort((a, b) => +b.ReleaseDate - +a.ReleaseDate);
const sorted = BSVersionManagerService.sortVersions(versions);
return BSVersionManagerService.removeDuplicateVersions(sorted);
}
@@ -5,7 +5,7 @@ import { ModalExitCode, ModalService } from "./modale.service";
import { NotificationService } from "./notification.service";
import { ProgressBarService } from "./progress-bar.service";
import { EditVersionModal } from "renderer/components/modal/modal-types/edit-version-modal.component";
import { swapElements } from "shared/helpers/array.helpers";
import { popElement } from "shared/helpers/array.helpers";
export class BSVersionManagerService {
private static instance: BSVersionManagerService;
@@ -34,18 +34,7 @@ export class BSVersionManagerService {
}
public setInstalledVersions(versions: BSVersion[]) {
const sorted: BSVersion[] = versions.sort((a, b) => +b.ReleaseDate - +a.ReleaseDate);
const steamIndex = sorted.findIndex(v => v.steam);
const oculusIndex = sorted.findIndex(v => v.oculus);
if (steamIndex > 0) {
swapElements(steamIndex, 0, sorted);
}
if (oculusIndex > 0) {
swapElements(oculusIndex, steamIndex >= 0 ? 1 : 0, sorted);
}
const sorted = BSVersionManagerService.sortVersions(versions);
this.installedVersions$.next(BSVersionManagerService.removeDuplicateVersions(sorted));
}
@@ -123,6 +112,19 @@ export class BSVersionManagerService {
return this.ipcService.sendV2("get-version-full-path", { args: version });
}
public static sortVersions(versions: BSVersion[]): BSVersion[] {
const steamVersion = popElement(v => v.steam, versions);
const oculusVersion = popElement(v => v.oculus, versions);
const compare = (a: BSVersion, b: BSVersion) => ( +b.ReleaseDate - +a.ReleaseDate )
const sorted: BSVersion[] = versions.sort(compare);
sorted.unshift(...[steamVersion, oculusVersion].filter(Boolean).sort(compare));
return sorted;
}
public static removeDuplicateVersions(versions: BSVersion[]): BSVersion[] {
return Array.from(new Map(versions.map(version => ([
JSON.stringify([
+8
View File
@@ -10,3 +10,11 @@ export function swapElements<T = unknown>(from: number, to: number, arr: T[]): T
[arr[from], arr[to]] = [arr[to], arr[from]];
return arr;
}
export function popElement<T = unknown>(func: (element: T) => boolean, arr: T[]): T {
const index = arr.findIndex(func);
if (index === -1) {
return null;
}
return arr.splice(index, 1)[0];
}