private async void InstallButton_Click(object sender, EventArgs e)
{
// Display the LoadingForm. This is a Modal so the mainform is locked
LoadingForm.ShowScreen(this, true);
SetNativeEnabled(false);
// Install or Remove files
try
{
// Put this in a task incase the HDD is being slow (busy)
await Task.Run(() =>
{
if (!StatsPython.Installed)
StatsPython.BackupAndInstall();
else
StatsPython.RemoveAndRestore();
});
}
catch (Exception E)
{
Program.ErrorLog.Write("ERROR: [BF2sPythonInstall] " + E.Message);
throw;
}
finally
{
// Unlock now that we are done
CheckPythonStatus();
SetNativeEnabled(true);
LoadingForm.CloseForm();
}
}