diff --git a/docs/release-notes.md b/docs/release-notes.md index 7574d62b..9f50fafa 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,10 @@ _If needed, you can update to SMAPI 3.16.0 first and then install the latest version._ --> +## Upcoming release +* For players: + * Fixed installer error on Windows if the Steam library folder exists but doesn't contain Steam's `.vdf` library data file. + ## 3.17.0 Released 09 October 2022 for Stardew Valley 1.5.6 or later. See [release highlights](https://www.patreon.com/posts/73090322). diff --git a/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs b/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs index 66465ffe..1d518738 100644 --- a/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs +++ b/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs @@ -264,8 +264,12 @@ namespace StardewModdingAPI.Toolkit.Framework.GameScanning if (steamPath == null) return null; - // get raw .vdf data + // get .vdf file path string libraryFoldersPath = Path.Combine(steamPath.Replace('/', '\\'), "steamapps\\libraryfolders.vdf"); + if (!File.Exists(libraryFoldersPath)) + return null; + + // read data using FileStream fileStream = File.OpenRead(libraryFoldersPath); VdfDeserializer deserializer = new(); dynamic libraries = deserializer.Deserialize(fileStream);