- Fixed an appinfo directory exception
This commit is contained in:
pointfeev 2022-01-27 15:59:02 -05:00
parent 18eb4e3ce0
commit d4a90d8fe7
2 changed files with 5 additions and 8 deletions

View file

@ -83,8 +83,8 @@ internal static class SteamCMD
string appUpdateFile = $@"{appUpdatePath}\appinfo.txt";
restart:
if (Program.Canceled) return null;
if (Directory.Exists(appUpdatePath) && File.Exists(appUpdateFile))
output = File.ReadAllText(appUpdateFile, Encoding.UTF8);
if (!Directory.Exists(appUpdatePath)) Directory.CreateDirectory(appUpdatePath);
if (File.Exists(appUpdateFile)) output = File.ReadAllText(appUpdateFile, Encoding.UTF8);
else
{
output = await Run($@"+@ShutdownOnFailedCommand 0 +login anonymous +app_info_print {appId} +force_install_dir {appUpdatePath} +app_update 4 +quit");
@ -99,11 +99,8 @@ internal static class SteamCMD
if (Program.Canceled || output is null) return null;
if (!ValveDataFile.TryDeserialize(output, out VProperty appInfo))
{
if (Directory.Exists(appUpdatePath))
{
Directory.Delete(appUpdatePath, true);
goto restart;
}
Directory.Delete(appUpdatePath, true);
goto restart;
}
if (appInfo.Value is VValue) goto restart;
if (appInfo is null || appInfo.Value?.Children()?.ToList()?.Count == 0) return appInfo;

View file

@ -5,7 +5,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>2.2.4.3</Version>
<Version>2.2.4.4</Version>
<PackageIcon>Resources\ini.ico</PackageIcon>
<PackageIconUrl />
<Description>Automatically generates and installs CreamAPI files for Steam games on the user's computer. It can also generate and install CreamAPI for the Paradox Launcher should the user select a Paradox Interactive game.</Description>