Skip to content

Commit

Permalink
2.9.7
Browse files Browse the repository at this point in the history
- Updated anti-cheat binary
- Updated certificate
  • Loading branch information
Eavilaswayce committed May 11, 2024
1 parent c993879 commit c20ba70
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ obj/
.vs/
H1EmuLauncherSetup/Debug/
H1EmuLauncherSetup/Release/
H1EmuLauncherSetup/H1EmuLauncherCertificate.crt
H1EmuLauncherSetup/H1EmuLauncherCertificate.cer
H1EmuLauncherSetup/H1EmuLauncherCertificate.pfx
H1EmuLauncherSetup/PrivateKey.key
3 changes: 3 additions & 0 deletions H1EmuLauncher/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<setting name="autoMinimise" serializeAs="String">
<value>True</value>
</setting>
<setting name="gameVersionString" serializeAs="String">
<value />
</setting>
</H1EmuLauncher.Properties.Settings>
</userSettings>
</configuration>
39 changes: 18 additions & 21 deletions H1EmuLauncher/Classes/ApplyPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ namespace H1EmuLauncher.Classes
{
class ApplyPatchClass
{
public static string gameVersionString;
public static string latestPatchVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString().TrimEnd('0').TrimEnd('.');

public static void CheckPatch()
{
gameVersionString = LauncherWindow.gameVersionString;

switch (gameVersionString)
switch (Properties.Settings.Default.gameVersionString)
{
case "22dec2016":
case "kotk":
if (gameVersionString == "kotk" && Properties.Settings.Default.currentPatchVersionKotK != latestPatchVersion ||
gameVersionString == "22dec2016" && Properties.Settings.Default.currentPatchVersion2016 != latestPatchVersion ||
gameVersionString == "22dec2016" && Directory.Exists($"{Properties.Settings.Default.activeDirectory}\\BattlEye") ||
gameVersionString == "22dec2016" && !Directory.Exists($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoice") ||
gameVersionString == "22dec2016" && !File.Exists($"{Properties.Settings.Default.activeDirectory}\\Resources\\Assets\\Assets_256.pack") ||
if (Properties.Settings.Default.gameVersionString == "kotk" && Properties.Settings.Default.currentPatchVersionKotK != latestPatchVersion ||
Properties.Settings.Default.gameVersionString == "22dec2016" && Properties.Settings.Default.currentPatchVersion2016 != latestPatchVersion ||
Properties.Settings.Default.gameVersionString == "22dec2016" && Directory.Exists($"{Properties.Settings.Default.activeDirectory}\\BattlEye") ||
Properties.Settings.Default.gameVersionString == "22dec2016" && !Directory.Exists($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoice") ||
Properties.Settings.Default.gameVersionString == "22dec2016" && !File.Exists($"{Properties.Settings.Default.activeDirectory}\\Resources\\Assets\\Assets_256.pack") ||
!File.Exists($"{Properties.Settings.Default.activeDirectory}\\dinput8.dll") ||
!File.Exists($"{Properties.Settings.Default.activeDirectory}\\msvcp140d.dll") ||
!File.Exists($"{Properties.Settings.Default.activeDirectory}\\ucrtbased.dll") ||
Expand All @@ -36,8 +33,8 @@ public static void CheckPatch()
{
LauncherWindow.launcherInstance.playButton.IsEnabled = false;

if (gameVersionString == "22dec2016" && string.IsNullOrEmpty(Properties.Settings.Default.currentPatchVersion2016) ||
gameVersionString == "kotk" && string.IsNullOrEmpty(Properties.Settings.Default.currentPatchVersionKotK))
if (Properties.Settings.Default.gameVersionString == "22dec2016" && string.IsNullOrEmpty(Properties.Settings.Default.currentPatchVersion2016) ||
Properties.Settings.Default.gameVersionString == "kotk" && string.IsNullOrEmpty(Properties.Settings.Default.currentPatchVersionKotK))
LauncherWindow.launcherInstance.playButton.Content = LauncherWindow.launcherInstance.FindResource("item150").ToString();
else
LauncherWindow.launcherInstance.playButton.Content = LauncherWindow.launcherInstance.FindResource("item188").ToString();
Expand Down Expand Up @@ -86,14 +83,14 @@ public static void ApplyPatch()
// Unzip all of the files to directory
try
{
if (gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
{
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_2016.zip", Properties.Resources.Game_Patch_2016);
ZipFile.ExtractToDirectory($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_2016.zip", $"{Properties.Settings.Default.activeDirectory}", true);
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoicePatch.zip", Properties.Resources.H1EmuVoicePatch);
ZipFile.ExtractToDirectory($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoicePatch.zip", $"{Properties.Settings.Default.activeDirectory}", true);
}
else if (gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
{
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_KotK.zip", Properties.Resources.Game_Patch_KotK);
ZipFile.ExtractToDirectory($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_KotK.zip", $"{Properties.Settings.Default.activeDirectory}", true);
Expand All @@ -103,30 +100,30 @@ public static void ApplyPatch()
{
Application.Current.Dispatcher.Invoke(new Action(delegate
{
if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
CustomMessageBox.Show($"{LauncherWindow.launcherInstance.FindResource("item96")}\n\n{e.Message}", LauncherWindow.launcherInstance);
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
CustomMessageBox.Show($"{LauncherWindow.launcherInstance.FindResource("item97")}\n\n{e.Message}", LauncherWindow.launcherInstance);
}));
}

// Delete the .zip file, not needed anymore
if (gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
{
File.Delete($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_2016.zip");
File.Delete($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoicePatch.zip");
}
else if (gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
File.Delete($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_KotK.zip");

// Extra patch work for some versions
if (gameVersionString == "22dec2016" || gameVersionString == "kotk")
if (Properties.Settings.Default.gameVersionString == "22dec2016" || Properties.Settings.Default.gameVersionString == "kotk")
{
// Delete BattlEye folder to prevent Steam from trying to launch the game
if (Directory.Exists($"{Properties.Settings.Default.activeDirectory}\\BattlEye"))
Directory.Delete($"{Properties.Settings.Default.activeDirectory}\\BattlEye", true);

if (gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
{
// Extract Asset_256.pack to fix blackberries
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Resources\\Assets\\Assets_256.pack", Properties.Resources.Assets_256);
Expand All @@ -147,9 +144,9 @@ public static void ApplyPatch()
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\ClientConfig.ini", Properties.Resources.CustomClientConfig);

// Finish
if (gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
Properties.Settings.Default.currentPatchVersion2016 = latestPatchVersion;
else if (gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
Properties.Settings.Default.currentPatchVersionKotK = latestPatchVersion;

Properties.Settings.Default.Save();
Expand Down
6 changes: 3 additions & 3 deletions H1EmuLauncher/H1EmuLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<FileVersion>2.9.6</FileVersion>
<FileVersion>2.9.7</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Authors>H1Emu</Authors>
<Version>2.9.6</Version>
<Version>2.9.7</Version>
<AssemblyName>H1EmuLauncher</AssemblyName>
<SignAssembly>false</SignAssembly>
<Copyright>© H1Emu</Copyright>
<Product>H1Emu Launcher</Product>
<Description>A launcher for the H1Emu project.</Description>
<Title>H1Emu Launcher</Title>
<PackageIcon>Icon.ico</PackageIcon>
<AssemblyVersion>2.9.6</AssemblyVersion>
<AssemblyVersion>2.9.7</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions H1EmuLauncher/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions H1EmuLauncher/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
<Setting Name="autoMinimise" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="gameVersionString" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
Binary file modified H1EmuLauncher/Resources/H1Z1_FP.exe
Binary file not shown.
34 changes: 17 additions & 17 deletions H1EmuLauncher/SettingsPages/GameFiles.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void InstallPatchButton(object sender, RoutedEventArgs e)
if (!LauncherWindow.launcherInstance.CheckDirectory())
return;
switch (LauncherWindow.gameVersionString)
switch (Properties.Settings.Default.gameVersionString)
{
case "22dec2016":
case "kotk":
Expand All @@ -59,9 +59,9 @@ public void InstallPatchButton(object sender, RoutedEventArgs e)
{
ToggleButtons(true);
if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
CustomMessageBox.Show($"{FindResource("item96")} \"{er.Message}\".", SettingsWindow.settingsInstance);
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
CustomMessageBox.Show($"{FindResource("item97")} \"{er.Message}\".", SettingsWindow.settingsInstance);
}));
}
Expand Down Expand Up @@ -126,14 +126,14 @@ public void ApplyPatch()

try
{
if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
{
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_2016.zip", Properties.Resources.Game_Patch_2016);
ZipFile.ExtractToDirectory($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_2016.zip", $"{Properties.Settings.Default.activeDirectory}", true);
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoicePatch.zip", Properties.Resources.H1EmuVoicePatch);
ZipFile.ExtractToDirectory($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoicePatch.zip", $"{Properties.Settings.Default.activeDirectory}", true);
}
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
{
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_KotK.zip", Properties.Resources.Game_Patch_KotK);
ZipFile.ExtractToDirectory($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_KotK.zip", $"{Properties.Settings.Default.activeDirectory}", true);
Expand All @@ -143,9 +143,9 @@ public void ApplyPatch()
{
Application.Current.Dispatcher.Invoke(new Action(delegate
{
if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
CustomMessageBox.Show($"{LauncherWindow.launcherInstance.FindResource("item96")}\n\n{e.Message}", LauncherWindow.launcherInstance);
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
CustomMessageBox.Show($"{LauncherWindow.launcherInstance.FindResource("item97")}\n\n{e.Message}", LauncherWindow.launcherInstance);
}));
}
Expand All @@ -156,22 +156,22 @@ public void ApplyPatch()
settingsProgressText.Text = FindResource("item100").ToString();
}));

if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
{
File.Delete($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_2016.zip");
File.Delete($"{Properties.Settings.Default.activeDirectory}\\H1EmuVoicePatch.zip");
}
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
File.Delete($"{Properties.Settings.Default.activeDirectory}\\Game_Patch_KotK.zip");

// Extra patch work for some versions
if (LauncherWindow.gameVersionString == "22dec2016" || LauncherWindow.gameVersionString == "kotk")
if (Properties.Settings.Default.gameVersionString == "22dec2016" || Properties.Settings.Default.gameVersionString == "kotk")
{
// Delete BattlEye folder to prevent Steam from trying to launch the game
if (Directory.Exists($"{Properties.Settings.Default.activeDirectory}\\BattlEye"))
Directory.Delete($"{Properties.Settings.Default.activeDirectory}\\BattlEye", true);

if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
{
// Extract Asset_256.pack to fix blackberries
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Resources\\Assets\\Assets_256.pack", Properties.Resources.Assets_256);
Expand All @@ -195,9 +195,9 @@ public void ApplyPatch()
watch.Stop();
TimeSpan elapsedMs = watch.Elapsed;

if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
Properties.Settings.Default.currentPatchVersion2016 = ApplyPatchClass.latestPatchVersion;
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
Properties.Settings.Default.currentPatchVersionKotK = ApplyPatchClass.latestPatchVersion;

Properties.Settings.Default.Save();
Expand All @@ -209,9 +209,9 @@ public void ApplyPatch()
LauncherWindow.launcherInstance.taskbarIcon.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
settingsProgressBar.IsIndeterminate = false;

if (LauncherWindow.gameVersionString == "22dec2016")
if (Properties.Settings.Default.gameVersionString == "22dec2016")
CustomMessageBox.Show($"{FindResource("item103")}{Environment.NewLine}{Environment.NewLine}{FindResource("item101")} {$"{elapsedMs.Minutes}m {elapsedMs.Seconds}.{elapsedMs.Milliseconds.ToString().Remove(1)}s".TrimStart('0', 'm').TrimStart(' ')})", SettingsWindow.settingsInstance);
else if (LauncherWindow.gameVersionString == "kotk")
else if (Properties.Settings.Default.gameVersionString == "kotk")
CustomMessageBox.Show($"{FindResource("item104")}{Environment.NewLine}{Environment.NewLine}{FindResource("item101")} {$"{elapsedMs.Minutes}m {elapsedMs.Seconds}.{elapsedMs.Milliseconds.ToString().Remove(1)}s".TrimStart('0', 'm').TrimStart(' ')})", SettingsWindow.settingsInstance);
}));
}
Expand All @@ -225,7 +225,7 @@ public void InstallServerButton(object sender, RoutedEventArgs e)
if (!LauncherWindow.launcherInstance.CheckDirectory())
return;

if (LauncherWindow.gameVersionString == "processBeingUsed")
if (Properties.Settings.Default.gameVersionString == "processBeingUsed")
{
Dispatcher.Invoke(new Action(delegate
{
Expand All @@ -235,7 +235,7 @@ public void InstallServerButton(object sender, RoutedEventArgs e)
}));
return;
}
else if (string.IsNullOrEmpty(LauncherWindow.gameVersionString))
else if (string.IsNullOrEmpty(Properties.Settings.Default.gameVersionString))
{
Dispatcher.Invoke(new Action(delegate
{
Expand Down
Loading

0 comments on commit c20ba70

Please sign in to comment.