mirror of
https://github.com/Gabi-Zar/Silk-Fly-Launcher.git
synced 2026-04-17 05:26:04 +02:00
Improve Silksong path auto-detection for any Steam installation
This commit is contained in:
@@ -63,12 +63,21 @@ function launch(mode) {
|
||||
}
|
||||
|
||||
async function autoDetectGamePath() {
|
||||
const defaultSilksongPath = "C:/Program Files (x86)/Steam/steamapps/common/Hollow Knight Silksong/Hollow Knight Silksong.exe"
|
||||
if (await files.fileExists(defaultSilksongPath)) {
|
||||
await save.saveSilksongPath(defaultSilksongPath)
|
||||
const defaultsSilksongPaths = [
|
||||
":/Program Files (x86)/Steam/steamapps/common/Hollow Knight Silksong",
|
||||
":/SteamLibrary/steamapps/common/Hollow Knight Silksong"
|
||||
]
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user