if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;
if (appDeploy.CheckForUpdate()) {
MessageBox.Show("Updating app, when done, I'll restart.");
appDeploy.Update();
Application.Restart();
}