Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Commit

Permalink
add "apply patch" button
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGruber committed Dec 2, 2020
1 parent ed8e1af commit 3235d57
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
8 changes: 8 additions & 0 deletions H1emu/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
FontSize="18">
Install Nodejs
</Button>
<Button
Margin="0,20,0,0"
Padding="5,10,5,10"
Click="ApplyPatch_OnClick"
FontFamily="A Love of Thunder"
FontSize="18">
Apply Patch
</Button>
<Button
Margin="0,20,0,0"
Padding="5,10,5,10"
Expand Down
27 changes: 26 additions & 1 deletion H1emu/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@ private void InstallNodejs_OnClick(object sender, RoutedEventArgs e)
}
}
}

private void ApplyPatch_OnClick(object sender, RoutedEventArgs e)
{
Process p = new Process();
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "cmd.exe";
info.RedirectStandardInput = true;
info.UseShellExecute = false;

p.StartInfo = info;
p.Start();

using (StreamWriter sw = p.StandardInput)
{
if (sw.BaseStream.CanWrite)
{
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output dinput8.dll https://h1emu.s3.eu-west-3.amazonaws.com/patch/dinput8.dll");
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output msvcp140d.dll https://h1emu.s3.eu-west-3.amazonaws.com/patch/msvcp140d.dll");
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output ucrtbased.dll https://h1emu.s3.eu-west-3.amazonaws.com/patch/ucrtbased.dll");
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output vcruntime140_1d.dll https://h1emu.s3.eu-west-3.amazonaws.com/patch/vcruntime140_1d.dll");
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output vcruntime140d.dll https://h1emu.s3.eu-west-3.amazonaws.com/patch/vcruntime140d.dll");
}
}
}


private void LaunchH1Z1_OnClick(object sender, RoutedEventArgs e)
{
Expand Down Expand Up @@ -124,7 +149,7 @@ private void InstallServer_OnClick(object sender, RoutedEventArgs e)
if (sw.BaseStream.CanWrite)
{
sw.WriteLine("rd /s /q H1emuServersFiles");
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output h1z1-server-QuickStart-master.zip " + ServerFilesRepo);
sw.WriteLine("curl -LJO -H 'Cache-Control: no-cache' --output patch.zip " + ServerFilesRepo);

}
}
Expand Down

0 comments on commit 3235d57

Please sign in to comment.