Пример #1
0
 private static void UninstallThreadStart()
 {
     IsInstalled = !InstallUtil(false);
     if (!IsInstalled)
     {
         try
         {
             string dirPath = Path.GetDirectoryName(InstallFilePath);
             if (dirPath != null)
             {
                 foreach (string file in Directory.GetFiles(dirPath))
                 {
                     File.Delete(file);
                 }
                 Directory.Delete(dirPath);
             }
         }
         catch (Exception)
         {
             if (UninstallFailed != null)
             {
                 UninstallFailed.Invoke(null, new EventArgs());
             }
             return;
         }
         try
         {
             if (File.Exists(UninstallFilePath))
             {
                 File.Delete(UninstallFilePath);
             }
         }
         catch (Exception)
         {
             if (UninstallFailed != null)
             {
                 UninstallFailed.Invoke(null, new EventArgs());
             }
             return;
         }
         if (Uninstalled != null)
         {
             Uninstalled.Invoke(null, new EventArgs());
         }
     }
     else if (UninstallFailed != null)
     {
         UninstallFailed.Invoke(null, new EventArgs());
     }
 }
 internal void OnUninstallFailed()
 {
     Log.Warning($"Server {this.ID:00} Uninstall Failed.");
     UninstallFailed.Invoke(this, null);
 }