wyUpdate InstallNow() Question

This is a WPF project in 4.5.2

I'm trying to get the following steps to happen:

1) wyUpdate looks for updates in the background. (working)2) If it finds an update, it downloads the update and alerts the user. (working)3) The user alert is a MessageBox with a Yes/No to install new version (working)4) If the user clicks Yes, it installs and then restarts the application (not working)

I'm using wyUpdater.InstallNow(); to install the update, which does install the update, but then wyUpdate tells the user it will take effect when they restart the application. What I want is an event that fires after InstallNow() completes that I can use to manually close the application or some way to tell wyUpdate that it is okay to restart the application after InstallNow(). I tried UpdateSuccessful, but that doesn't appear to work.

The reason I'm not using wyUpdater.UpdateType = wyDay.Controls.UpdateType.Automatic is that most users of my application won't have admin rights to the machine they're on. I don't want to get into a situation where they can't use the application because it keeps closing to update and they have no ability to give it permission to update. If there's some way around this, that would also help the situation.

The reason I'm not using wyUpdater.UpdateType = wyDay.Controls.UpdateType.Automatic is that many users won't have admin rights, and I don't want to get into a situation where they can't use the application because it wants to update. Basically, I just need to be able to give the user control over whether or not they update, and if they do want to update, I want it to be as simple as possible.

What would be the best way to go about this?

You should use the CloseAppNow event and make sure you app is not intercepting and canceling the close event: https://wyday.com/wybuild/help/automatic-updates/members.php

Let me know if that helps.

Here's what I wrote:

protected void wy_ReadyToBeInstalled(object sender, EventArgs e) { if (!askAboutUpdate) return;

string msg = $"A new version is available (version {wyUpdater.Version}). Would you like to install this now? This will close the application.\nUpdate Details:\n{wyUpdater.Changes}"; string title = "Update available";

var response = MessageBox.Show(msg, title, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); if (response == MessageBoxResult.Yes) { ///TODO: Needs to restart if they hit Yes, but AFTER InstallNow() completes checkShutdown = false; wyUpdater.InstallNow(); }

askAboutUpdate = false; }

protected void wy_CloseAppNow(object sender, EventArgs e) { MessageBox.Show("wy_CloseAppNow Called"); this.Close(); }

This doesn't work.

The CloseAppNow event does not fire. The wyUpdate control says "Update will be installed on next start." The menu option says "Install update now."

When I close the application and start it the next time after this occurs, that's when it fires off the CloseAppNow event.

What I need it to do is to close the application after InstallNow() completes instead of trusting the user to do so.