예제 #1
0
        private void yes_Click(object sender, RoutedEventArgs e)
        {
            if (Process.GetProcessesByName("QboxClient").Length > 0)
            {
                Window4 exitQboxWindow = new Window4();
                exitQboxWindow.Show();
                this.Close();

                /*
                 * foreach (Process proc in Process.GetProcessesByName("QboxClient"))
                 * {
                 *  proc.Kill();
                 * }
                 */
            }
            else
            {
                globals.QboxAppState = false;
                processes p = new processes();
                p.run();
                this.Close();
            }

            /*
             * Process p = new Process();
             * p.StartInfo.FileName = "rundll32.exe"; //uninstall executable with the uninstall string
             * p.StartInfo.Arguments = "dfshim.dll,ShArpMaintain QBoxClient.application, Culture=en, PublicKeyToken=c7c5fb3875c039a3, processorArchitecture=x86";
             * p.Start(); //Run windows uninstall
             * p.WaitForExit();
             * if (System.IO.File.Exists(@"C:\Users\Chaitanya\Desktop\Qbox Client.appref-ms"))
             * {
             *  MessageBox.Show("Please close all files using Qbox to uninstall and try again"); //if the uninstall fails, resets to the main window
             *  Application.Current.MainWindow.Show();
             *  this.Close();
             *  return;
             * }
             * string[] s = System.IO.Directory.GetDirectories(@"C:\Users\", "*"); //Delete the system data files
             * foreach (string str in s)
             * {
             *  string test = str + @"\AppData\Local\CoralTree"; //adds the rest of the path to the user found via wildcard
             *  if (System.IO.Directory.Exists(@test))
             *  {
             *      try
             *      {
             *          System.IO.Directory.Delete(@test, true);
             *      }
             *
             *      catch (System.IO.IOException a)
             *      {
             *          Console.WriteLine(a.Message);
             *      }
             *  }
             * }
             *
             * Window3 openWindow = new Window3();
             * openWindow.Show();
             * this.Close();
             */
        }
예제 #2
0
        private void yes_Click(object sender, RoutedEventArgs e)
        {
            /*
             * Process p = new Process();
             * p.StartInfo.FileName = "rundll32.exe"; //Run the uninstall executable with the uninstall string
             * p.StartInfo.Arguments = "dfshim.dll,ShArpMaintain QBoxClient.application, Culture=en, PublicKeyToken=c7c5fb3875c039a3, processorArchitecture=x86";
             * p.Start();
             * p.WaitForExit();
             */
            if (Process.GetProcessesByName("QboxClient").Length > 0)
            {
                /*
                 * Process[] proc = Process.GetProcessesByName("QboxClient");
                 * proc[0].WaitForExit();
                 * MessageBox.Show("Please Exit Qbox before uninstalling.");
                 */
                Window4 exitQboxWindow = new Window4();
                exitQboxWindow.Show();
                this.Close();
            }
            else
            {
                globals.QboxAppState = false;
                processes p = new processes();
                p.run();
                this.Close();
            }

            /*
             * if (Process.GetProcessesByName("QboxClient").Length > 0)
             * {
             *  MessageBox.Show("Qbox is still running");
             * }
             */
            /*
             * processes p = new processes();
             * p.run();
             *
             * Process p = new Process();
             * p.StartInfo.FileName = "rundll32.exe"; //uninstall executable with the uninstall string
             * p.StartInfo.Arguments = "dfshim.dll,ShArpMaintain QBoxClient.application, Culture=en, PublicKeyToken=c7c5fb3875c039a3, processorArchitecture=x86";
             * p.Start(); //Run windows uninstall
             * p.WaitForExit();
             */
            /*
             * if (System.IO.File.Exists(@"C:\Users\"+ globals.user + @"\Desktop\Qbox Client.appref-ms"))
             * {
             *  MessageBox.Show("Please close all files using Qbox to uninstall and try again"); //if the uninstall did not work, it resets to the main window
             *  //Application.Current.MainWindow.Show();
             *  Application.Current.Shutdown();
             * }
             */
        }