private void btnPatch_Click(object sender, EventArgs e) { //if Primal Launcher can write to the game installation folder if (Patcher.HasWritePermission()) { Patcher.PatchExecutableFiles(); } else { MessageBox.Show("Primal Launcher", "You need write permissions in the game installation folder. Please close this program, right-click the shortcut and select 'Run as administrator'. This operation is required only once. Aborting patching operation."); } }
} //end updateChecker_RunWorkerCompleted private void btnCheck_Click(object sender, EventArgs e) { this.btnCheck.Enabled = false; var patchForm = new Patcher(this._config, true, true); if (!patchForm.IsDisposed) { patchForm.ShowDialog(); } this.btnCheck.Enabled = true; } //end btnCheck_Click
void UpdateBuild(DateTime last, bool release, bool dx) { Build build = release ? stable : dev; if (last == DateTime.MinValue || build.DirectXSize < 50000 || build.OpenGLSize < 50000) { return; } string path = dx ? build.DirectXPath : build.OpenGLPath; Utils.LogDebug("Updating to: " + path); Patcher.PatchTime = build.TimeBuilt; Patcher.Update(path); game.ShouldExit = true; game.ShouldUpdate = true; }
private void BtnPatchExe_Click(object sender, EventArgs e) => Task.Run(() => { Patcher.PatchExecutableFiles(); });