Skip to content

Commit

Permalink
fix: steam install path properly resolves symlinks during validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed May 1, 2024
1 parent 83d6708 commit 4051e31
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/lib/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LogController } from "../controllers/LogController";
import { SGDB, type SGDBImage } from "../models/SGDB";
import { exit } from "@tauri-apps/api/process";
import { RustInterop } from "../controllers/RustInterop";
import { fs, process, http } from "@tauri-apps/api";
import { fs, path, process, http } from "@tauri-apps/api";
import { get } from "svelte/store";

/**
Expand Down Expand Up @@ -208,10 +208,11 @@ export async function restartApp(): Promise<void> {
* @param path The path to check.
* @returns True if the path is a valid install.
*/
export async function validateSteamPath(path: string): Promise<boolean> {
const wasAdded = await RustInterop.addPathToScope(path);
if (wasAdded && await fs.exists(path)) {
const contents = (await fs.readDir(path)).map((entry) => entry.name);
export async function validateSteamPath(steamPath: string): Promise<boolean> {
const normalized = await path.normalize(steamPath);
const wasAdded = await RustInterop.addPathToScope(normalized);
if (wasAdded && await fs.exists(normalized)) {
const contents = (await fs.readDir(normalized)).map((entry) => entry.name);
return contents.includes("steam.exe");
}

Expand Down

0 comments on commit 4051e31

Please sign in to comment.