mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
Auto launch Steam shortcut fixes
This commit is contained in:
@@ -526,12 +526,12 @@ namespace VRCX
|
||||
return null;
|
||||
}
|
||||
|
||||
string? testLibraryPath = null;
|
||||
string? libraryPath = null;
|
||||
var libraryFolders = new List<string>();
|
||||
foreach (var line in File.ReadLines(libraryFoldersVdfPath))
|
||||
{
|
||||
if (line.Contains("\"path\""))
|
||||
{
|
||||
if (!line.Contains("\"path\""))
|
||||
continue;
|
||||
|
||||
var parts = line.Split("\t");
|
||||
if (parts.Length < 4)
|
||||
continue;
|
||||
@@ -539,22 +539,11 @@ namespace VRCX
|
||||
var basePath = parts[4].Replace("\"", "").Replace(@"\\", @"\");
|
||||
var path = Path.Join(basePath, @"steamapps");
|
||||
if (Directory.Exists(path))
|
||||
testLibraryPath = path;
|
||||
libraryFolders.Add(path);
|
||||
}
|
||||
|
||||
if (line.Contains($"\"{appId}\""))
|
||||
foreach (var libraryPath in libraryFolders)
|
||||
{
|
||||
libraryPath = testLibraryPath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (libraryPath == null)
|
||||
{
|
||||
logger.Error("Could not find Steam library containing appid {0}", appId);
|
||||
return null;
|
||||
}
|
||||
|
||||
string? installDir = null;
|
||||
var appManifestFiles = Directory.GetFiles(libraryPath, "appmanifest_*.acf");
|
||||
foreach (var file in appManifestFiles)
|
||||
{
|
||||
@@ -572,20 +561,17 @@ namespace VRCX
|
||||
|
||||
var fullPath = Path.Join(libraryPath, "common", dirMatch.Groups[1].Value);
|
||||
if (Directory.Exists(fullPath))
|
||||
installDir = fullPath;
|
||||
return fullPath;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (installDir == null)
|
||||
{
|
||||
}
|
||||
|
||||
logger.Error("Could not find install dir for appid {0}", appId);
|
||||
return null;
|
||||
}
|
||||
|
||||
return installDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user