Skip to content

Commit

Permalink
Fix #105 - v1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RevoLand committed Feb 26, 2023
1 parent 582f310 commit eaec79b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 62 deletions.
Binary file modified Binaries/Steam Library Manager.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions Binaries/Version.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.7.0.0</version>
<url>http://github.com/RevoLand/Steam-Library-Manager/releases/download/v1.7.0.0/Steam.Library.Manager.zip</url>
<version>1.7.1.0</version>
<url>http://github.com/RevoLand/Steam-Library-Manager/releases/download/v1.7.1.0/Steam.Library.Manager.zip</url>
<changelog>https://github.com/RevoLand/Steam-Library-Manager/releases</changelog>
<mandatory>false</mandatory>
</item>
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [1.7.1.0] - 2023-02-26

### Fixed

* Steam library detection ([#105](https://github.com/RevoLand/Steam-Library-Manager/issues/105))

## [1.7.0.0] - 2022-12-18

### Fixed
Expand Down
35 changes: 1 addition & 34 deletions Source/Steam Library Manager/Definitions/SteamLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,39 +317,6 @@ public override async void RemoveLibraryAsync(bool withFiles)

await Functions.Steam.CloseSteamAsync().ConfigureAwait(true);

// Make a KeyValue reader
var keyValReader = new Framework.KeyValue();

// Read vdf file
keyValReader.ReadFileAsText(Global.Steam.VdfFilePath);

// Remove old library
keyValReader["Software"]["Valve"]["Steam"].Children.RemoveAll(x =>
{
if (string.IsNullOrEmpty(x.Value))
{
return false;
}

var libraryPath = x.Value;
if (!libraryPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
{
libraryPath += Path.DirectorySeparatorChar;
}

return libraryPath == FullPath;
});

var i = 1;
foreach (var key in keyValReader["Software"]["Valve"]["Steam"].Children.FindAll(x => x.Name.Contains("BaseInstallFolder")))
{
key.Name = $"BaseInstallFolder_{i}";
i++;
}

// Update libraryFolders.vdf file with changes
keyValReader.SaveToFile(Global.Steam.VdfFilePath, false);

// Since this file started to interrupt us?
// No need to bother with it since config.vdf is the real deal, just remove it and Steam client will handle with some magic.
if (File.Exists(Path.Combine(Properties.Settings.Default.steamInstallationPath, "steamapps", "libraryfolders.vdf")))
Expand All @@ -358,7 +325,7 @@ public override async void RemoveLibraryAsync(bool withFiles)
}

// Make a KeyValue reader
keyValReader = new Framework.KeyValue();
Framework.KeyValue keyValReader = new Framework.KeyValue();

if (File.Exists(Definitions.Global.Steam.LibraryFoldersPath))
{
Expand Down
35 changes: 11 additions & 24 deletions Source/Steam Library Manager/Functions/Steam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -665,48 +665,35 @@ public static void GenerateLibraryList()
}
}

if (File.Exists(Path.Combine(Properties.Settings.Default.steamInstallationPath, "Steam.exe")))
{
AddNew(Properties.Settings.Default.steamInstallationPath, true);
}
//if (File.Exists(Path.Combine(Properties.Settings.Default.steamInstallationPath, "Steam.exe")))
//{
// AddNew(Properties.Settings.Default.steamInstallationPath, true);
//}

// If config.vdf exists
if (File.Exists(Definitions.Global.Steam.VdfFilePath))
if (File.Exists(Definitions.Global.Steam.LibraryFoldersPath))
{
// Make a KeyValue reader
var keyValReader = new Framework.KeyValue();

// Read our vdf file as text
keyValReader.ReadFileAsText(Definitions.Global.Steam.VdfFilePath);

keyValReader = keyValReader["Software"]["Valve"]["Steam"];
keyValReader.ReadFileAsText(Definitions.Global.Steam.LibraryFoldersPath);
if (keyValReader?.Children.Count > 0)
{
foreach (var key in keyValReader.Children.Where(x => x.Name.StartsWith("BaseInstallFolder", StringComparison.OrdinalIgnoreCase)))
foreach (var key in keyValReader.Children)
{
AddNew(key.Value);
}
var libraryPath = key.Children.Find((children) => children.Name == "path");

if (keyValReader["Accounts"]?.Children.Count > 0)
{
foreach (var account in keyValReader["Accounts"].Children)
if (libraryPath != null)
{
var steamId = account.Children.SingleOrDefault(x => x.Name == "SteamID");
if (steamId == null)
{
continue;
}

Definitions.List.SteamUserIdList.Add(new Tuple<string, string>(account.Name, steamId.Value));
AddNew(libraryPath.Value, File.Exists(Path.Combine(libraryPath.Value, "Steam.exe")));
}

Main.FormAccessor.SettingsView.SteamUserIDList.SelectedItem = Definitions.List.SteamUserIdList.Find(x => x.Item2 == Properties.Settings.Default.SteamID64);
}
}
}
else
{
Logger.Warn($"Couldn't locate config.vdf for Steam at: {Definitions.Global.Steam.VdfFilePath}");
Logger.Warn($"Couldn't locate config.vdf for Steam at: {Definitions.Global.Steam.LibraryFoldersPath}");
}
}
catch (Exception ex)
Expand Down
4 changes: 2 additions & 2 deletions Source/Steam Library Manager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.7.1.0")]
[assembly: AssemblyFileVersion("1.7.1.0")]
[assembly: NeutralResourcesLanguage("en")]

0 comments on commit eaec79b

Please sign in to comment.