optimize resources
This commit is contained in:
parent
303778a6fd
commit
2dd4c482ef
14 changed files with 138 additions and 152 deletions
|
@ -5,7 +5,7 @@
|
|||
<UseWindowsForms>True</UseWindowsForms>
|
||||
<ApplicationIcon>Resources\ini.ico</ApplicationIcon>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<Version>3.2.0.4</Version>
|
||||
<Version>3.2.0.5</Version>
|
||||
<PackageIcon>Resources\ini.ico</PackageIcon>
|
||||
<PackageIconUrl />
|
||||
<Description />
|
||||
|
@ -31,16 +31,6 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Resources\ini.ico" />
|
||||
<None Remove="Resources\steam_api.dll" />
|
||||
<None Remove="Resources\steam_api64.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\ini.ico" />
|
||||
<EmbeddedResource Include="Resources\steam_api.dll" />
|
||||
<EmbeddedResource Include="Resources\steam_api64.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Gameloop.Vdf" Version="0.6.1" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
|
||||
|
|
|
@ -50,12 +50,12 @@ internal static class EpicLibrary
|
|||
{
|
||||
List<string> dllDirectories = new();
|
||||
if (Program.Canceled || !Directory.Exists(gameDirectory)) return null;
|
||||
gameDirectory.GetScreamApiComponents(out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi);
|
||||
if (File.Exists(sdk)
|
||||
|| File.Exists(sdk_o)
|
||||
gameDirectory.GetScreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
|
||||
if (File.Exists(sdk32)
|
||||
|| File.Exists(sdk32_o)
|
||||
|| File.Exists(sdk64)
|
||||
|| File.Exists(sdk64_o)
|
||||
|| File.Exists(sApi))
|
||||
|| File.Exists(config))
|
||||
dllDirectories.Add(gameDirectory);
|
||||
string[] directories = Directory.GetDirectories(gameDirectory);
|
||||
foreach (string _directory in directories)
|
||||
|
|
|
@ -74,70 +74,70 @@ internal partial class InstallForm : CustomForm
|
|||
|
||||
internal static async Task UninstallCreamAPI(string directory, InstallForm installForm = null) => await Task.Run(() =>
|
||||
{
|
||||
directory.GetCreamApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string cApi);
|
||||
if (File.Exists(api_o))
|
||||
directory.GetCreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
|
||||
if (File.Exists(sdk32_o))
|
||||
{
|
||||
if (File.Exists(api))
|
||||
if (File.Exists(sdk32))
|
||||
{
|
||||
File.Delete(api);
|
||||
File.Delete(sdk32);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(api)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(sdk32)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
File.Move(api_o, api);
|
||||
File.Move(sdk32_o, sdk32);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(api_o)} -> {Path.GetFileName(api)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk32_o)} -> {Path.GetFileName(sdk32)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(api64_o))
|
||||
if (File.Exists(sdk64_o))
|
||||
{
|
||||
if (File.Exists(api64))
|
||||
if (File.Exists(sdk64))
|
||||
{
|
||||
File.Delete(api64);
|
||||
File.Delete(sdk64);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(api64)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(sdk64)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
File.Move(api64_o, api64);
|
||||
File.Move(sdk64_o, sdk64);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(api64_o)} -> {Path.GetFileName(api64)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk64_o)} -> {Path.GetFileName(sdk64)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(cApi))
|
||||
if (File.Exists(config))
|
||||
{
|
||||
File.Delete(cApi);
|
||||
File.Delete(config);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(cApi)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(config)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
});
|
||||
|
||||
internal static async Task InstallCreamAPI(string directory, ProgramSelection selection, InstallForm installForm = null) => await Task.Run(() =>
|
||||
{
|
||||
directory.GetCreamApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string cApi);
|
||||
if (File.Exists(api) && !File.Exists(api_o))
|
||||
directory.GetCreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
|
||||
if (File.Exists(sdk32) && !File.Exists(sdk32_o))
|
||||
{
|
||||
File.Move(api, api_o);
|
||||
File.Move(sdk32, sdk32_o);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(api)} -> {Path.GetFileName(api_o)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk32)} -> {Path.GetFileName(sdk32_o)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(api_o))
|
||||
if (File.Exists(sdk32_o))
|
||||
{
|
||||
Properties.Resources.API.Write(api);
|
||||
Properties.Resources.Steamworks32.Write(sdk32);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(api)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(sdk32)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(api64) && !File.Exists(api64_o))
|
||||
if (File.Exists(sdk64) && !File.Exists(sdk64_o))
|
||||
{
|
||||
File.Move(api64, api64_o);
|
||||
File.Move(sdk64, sdk64_o);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(api64)} -> {Path.GetFileName(api64_o)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk64)} -> {Path.GetFileName(sdk64_o)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(api64_o))
|
||||
if (File.Exists(sdk64_o))
|
||||
{
|
||||
Properties.Resources.API64.Write(api64);
|
||||
Properties.Resources.Steamworks64.Write(sdk64);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(api64)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(sdk64)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser("Generating CreamAPI configuration for " + selection.Name + $" in directory \"{directory}\" . . . ", InstallationLog.Operation);
|
||||
File.Create(cApi).Close();
|
||||
StreamWriter writer = new(cApi, true, Encoding.UTF8);
|
||||
File.Create(config).Close();
|
||||
StreamWriter writer = new(config, true, Encoding.UTF8);
|
||||
if (selection.Id != "ParadoxLauncher")
|
||||
WriteCreamConfiguration(writer, selection.Id, selection.Name, selection.SelectedDlc, installForm);
|
||||
foreach (Tuple<string, string, SortedList<string, (DlcType type, string name, string icon)>> extraAppDlc in selection.ExtraDlc)
|
||||
|
@ -206,18 +206,18 @@ internal partial class InstallForm : CustomForm
|
|||
|
||||
internal static async Task UninstallScreamAPI(string directory, InstallForm installForm = null) => await Task.Run(() =>
|
||||
{
|
||||
directory.GetScreamApiComponents(out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi);
|
||||
if (File.Exists(sdk_o))
|
||||
directory.GetScreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
|
||||
if (File.Exists(sdk32_o))
|
||||
{
|
||||
if (File.Exists(sdk))
|
||||
if (File.Exists(sdk32))
|
||||
{
|
||||
File.Delete(sdk);
|
||||
File.Delete(sdk32);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(sdk)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(sdk32)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
File.Move(sdk_o, sdk);
|
||||
File.Move(sdk32_o, sdk32);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk_o)} -> {Path.GetFileName(sdk)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk32_o)} -> {Path.GetFileName(sdk32)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(sdk64_o))
|
||||
{
|
||||
|
@ -231,28 +231,28 @@ internal partial class InstallForm : CustomForm
|
|||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk64_o)} -> {Path.GetFileName(sdk64)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(sApi))
|
||||
if (File.Exists(config))
|
||||
{
|
||||
File.Delete(sApi);
|
||||
File.Delete(config);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(sApi)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Deleted file: {Path.GetFileName(config)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
});
|
||||
|
||||
internal static async Task InstallScreamAPI(string directory, ProgramSelection selection, InstallForm installForm = null) => await Task.Run(() =>
|
||||
{
|
||||
directory.GetScreamApiComponents(out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi);
|
||||
if (File.Exists(sdk) && !File.Exists(sdk_o))
|
||||
directory.GetScreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
|
||||
if (File.Exists(sdk32) && !File.Exists(sdk32_o))
|
||||
{
|
||||
File.Move(sdk, sdk_o);
|
||||
File.Move(sdk32, sdk32_o);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk)} -> {Path.GetFileName(sdk_o)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Renamed file: {Path.GetFileName(sdk32)} -> {Path.GetFileName(sdk32_o)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(sdk_o))
|
||||
if (File.Exists(sdk32_o))
|
||||
{
|
||||
Properties.Resources.SDK.Write(sdk);
|
||||
Properties.Resources.EpicOnlineServices32.Write(sdk32);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(sdk)}", InstallationLog.Resource, info: false);
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(sdk32)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (File.Exists(sdk64) && !File.Exists(sdk64_o))
|
||||
{
|
||||
|
@ -262,14 +262,14 @@ internal partial class InstallForm : CustomForm
|
|||
}
|
||||
if (File.Exists(sdk64_o))
|
||||
{
|
||||
Properties.Resources.SDK64.Write(sdk64);
|
||||
Properties.Resources.EpicOnlineServices64.Write(sdk64);
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser($"Wrote resource to file: {Path.GetFileName(sdk64)}", InstallationLog.Resource, info: false);
|
||||
}
|
||||
if (installForm is not null)
|
||||
installForm.UpdateUser("Generating ScreamAPI configuration for " + selection.Name + $" in directory \"{directory}\" . . . ", InstallationLog.Operation);
|
||||
File.Create(sApi).Close();
|
||||
StreamWriter writer = new(sApi, true, Encoding.UTF8);
|
||||
File.Create(config).Close();
|
||||
StreamWriter writer = new(config, true, Encoding.UTF8);
|
||||
if (selection.Id != "ParadoxLauncher")
|
||||
WriteScreamConfiguration(writer, selection.SelectedDlc, installForm);
|
||||
foreach (Tuple<string, string, SortedList<string, (DlcType type, string name, string icon)>> extraAppDlc in selection.ExtraDlc)
|
||||
|
|
|
@ -60,7 +60,6 @@ internal partial class MainForm : CustomForm
|
|||
GithubPackageResolver resolver = new("pointfeev", "CreamInstaller", "CreamInstaller.zip");
|
||||
ZipPackageExtractor extractor = new();
|
||||
updateManager = new(AssemblyMetadata.FromAssembly(Program.EntryAssembly, Program.CurrentProcessFilePath), resolver, extractor);
|
||||
|
||||
if (latestVersion is null)
|
||||
{
|
||||
CheckForUpdatesResult checkForUpdatesResult = null;
|
||||
|
@ -78,13 +77,7 @@ internal partial class MainForm : CustomForm
|
|||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
if (latestVersion is null)
|
||||
{
|
||||
updateManager.Dispose();
|
||||
StartProgram();
|
||||
}
|
||||
else
|
||||
if (latestVersion is not null)
|
||||
{
|
||||
Size = new(420, 300);
|
||||
label1.Text = $"An update is available: v{latestVersion}";
|
||||
|
@ -117,7 +110,12 @@ internal partial class MainForm : CustomForm
|
|||
}
|
||||
});
|
||||
}
|
||||
versions = null;
|
||||
}
|
||||
updateManager.Dispose();
|
||||
updateManager = null;
|
||||
|
||||
StartProgram();
|
||||
}
|
||||
|
||||
private void OnLoad(object sender, EventArgs _)
|
||||
|
|
|
@ -58,22 +58,22 @@ internal static class Program
|
|||
return false;
|
||||
}
|
||||
|
||||
internal static void GetCreamApiComponents(this string directory, out string api, out string api_o, out string api64, out string api64_o, out string cApi)
|
||||
internal static void GetCreamApiComponents(this string directory, out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config)
|
||||
{
|
||||
api = directory + @"\steam_api.dll";
|
||||
api_o = directory + @"\steam_api_o.dll";
|
||||
api64 = directory + @"\steam_api64.dll";
|
||||
api64_o = directory + @"\steam_api64_o.dll";
|
||||
cApi = directory + @"\cream_api.ini";
|
||||
sdk32 = directory + @"\steam_api.dll";
|
||||
sdk32_o = directory + @"\steam_api_o.dll";
|
||||
sdk64 = directory + @"\steam_api64.dll";
|
||||
sdk64_o = directory + @"\steam_api64_o.dll";
|
||||
config = directory + @"\cream_api.ini";
|
||||
}
|
||||
|
||||
internal static void GetScreamApiComponents(this string directory, out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi)
|
||||
internal static void GetScreamApiComponents(this string directory, out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config)
|
||||
{
|
||||
sdk = directory + @"\EOSSDK-Win32-Shipping.dll";
|
||||
sdk_o = directory + @"\EOSSDK-Win32-Shipping_o.dll";
|
||||
sdk32 = directory + @"\EOSSDK-Win32-Shipping.dll";
|
||||
sdk32_o = directory + @"\EOSSDK-Win32-Shipping_o.dll";
|
||||
sdk64 = directory + @"\EOSSDK-Win64-Shipping.dll";
|
||||
sdk64_o = directory + @"\EOSSDK-Win64-Shipping_o.dll";
|
||||
sApi = directory + @"\ScreamAPI.json";
|
||||
config = directory + @"\ScreamAPI.json";
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
|
|
|
@ -43,19 +43,19 @@ internal class ProgramSelection
|
|||
{
|
||||
foreach (string directory in DllDirectories)
|
||||
{
|
||||
directory.GetCreamApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string cApi);
|
||||
if (api.IsFilePathLocked()
|
||||
|| api_o.IsFilePathLocked()
|
||||
|| api64.IsFilePathLocked()
|
||||
|| api64_o.IsFilePathLocked()
|
||||
|| cApi.IsFilePathLocked())
|
||||
return true;
|
||||
directory.GetScreamApiComponents(out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi);
|
||||
if (sdk.IsFilePathLocked()
|
||||
|| sdk_o.IsFilePathLocked()
|
||||
directory.GetCreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
|
||||
if (sdk32.IsFilePathLocked()
|
||||
|| sdk32_o.IsFilePathLocked()
|
||||
|| sdk64.IsFilePathLocked()
|
||||
|| sdk64_o.IsFilePathLocked()
|
||||
|| sApi.IsFilePathLocked())
|
||||
|| config.IsFilePathLocked())
|
||||
return true;
|
||||
directory.GetScreamApiComponents(out sdk32, out sdk32_o, out sdk64, out sdk64_o, out config);
|
||||
if (sdk32.IsFilePathLocked()
|
||||
|| sdk32_o.IsFilePathLocked()
|
||||
|| sdk64.IsFilePathLocked()
|
||||
|| sdk64_o.IsFilePathLocked()
|
||||
|| config.IsFilePathLocked())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
16
CreamInstaller/Properties/Resources.Designer.cs
generated
16
CreamInstaller/Properties/Resources.Designer.cs
generated
|
@ -63,9 +63,9 @@ namespace CreamInstaller.Properties {
|
|||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] API {
|
||||
internal static byte[] EpicOnlineServices32 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("API", resourceCulture);
|
||||
object obj = ResourceManager.GetObject("EpicOnlineServices32", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ namespace CreamInstaller.Properties {
|
|||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] API64 {
|
||||
internal static byte[] EpicOnlineServices64 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("API64", resourceCulture);
|
||||
object obj = ResourceManager.GetObject("EpicOnlineServices64", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
@ -93,9 +93,9 @@ namespace CreamInstaller.Properties {
|
|||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] SDK {
|
||||
internal static byte[] Steamworks32 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("SDK", resourceCulture);
|
||||
object obj = ResourceManager.GetObject("Steamworks32", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
@ -103,9 +103,9 @@ namespace CreamInstaller.Properties {
|
|||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] SDK64 {
|
||||
internal static byte[] Steamworks64 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("SDK64", resourceCulture);
|
||||
object obj = ResourceManager.GetObject("Steamworks64", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,19 +118,19 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="API" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\steam_api.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="API64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\steam_api64.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\ini.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="SDK" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\EOSSDK-Win32-Shipping.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<data name="Steamworks32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\creamapi\steam_api.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="SDK64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\EOSSDK-Win64-Shipping.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<data name="Steamworks64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\creamapi\steam_api64.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="EpicOnlineServices32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\screamapi\eossdk-win32-shipping.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="EpicOnlineServices64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\screamapi\eossdk-win64-shipping.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
|
@ -635,72 +635,68 @@ internal partial class SelectForm : CustomForm
|
|||
new EventHandler(async (sender, e) =>
|
||||
{
|
||||
if (!Program.IsProgramRunningDialog(this, selection)) return;
|
||||
|
||||
byte[] cApiIni = null;
|
||||
byte[] properApi = null;
|
||||
byte[] properApi64 = null;
|
||||
|
||||
byte[] sApiJson = null;
|
||||
byte[] properSdk = null;
|
||||
byte[] properSdk64 = null;
|
||||
|
||||
byte[] creamConfig = null;
|
||||
byte[] steamOriginalSdk32 = null;
|
||||
byte[] steamOriginalSdk64 = null;
|
||||
byte[] screamConfig = null;
|
||||
byte[] epicOriginalSdk32 = null;
|
||||
byte[] epicOriginalSdk64 = null;
|
||||
foreach (string directory in selection.DllDirectories)
|
||||
{
|
||||
directory.GetCreamApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string cApi);
|
||||
if (cApiIni is null && File.Exists(cApi))
|
||||
cApiIni = File.ReadAllBytes(cApi);
|
||||
directory.GetCreamApiComponents(out string sdk32, out string _, out string sdk64, out string _, out string config);
|
||||
if (creamConfig is null && File.Exists(config))
|
||||
creamConfig = File.ReadAllBytes(config);
|
||||
await InstallForm.UninstallCreamAPI(directory);
|
||||
if (properApi is null && File.Exists(api) && !Properties.Resources.API.EqualsFile(api))
|
||||
properApi = File.ReadAllBytes(api);
|
||||
if (properApi64 is null && File.Exists(api64) && !Properties.Resources.API64.EqualsFile(api64))
|
||||
properApi64 = File.ReadAllBytes(api64);
|
||||
|
||||
directory.GetScreamApiComponents(out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi);
|
||||
if (sApiJson is null && File.Exists(sApi))
|
||||
sApiJson = File.ReadAllBytes(sApi);
|
||||
if (steamOriginalSdk32 is null && File.Exists(sdk32) && !Properties.Resources.Steamworks32.EqualsFile(sdk32))
|
||||
steamOriginalSdk32 = File.ReadAllBytes(sdk32);
|
||||
if (steamOriginalSdk64 is null && File.Exists(sdk64) && !Properties.Resources.Steamworks64.EqualsFile(sdk64))
|
||||
steamOriginalSdk64 = File.ReadAllBytes(sdk64);
|
||||
directory.GetScreamApiComponents(out sdk32, out string _, out sdk64, out string _, out config);
|
||||
if (screamConfig is null && File.Exists(config))
|
||||
screamConfig = File.ReadAllBytes(config);
|
||||
await InstallForm.UninstallScreamAPI(directory);
|
||||
if (properSdk is null && File.Exists(sdk) && !Properties.Resources.SDK.EqualsFile(sdk))
|
||||
properSdk = File.ReadAllBytes(sdk);
|
||||
if (properSdk64 is null && File.Exists(sdk64) && !Properties.Resources.SDK64.EqualsFile(sdk64))
|
||||
properSdk64 = File.ReadAllBytes(sdk64);
|
||||
if (epicOriginalSdk32 is null && File.Exists(sdk32) && !Properties.Resources.EpicOnlineServices32.EqualsFile(sdk32))
|
||||
epicOriginalSdk32 = File.ReadAllBytes(sdk32);
|
||||
if (epicOriginalSdk64 is null && File.Exists(sdk64) && !Properties.Resources.EpicOnlineServices64.EqualsFile(sdk64))
|
||||
epicOriginalSdk64 = File.ReadAllBytes(sdk64);
|
||||
}
|
||||
if (properApi is not null || properApi64 is not null || properSdk is not null || properSdk64 is not null)
|
||||
if (steamOriginalSdk32 is not null || steamOriginalSdk64 is not null || epicOriginalSdk32 is not null || epicOriginalSdk64 is not null)
|
||||
{
|
||||
bool neededRepair = false;
|
||||
foreach (string directory in selection.DllDirectories)
|
||||
{
|
||||
directory.GetCreamApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string cApi);
|
||||
if (properApi is not null && Properties.Resources.API.EqualsFile(api))
|
||||
directory.GetCreamApiComponents(out string sdk32, out string _, out string sdk64, out string _, out string config);
|
||||
if (steamOriginalSdk32 is not null && Properties.Resources.Steamworks32.EqualsFile(sdk32))
|
||||
{
|
||||
properApi.Write(api);
|
||||
steamOriginalSdk32.Write(sdk32);
|
||||
neededRepair = true;
|
||||
}
|
||||
if (properApi64 is not null && Properties.Resources.API64.EqualsFile(api64))
|
||||
if (steamOriginalSdk64 is not null && Properties.Resources.Steamworks64.EqualsFile(sdk64))
|
||||
{
|
||||
properApi64.Write(api64);
|
||||
steamOriginalSdk64.Write(sdk64);
|
||||
neededRepair = true;
|
||||
}
|
||||
if (cApiIni is not null)
|
||||
if (creamConfig is not null)
|
||||
{
|
||||
await InstallForm.InstallCreamAPI(directory, selection);
|
||||
cApiIni.Write(cApi);
|
||||
creamConfig.Write(config);
|
||||
}
|
||||
|
||||
directory.GetScreamApiComponents(out string sdk, out string sdk_o, out string sdk64, out string sdk64_o, out string sApi);
|
||||
if (properSdk is not null && Properties.Resources.SDK.EqualsFile(sdk))
|
||||
directory.GetScreamApiComponents(out sdk32, out string _, out sdk64, out string _, out config);
|
||||
if (epicOriginalSdk32 is not null && Properties.Resources.EpicOnlineServices32.EqualsFile(sdk32))
|
||||
{
|
||||
properSdk.Write(sdk);
|
||||
epicOriginalSdk32.Write(sdk32);
|
||||
neededRepair = true;
|
||||
}
|
||||
if (properSdk64 is not null && Properties.Resources.SDK64.EqualsFile(sdk64))
|
||||
if (epicOriginalSdk64 is not null && Properties.Resources.EpicOnlineServices64.EqualsFile(sdk64))
|
||||
{
|
||||
properSdk64.Write(sdk64);
|
||||
epicOriginalSdk64.Write(sdk64);
|
||||
neededRepair = true;
|
||||
}
|
||||
if (sApiJson is not null)
|
||||
if (screamConfig is not null)
|
||||
{
|
||||
await InstallForm.InstallScreamAPI(directory, selection);
|
||||
sApiJson.Write(sApi);
|
||||
screamConfig.Write(config);
|
||||
}
|
||||
}
|
||||
if (neededRepair)
|
||||
|
|
|
@ -41,6 +41,8 @@ internal static class HttpClientManager
|
|||
|
||||
internal static async Task<HtmlNodeCollection> GetDocumentNodes(string url, string xpath) => (await EnsureGet(url))?.ToHtmlDocument()?.DocumentNode?.SelectNodes(xpath);
|
||||
|
||||
internal static HtmlNodeCollection GetDocumentNodes(this HtmlAgilityPack.HtmlDocument htmlDocument, string xpath) => htmlDocument.DocumentNode?.SelectNodes(xpath);
|
||||
|
||||
internal static async Task<Image> GetImageFromUrl(string url)
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Reference in a new issue