static void WindowsChecks()
        {
            if (Platform.RunningOS != OS.Windows)
            {
                return;
            }
            object legacyWMPCheck = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}", "IsInstalled", null);

            if (legacyWMPCheck == null || legacyWMPCheck.ToString() != "1")
            {
                introForceDisable = true;
                var msg = new StreamReader(typeof(Program).Assembly.GetManifestResourceStream("Launcher.WMPMessage.txt")).ReadToEnd();
                CrashWindow.Run("Librelancer", "Missing Components", msg);
            }
        }
Esempio n. 2
0
        static GameConfig Configure()
        {
            Window win    = null;
            var    config = LibreLancer.GameConfig.Create();


            if (Environment.OSVersion.Platform != PlatformID.MacOSX &&
                Environment.OSVersion.Platform != PlatformID.Unix)
            {
                string bindir   = Path.GetDirectoryName(typeof(GameConfig).Assembly.Location);
                var    fullpath = Path.Combine(bindir, IntPtr.Size == 8 ? "x64" : "x86");
                SetDllDirectory(fullpath);

                //Check WMP for video playback
                object legacyWMPCheck = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}", "IsInstalled", null);
                if (legacyWMPCheck == null || legacyWMPCheck.ToString() != "1")
                {
                    win = new CrashWindow(
                        "Uh oh!",
                        "Missing Components",
                        new StreamReader(typeof(Program).Assembly.GetManifestResourceStream("Launcher.WMPMessage.txt")).ReadToEnd(),
                        true);
                    win.Show();
                    while (win.Visible)
                    {
                        Application.MainLoop.DispatchPendingEvents();
                    }
                    win = ShowLauncher(config);
                }
                else
                {
                    win = ShowLauncher(config);
                }
            }
            else
            {
                config.ForceAngle = false;
                win = ShowLauncher(config);
            }

            while (win.Visible)
            {
                Application.MainLoop.DispatchPendingEvents();
            }

            config.Save();
            return(config);
        }