public SilentUpdater()
 {
     if (!ApplicationDeployment.IsNetworkDeployed)
         return;
     applicationDeployment = ApplicationDeployment.CurrentDeployment;
     applicationDeployment.UpdateCompleted += UpdateCompleted;
     applicationDeployment.UpdateProgressChanged += UpdateProgressChanged;
     timer.Elapsed += (sender, args) =>
                          {
                              if (processing)
                                  return;
                              processing = true;
                              try
                              {
                                  if (applicationDeployment.CheckForUpdate(false))
                                      applicationDeployment.UpdateAsync();
                                  else
                                      processing = false;
                              }
                              catch(Exception ex)
                              {
                                  Debug.WriteLine("Check for update failed. " + ex.Message);
                                  processing = false;
                              }
                          };
     timer.Start();
 }