tags:

views:

78

answers:

1

I understand that ClickOnce applications can update automatically. However, the options offered by Microsoft are not what I am looking for.

If I check the version before the application starts, the startup is slower.

If I chek the version after the application starts, I don't know than a new version is available until the next startup.

I am looking for a boolean function to check if a new version is available. This would enable me to suggest to the user to restart the application.

+4  A: 
using System.Deployment.Application;

public bool IsUpdateAvailable()
{
    if (!ApplicationDeployment.IsNetworkDeployed) return false;

    return ApplicationDeployment.CurrentDeployment.CheckForUpdate();         
}

Of course, you might want to make this feature accessible via a button and wrap some UI around it, like this.

Matt Hamilton
+1 interesting blog post as well
SnOrfus