- Added an "Open AppInfo" button to the right click context menu
- Fixed an issue where the string "ERROR! Failed to install app '4' (Invalid platform)" was sometimes somewhere in the middle of AppInfo files, unfortunately meaning I have to bump the minimum appinfo version again
- By fixing the above issue, I also fixed certain random DLCs from being excluded
This commit is contained in:
pointfeev 2022-02-14 13:53:09 -05:00
parent 4c699358d1
commit 6d5b70ffe3
4 changed files with 16 additions and 2 deletions

View file

@ -19,7 +19,7 @@ namespace CreamInstaller.Classes;
internal static class SteamCMD internal static class SteamCMD
{ {
internal static readonly int ProcessLimit = 20; internal static readonly int ProcessLimit = 20;
internal static readonly Version MinimumAppInfoVersion = Version.Parse("2.3.3.0"); internal static readonly Version MinimumAppInfoVersion = Version.Parse("2.4.0.0");
internal static readonly string DirectoryPathOld = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\CreamInstaller"; internal static readonly string DirectoryPathOld = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\CreamInstaller";
internal static readonly string DirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\CreamInstaller"; internal static readonly string DirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\CreamInstaller";
@ -188,6 +188,7 @@ internal static class SteamCMD
if (openBracket != -1 && closeBracket != -1) if (openBracket != -1 && closeBracket != -1)
{ {
output = $"\"{appId}\"\n" + output[openBracket..(1 + closeBracket)]; output = $"\"{appId}\"\n" + output[openBracket..(1 + closeBracket)];
output = output.Replace("ERROR! Failed to install app '4' (Invalid platform)", "");
File.WriteAllText(appUpdateFile, output, Encoding.UTF8); File.WriteAllText(appUpdateFile, output, Encoding.UTF8);
} }
} }

View file

@ -5,7 +5,7 @@
<UseWindowsForms>True</UseWindowsForms> <UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon> <ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract> <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>2.3.3.1</Version> <Version>2.4.0.0</Version>
<PackageIcon>Resources\ini.ico</PackageIcon> <PackageIcon>Resources\ini.ico</PackageIcon>
<PackageIconUrl /> <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> <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>

View file

@ -485,6 +485,7 @@ internal partial class SelectForm : CustomForm
Dictionary<string, Image> images = new(); Dictionary<string, Image> images = new();
Task.Run(async () => Task.Run(async () =>
{ {
images["Notepad"] = Program.GetNotepadImage();
images["File Explorer"] = Program.GetFileExplorerImage(); images["File Explorer"] = Program.GetFileExplorerImage();
images["SteamDB"] = await Program.GetImageFromUrl("https://steamdb.info/favicon.ico"); images["SteamDB"] = await Program.GetImageFromUrl("https://steamdb.info/favicon.ico");
images["Steam Store"] = await Program.GetImageFromUrl("https://store.steampowered.com/favicon.ico"); images["Steam Store"] = await Program.GetImageFromUrl("https://store.steampowered.com/favicon.ico");
@ -505,6 +506,10 @@ internal partial class SelectForm : CustomForm
{ {
nodeContextMenu.Items.Add(new ToolStripMenuItem(selection.Name, selection.Icon)); nodeContextMenu.Items.Add(new ToolStripMenuItem(selection.Name, selection.Icon));
nodeContextMenu.Items.Add(new ToolStripSeparator()); nodeContextMenu.Items.Add(new ToolStripSeparator());
string appInfo = $@"{SteamCMD.AppInfoPath}\{appId}.vdf";
if (Directory.Exists(Directory.GetDirectoryRoot(appInfo)) && File.Exists(appInfo))
nodeContextMenu.Items.Add(new ToolStripMenuItem("Open AppInfo", Image("Notepad"),
new EventHandler((sender, e) => Program.OpenFileInNotepad(appInfo))));
nodeContextMenu.Items.Add(new ToolStripMenuItem("Open Root Directory", Image("File Explorer"), nodeContextMenu.Items.Add(new ToolStripMenuItem("Open Root Directory", Image("File Explorer"),
new EventHandler((sender, e) => Program.OpenDirectoryInFileExplorer(selection.RootDirectory)))); new EventHandler((sender, e) => Program.OpenDirectoryInFileExplorer(selection.RootDirectory))));
for (int i = 0; i < selection.SteamApiDllDirectories.Count; i++) for (int i = 0; i < selection.SteamApiDllDirectories.Count; i++)

View file

@ -75,6 +75,12 @@ internal static class Program
return null; return null;
} }
internal static void OpenFileInNotepad(string path) => Process.Start(new ProcessStartInfo
{
FileName = "notepad.exe",
Arguments = path
});
internal static void OpenDirectoryInFileExplorer(string path) => Process.Start(new ProcessStartInfo internal static void OpenDirectoryInFileExplorer(string path) => Process.Start(new ProcessStartInfo
{ {
FileName = "explorer.exe", FileName = "explorer.exe",
@ -89,6 +95,8 @@ internal static class Program
internal static Image GetFileIconImage(string path) => File.Exists(path) ? Icon.ExtractAssociatedIcon(path).ToBitmap() : null; internal static Image GetFileIconImage(string path) => File.Exists(path) ? Icon.ExtractAssociatedIcon(path).ToBitmap() : null;
internal static Image GetNotepadImage() => GetFileIconImage(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + @"\notepad.exe");
internal static Image GetFileExplorerImage() => GetFileIconImage(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + @"\explorer.exe"); internal static Image GetFileExplorerImage() => GetFileIconImage(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + @"\explorer.exe");
internal static bool IsProgramRunningDialog(Form form, ProgramSelection selection) internal static bool IsProgramRunningDialog(Form form, ProgramSelection selection)