Merge pull request #657 from LiamillionSS/bugfix/527

[bugfix/527] Prevents oculus version from launching if the original oculus version is not present

(cherry picked from commit e1f421831b)
This commit is contained in:
MathieuG-P
2024-11-25 20:44:54 +01:00
parent 7c871f84a4
commit e6ee58b560
10 changed files with 67 additions and 29 deletions
@@ -127,6 +127,11 @@ export class OculusLauncherService extends AbstractLauncherService implements St
const prepareDowngradedVersion: () => Promise<string> = async () => {
const originalVersionPath = await prepareOriginalVersion().catch(() => null);
if (!originalVersionPath) {
throw CustomError.fromError(new Error("Original Oculus Beat Saber not installed"), BSLaunchError.ORIGINAL_OCULUS_NOT_INSTALLED);
}
const oculusLib = await lastValueFrom(this.oculusLib$.pipe(take(1), timeout(sToMs(30)), catchError(() => of(null))));
if(!oculusLib){
@@ -15,6 +15,7 @@ export enum BSLaunchError{
BS_EXIT_ERROR = "EXIT",
OCULUS_LIB_NOT_FOUND = "OCULUS_LIB_NOT_FOUND",
UNKNOWN_ERROR = "UNKNOWN_ERROR",
ORIGINAL_OCULUS_NOT_INSTALLED = "ORIGINAL_OCULUS_NOT_INSTALLED"
}
export enum BSLaunchEvent{