Sorry about the formatting D:
Also it was onlineModeButton.Enabled, not .Active.
Any ideas 🙁?
I am coding in C# and my game is being coded in XNA Game Studio.The program entry point first opens a WinForm which is used for the player to log into their online account. I want it so that only people with the latest can login.
private void Login_Load(object sender, EventArgs e) { // Sets controls after the form has loaded onlineModeButton.Enabled = false; connectionStatusLabel.Visible = false; connectionProgress.Visible = false; usernameBox.Text = user; passwordBox.Text = pass; if (user != "" && pass != "") { saveDetailsCheckbox.Checked = true; } automaticUpdater1.ReadyToBeInstalled += new EventHandler(automaticUpdater1_ReadyToBeInstalled); automaticUpdater1.ForceCheckForUpdate(); }
The code for ReadyToBeInstalled is:
void automaticUpdater1_ReadyToBeInstalled (object sender, EventArgs e) { MessageBox.Show("An update is available, please update the game\nYou will need to do this to play online", "New version available". onlineModeButton.Active = false; }
I am using the Automatic mode of the updater and yet this event never seems to be triggered
Sorry about the formatting D:
Also it was onlineModeButton.Enabled, not .Active.
Any ideas 🙁?
The AutomaticUpdater is asynchronous, but it seems like for your purposes (you want to force the user to update) you're better off using wyUpdate as a standalone updater. That is, you can force the user through the update process.
The AutomaticUpdater is used best when the updates are allowed to be "trickled in". That is, they can be downloaded, extracted, etc., in the background. You want to update everything up front, thus wyUpdate as a standalone updater is the best choice.
I am using the Automatic mode of the updater and yet this event never seems to be triggered
Are you getting any errors? Are you handling the other events?
The AutomaticUpdater is asynchronous, but it seems like for your purposes (you want to force the user to update) you're better off using wyUpdate as a standalone updater. That is, you can force the user through the update process.
The AutomaticUpdater is used best when the updates are allowed to be "trickled in". That is, they can be downloaded, extracted, etc., in the background. You want to update everything up front, thus wyUpdate as a standalone updater is the best choice.
I am using the Automatic mode of the updater and yet this event never seems to be triggeredAre you getting any errors? Are you handling the other events?
Hi there Wyatt, thanks for taking the time to reply.
I am not sure where in that tutorial it will tell me.My idea would be to modify it so that when the user presses the "Play Online" button (updates should only be forced online - therefore no one plays with a pre-nerfed client or something) it will run the silent mode.How can I do it to check for the returning code?
Would it be:System.Diagnostics.Process updateCheck = new System.Diagnostics.Process();updateCheck.StartInfo.FileName = "wyUpdate.exe";updateCheck.StartInfo.Arguments = "/quickcheck /justcheck /noerr";updateCheck.Start();updateCheck.WaitForExit();if (updateCheck.ExitCode == "2") {// Update Code Here -- a.k.a kill my game process and start the wyUpdate.exe} else if (updateCheck.ExitCode == "1") {// Update Error Code here -- a.k.a message box saying update couldn't complete and to please wait} else {// Continue login code here}
Also just as a check, I only update static files (since my game is XNA) that would be all content pipeline files, all DLLs and the exe (but not any settings files for the user such as keybindings). Right?
It seems to be working okay. http://i.imgur.com/VAT0R.png
I also added a flag called AnnieDSR.debugMode so that it won't check for updates at all if the config is debug (a.k.a testing in VS2010) 😀
I'll test this now in release