I know it's an old Q. but, I will answer anyway. (hope it will help someone):
First, you need to check: Choose when the application should check for updates >> After the application starts.
Secondly, add this method to your code:
private Boolean isVersionOK()
{
UpdateCheckInfo info = null;
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
try
{
info = ad.CheckForDetailedUpdate();
}
catch (DeploymentDownloadException)
{
// No network connection
return false;
}
catch (InvalidDeploymentException)
{
return false;
}
catch (InvalidOperationException)
{
return false;
}
if (info.UpdateAvailable)
{
try
{
ad.Update();
Application.Restart();
Environment.Exit(0);
}
catch (DeploymentDownloadException)
{
// No network connection
}
return false;
}
return true;
}
else
{
return false;
}
}
Lastly, you just need to call isVersionOK() at the start of your app and in every few loops as needed to check for update. it will return TRUE if you are on your latest version otherwise it will return FALSE and expect the app will restart to a newer version automatically without user interaction.