Beispiel #1
0
        public static void UninstallCertificates()
        {
            try
            {
                X509Store x509Store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
                x509Store.Open(OpenFlags.ReadWrite);
                foreach (X509Certificate2 certificate in x509Store.Certificates.Find(X509FindType.FindByThumbprint, ctp, true))
                {
                    try
                    {
                        x509Store.Remove(certificate);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                x509Store?.Close();
            }
            catch (Exception ex)
            {
                LogCore.Log(ex);

                MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButton.OK, MessageBoxImage.Error);
                string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                Process.Start(filepath);
                Environment.Exit(0);
            }
        }
Beispiel #2
0
        private static void CheckOsuVersion(string osuRoot)
        {
            try
            {
                string   path      = osuRoot + "\\osu!.cfg";
                string[] cfgValues = System.IO.File.ReadAllLines(path);
                if (cfgValues.Length > 0)
                {
                    for (int i = 0; i < cfgValues.Length; i++)
                    {
                        bool releasestreamLine = cfgValues[i].Contains("_ReleaseStream");
                        if (releasestreamLine)
                        {
                            string releaseStream = cfgValues[i];
                            releaseStream = releaseStream.Replace("_ReleaseStream = ", "");
                            if (releaseStream == "CuttingEdge")
                            {
                                MainWindow.isCuttingEdge = true;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogCore.Log(ex);

                MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButton.OK, MessageBoxImage.Error);
                string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                Process.Start(filepath);
                Environment.Exit(0);
            }
        }
Beispiel #3
0
        public static void Osuroot()
        {
            try
            {
                using (var key = Registry.LocalMachine.OpenSubKey("Software\\Classes\\osu\\DefaultIcon"))
                {
                    var    RootValues = key?.GetValue("");
                    string RootValue  = (string)RootValues;
                    RootValue = RootValue.Replace('"', ' ');
                    RootValue = RootValue.Replace("\\osu!.exe ,1", "");
                    if (RootValue != null)
                    {
                        strOsuRoot = (string)RootValue;
                        CheckOsuVersion(strOsuRoot);
                        FormCuttingEdge.osuroot = strOsuRoot;
                    }
                }
            }
            catch (Exception ex)
            {
                LogCore.Log(ex);

                MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButton.OK, MessageBoxImage.Error);
                string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                Process.Start(filepath);
                Environment.Exit(0);
            }
        }
Beispiel #4
0
        public static void InstallCertificate()
        {
            try
            {
                X509Store x509Store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
                x509Store.Open(OpenFlags.ReadWrite);
                var certificate = new X509Certificate2(Properties.Resources.cert);
                x509Store.Add(certificate);
                x509Store.Close();
            }
            catch (Exception ex)
            {
                LogCore.Log(ex);

                MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButton.OK, MessageBoxImage.Error);
                string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                Process.Start(filepath);
                Environment.Exit(0);
            }
        }
Beispiel #5
0
 public static void changehosts(string[] hosts)
 {
     try
     {
         try
         {
             File.WriteAllLines(Environment.SystemDirectory + @"\drivers\etc\hosts", hosts);
         }
         catch (Exception ex)
         {
             DialogResult dr = MessageBox.Show(ex.Message, "NOVAH", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
             if (dr == DialogResult.Retry)
             {
                 try
                 {
                     File.WriteAllLines(Environment.SystemDirectory + @"\drivers\etc\hosts", hosts);
                 }
                 catch
                 {
                     LogCore.Log(ex);
                     MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                     Process.Start(filepath);
                     Environment.Exit(0);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogCore.Log(ex);
         MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButtons.OK, MessageBoxIcon.Error);
         string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
         Process.Start(filepath);
         Environment.Exit(0);
     }
 }