Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34,502 changes: 34,502 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,6 @@
"node": ">= 18.0.0",
"npm": ">= 10.0.0",
"yarn": ">= 1.21.1"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2,265 changes: 2,265 additions & 0 deletions r2Tree.txt

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions src/pages/Manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ import ModalCard from '../components/ModalCard.vue';
case 'win32':
return path.basename(file).toLowerCase() === "steam.exe"
case 'linux':
return path.basename(file).toLowerCase() === "steam.sh"
const basename = path.basename(file).toLowerCase();
// Accept steam.sh script, plain 'steam' executable, or any file named 'steam' (for ELF binaries)
return basename === "steam.sh" || basename === "steam" ||
// Check if file exists and is executable
(basename.includes("steam") && await this.isFileExecutable(file))
case 'darwin':
return path.basename(file).toLowerCase() === 'steam.app'
default:
Expand All @@ -347,7 +351,11 @@ import ModalCard from '../components/ModalCard.vue';
InteractionProvider.instance.selectFile({
title: 'Locate Steam Executable',
defaultPath: steamDir,
filters: [{name: "steam", extensions: ["exe", "sh", "app"]}],
filters: process.platform === 'linux'
? [
{ name: "All Files", extensions: ["*"] }
]
: [{ name: "Steam", extensions: ["exe", "sh", "app"] }],
buttonLabel: 'Select Executable'
}).then(async files => {
if (files.length === 1) {
Expand Down Expand Up @@ -653,6 +661,20 @@ import ModalCard from '../components/ModalCard.vue';

this.isManagerUpdateAvailable();
}

async isFileExecutable(file: string): Promise<boolean> {
try {
// Check if file exists
const exists = await FsProvider.instance.exists(file);
if (!exists) return false;

// Get file stats and check if it's a valid file
const stats = await FsProvider.instance.stat(file);
return stats.isFile();
} catch (e) {
return false;
}
}
}

</script>
21 changes: 20 additions & 1 deletion src/r2mm/manager/linux/GameDirectoryResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ export default class GameDirectoryResolverImpl extends GameDirectoryResolverProv
}
try {
const dirs = [
// Standard paths
path.resolve(homedir(), '.local', 'share', 'Steam'),
path.resolve(homedir(), '.steam', 'steam'),
path.resolve(homedir(), '.steam', 'root'),
path.resolve(homedir(), '.steam'),
// Debian-specific paths
path.resolve(homedir(), '.steam', 'debian-installation'),
path.resolve(homedir(), '.steam', 'debian-installation', 'ubuntu12_32'),
// Flatpak paths
path.resolve(homedir(), '.var', 'app', 'com.valvesoftware.Steam', '.local', 'share', 'Steam'),
path.resolve(homedir(), '.var', 'app', 'com.valvesoftware.Steam', '.steam', 'steam'),
path.resolve(homedir(), '.var', 'app', 'com.valvesoftware.Steam', '.steam', 'root'),
Expand Down Expand Up @@ -243,10 +248,24 @@ export default class GameDirectoryResolverImpl extends GameDirectoryResolverProv
}

private async findAppManifestLocation(steamPath: string, game: Game): Promise<R2Error | string> {
// Check if we're at the end of the Steam path hierarchy
const parentOfSteamPath = path.dirname(steamPath);
const steamPathBaseName = path.basename(steamPath);

// For special cases like debian-installation, we need to check if steamapps is in the parent directory
let additionalPaths: string[] = [];
if (steamPathBaseName === 'ubuntu12_32' && parentOfSteamPath.endsWith('debian-installation')) {
additionalPaths.push(path.join(parentOfSteamPath, 'steamapps')); // Direct steamapps in debian-installation
}

const probableSteamAppsLocations = [
// Standard locations
path.join(steamPath, 'steamapps'), // every proper linux distro ever
path.join(steamPath, 'steam', 'steamapps'), // Ubuntu LTS
path.join(steamPath, 'root', 'steamapps') // wtf? expect the unexpectable
path.join(steamPath, 'root', 'steamapps'), // wtf? expect the unexpectable
path.join(steamPath, 'debian-installation', 'steamapps'), // Debian installation
// Additional special case locations
...additionalPaths
];

let steamapps: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion test/jest/__utils__/ObjectTestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default class ObjectTestUtils {

public static lazyClone<T>(copy: T): T {
const obj: any = {};
Object.keys(copy).forEach((key: any) => {
Object.keys(copy as any).forEach((key: any) => {
obj[key] = (copy as any)[key];
});
return obj as unknown as T;
Expand Down
Loading