Improve Silksong path auto-detection for any Steam installation

This commit is contained in:
2026-01-19 22:29:41 +01:00
parent 80f03df37c
commit 059697af7e

View File

@@ -63,11 +63,20 @@ function launch(mode) {
} }
async function autoDetectGamePath() { async function autoDetectGamePath() {
const defaultSilksongPath = "C:/Program Files (x86)/Steam/steamapps/common/Hollow Knight Silksong/Hollow Knight Silksong.exe" const defaultsSilksongPaths = [
if (await files.fileExists(defaultSilksongPath)) { ":/Program Files (x86)/Steam/steamapps/common/Hollow Knight Silksong",
await save.saveSilksongPath(defaultSilksongPath) ":/SteamLibrary/steamapps/common/Hollow Knight Silksong"
if (document.getElementById("silksong-path-input")) { ]
document.getElementById("silksong-path-input").value = await save.loadSilksongPath() for (const path of defaultsSilksongPaths) {
for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
const fullPath = `${String.fromCharCode(i)}${path}`
if (await files.fileExists(fullPath)) {
await save.saveSilksongPath(fullPath)
if (document.getElementById("silksong-path-input")) {
document.getElementById("silksong-path-input").value = await save.loadSilksongPath()
}
return
}
} }
} }
} }