restart application on updates found possible?

I intend to automatically check for updates and if it verifies an update available the application would restart itself .

Here is what i did

if(updater. updater.ForceCheckForUpdate())Applicaition.restart();

But the application crashes when it comes to this part of the code .

My assumption is that ForceCheckForUpdate() returns a bool if there is an updateavailable . Please let me know if I am making a mistake , and if there is an alternate solution

My assumption is that ForceCheckForUpdate() returns a bool if there is an updateavailable . Please let me know if I am making a mistake , and if there is an alternate solution

This is a mistake. ForceCheckForUpdate() returns whether checking has begun, not where there's an update or not. Use the "UpdateAvailable" and "UpToDate" events to check whether there's an update available or not.

It sounds like what you're looking for is to install an update when it has downloaded an extracted. Here's a snippet of code to use:

static void auBackend_ReadyToBeInstalled(object sender, EventArgs e){    // ReadyToBeInstalled event is called when    // either the UpdateStepOn == UpdateDownloaded or UpdateReadyToInstall


    if (auBackend.UpdateStepOn == UpdateStepOn.UpdateReadyToInstall)    {        // here we'll just close immediately to install the new version        auBackend.InstallNow();    }}

awesome .. that helped a lot .