Пример #1
0
        static void Main(String[] args)
        {
            foreach (String s in args)
            {
                if (s.ToLowerInvariant() == "/dbg" || s.ToLowerInvariant() == "/debugwindow")
                {
                    DebugMode = true;
                    AllocConsole();
                    break;
                }
            }
            if (!File.Exists(String.Format("{0}\\OmniMIDI\\bass.dll", Environment.GetFolderPath(Environment.SpecialFolder.SystemX86))) ||
                !File.Exists(String.Format("{0}\\OmniMIDI\\bassmidi.dll", Environment.GetFolderPath(Environment.SpecialFolder.SystemX86))))
            {
                DebugToConsole(false, "Can not find BASS libraries, trying to sideload them from the local directory...", null);
                if (!File.Exists(String.Format("bass.dll")) ||
                    !File.Exists(String.Format("bassmidi.dll")))
                {
                    MissingBASSLibs MissingBASSLib = new MissingBASSLibs("The system was unable to find the required BASS libraries");
                    MissingBASSLib.Source = "BASS libraries not found";
                    DebugToConsole(true, "Can not find BASS libraries", MissingBASSLib);
                    MessageBox.Show("Can not find the required BASS libraries for the configurator to work.\nEnsure that BASS.DLL and BASSMIDI.DLL are present in the configurator's root folder.\nIf they're not, please reinstall the synthesizer.\n\nClick OK to close the configurator.", "OmniMIDI ~ Configurator - Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }
            }

            UpdateToOmniMIDI();

            DoAnyway(args);
        }
Пример #2
0
 static void Main(String[] args)
 {
     foreach (String s in args)
     {
         if (s.ToLowerInvariant() == "/dbg" || s.ToLowerInvariant() == "/debugwindow")
         {
             DebugMode = true;
             AllocConsole();
             break;
         }
     }
     if (!File.Exists(String.Format("{0}\\keppysynth\\bass.dll", Environment.GetFolderPath(Environment.SpecialFolder.SystemX86))) ||
         !File.Exists(String.Format("{0}\\keppysynth\\bassmidi.dll", Environment.GetFolderPath(Environment.SpecialFolder.SystemX86))))
     {
         DebugToConsole(false, "Can not find BASS libraries, trying to sideload them from the local directory...", null);
         if (!File.Exists(String.Format("bass.dll")) ||
             !File.Exists(String.Format("bassmidi.dll")))
         {
             MissingBASSLibs MissingBASSLib = new MissingBASSLibs("The system was unable to find the required BASS libraries");
             MissingBASSLib.Source = "BASS libraries not found";
             DebugToConsole(true, "Can not find BASS libraries", MissingBASSLib);
             MessageBox.Show("Can not find the required BASS libraries for the configurator to work.\nEnsure that BASS.DLL and BASSMIDI.DLL are present in the configurator's root folder.\nIf they're not, please reinstall the synthesizer.\n\nClick OK to close the configurator.", "Keppy's Synthesizer ~ Configurator - Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             return;
         }
     }
     try
     {
         RegistryKey rkCurrentUser = Registry.CurrentUser;
         CopyKey(rkCurrentUser, "SOFTWARE\\Keppy's Driver", "SOFTWARE\\Keppy's Synthesizer");
         Directory.Move(System.Environment.GetEnvironmentVariable("USERPROFILE").ToString() + "\\Keppy's Driver\\", System.Environment.GetEnvironmentVariable("USERPROFILE").ToString() + "\\Keppy's Synthesizer\\");
         Directory.Delete(System.Environment.GetEnvironmentVariable("USERPROFILE").ToString() + "\\Keppy's Driver\\");
     }
     catch
     {
         RegistryKey sourceKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's Driver", true);
         if (sourceKey != null)
         {
             RegistryKey deleteme = Registry.CurrentUser.OpenSubKey("SOFTWARE", true);
             deleteme.DeleteSubKeyTree("Keppy's Driver");
             deleteme.Close();
             sourceKey.Close();
         }
     }
     finally
     {
         DoAnyway(args);
     }
 }