Пример #1
0
        //Enables Classic Theme and if specified Classic Taskbar.
        public static void MasterEnable(bool taskbar)
        {
            Process.Start("C:\\SCT\\EnableThemeScript.bat", "pre").WaitForExit();
            Registry.CurrentUser.OpenSubKey("SOFTWARE", true).CreateSubKey("SimpleClassicTheme");
            Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\1337SimpleClassicTheme", "Enabled", true.ToString());
            //SCTT
            if ((string)Configuration.GetItem("TaskbarType", "SiB+OS") == "SCTT")
            {
#if DEBUG
#else
                if (Assembly.GetExecutingAssembly().Location != "C:\\SCT\\SCT.exe")
                {
                    MessageBox.Show("This action requires SCT to be installed and SCT to be ran from the Start Menu");
                }
                else
#endif
                {
                    ClassicTaskbar.EnableSCTT();
                    Enable();
                }
            }
            //Windows 8.1
            else if (Environment.OSVersion.Version.Major != 10)
            {
                //Enable the theme
                Enable();

                //Make explorer apply theme
                Process.Start("cmd", "/c taskkill /im explorer.exe /f").WaitForExit();
                Process.Start("explorer.exe", @"C:\Windows\explorer.exe");
                Thread.Sleep((int)Registry.CurrentUser.OpenSubKey("SOFTWARE", true).CreateSubKey("1337ftw").CreateSubKey("SimpleClassicTheme").GetValue("TaskbarDelay", 5000));

                ClassicTaskbar.FixWin8_1();
            }
            //Windows 10 with taskbar
            else if (taskbar)
            {
                ClassicTaskbar.Enable();
                Enable();
            }
            //Just enable
            else
            {
                Enable();
            }
            Process.Start("C:\\SCT\\EnableThemeScript.bat", "post").WaitForExit();
        }
Пример #2
0
        //Enables Classic Theme and if specified Classic Taskbar.
        public static void MasterEnable(bool taskbar, bool commandLineError = false)
        {
            Process.Start($"{Configuration.InstallPath}EnableThemeScript.bat", "pre").WaitForExit();
            Configuration.Enabled = true;
            if (!taskbar)
            {
                // No taskbar
                if (ExplorerPatcher.Enabled)
                {
                    ExplorerPatcher.ApplyConfiguration(true);
                }
                Enable();
            }
            else if (!File.Exists($"{Configuration.InstallPath}SCT.exe"))
            {
                if (!commandLineError)
                {
                    MessageBox.Show("You need to install Simple Classic Theme in order to enable it with Classic Taskbar enabled. Either disable Classic Taskbar from the options menu, or install SCT by pressing 'Run SCT on boot' in the main menu.", "Unsupported action");
                }
                else
                {
                    Console.WriteLine($"Enabling SCT with a taskbar requires SCT to be installed to \"{Configuration.InstallPath}SCT.exe\".");
                }
                Configuration.Enabled = false;
                return;
            }
            else if (Configuration.TaskbarType == TaskbarType.StartIsBackOpenShell)
            {
                if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 3)
                {
                    // StartIsBack+ and Open-Shell
                    // Unsupported for now
                    if (!commandLineError)
                    {
                        MessageBox.Show("StartIsBack+ is still unsupported. Please select another taskbar method through the options menu or with the --set commandline option.", "Unsupported action");
                    }
                    else
                    {
                        Console.WriteLine("StartIsBack+ is still unsupported. Please select another taskbar method.");
                    }
                    Configuration.Enabled = false;
                }
                else if (Environment.OSVersion.Version.Major == 10 && Environment.OSVersion.Version.Build < 22000)
                {
                    // StartIsBack++ and Open-Shell
                    if (ExplorerPatcher.Enabled)
                    {
                        ExplorerPatcher.ApplyConfiguration();
                    }
                    ClassicTaskbar.Enable();
                    Thread.Sleep(Configuration.TaskbarDelay);
                    Enable();
                }
                else if (Environment.OSVersion.Version.Major == 10 && Environment.OSVersion.Version.Build >= 22000)
                {
                    // StartAllBack and Open-Shell
                    // Unsupported for now
                    if (!commandLineError)
                    {
                        MessageBox.Show("StartAllBack is still unsupported. Please select another taskbar method through the options menu or with the --set commandline option.", "Unsupported action");
                    }
                    else
                    {
                        Console.WriteLine("StartAllBack is still unsupported. Please select another taskbar method.");
                    }
                    Configuration.Enabled = false;
                }
                else
                {
                    // Unsupported operating system
                    if (!commandLineError)
                    {
                        MessageBox.Show("There's no version of StartIsBack for your version of Windows. Please select another taskbar method through the options menu or with the --set commandline option.", "Unsupported action");
                    }
                    else
                    {
                        Console.WriteLine("There's no version of StartIsBack for your version of Windows. Please select another taskbar method.");
                    }
                    Configuration.Enabled = false;
                }
            }
            else if (Configuration.TaskbarType == TaskbarType.SimpleClassicThemeTaskbar)
            {
                // Simple Classic Theme Taskbar
                Enable();
                if (ExplorerPatcher.Enabled)
                {
                    ExplorerPatcher.ApplyConfiguration();
                }
                Process.Start("cmd", "/c taskkill /im explorer.exe /f").WaitForExit();
                Process.Start("explorer.exe", @"C:\Windows\explorer.exe");
                ClassicTaskbar.EnableSCTT();
            }
            else if (Configuration.TaskbarType == TaskbarType.Windows81Vanilla)
            {
                // Windows 8.1 Vanilla taskbar with post-load patches
                Enable();

                if (ExplorerPatcher.Enabled)
                {
                    ExplorerPatcher.ApplyConfiguration();
                }
                Process.Start("cmd", "/c taskkill /im explorer.exe /f").WaitForExit();
                Process.Start("explorer.exe", @"C:\Windows\explorer.exe");
                Thread.Sleep(Configuration.TaskbarDelay);
                ClassicTaskbar.FixWin8_1();
            }
            else if (Configuration.TaskbarType == TaskbarType.RetroBar)
            {
                // RetroBar
                Enable();
                if (ExplorerPatcher.Enabled)
                {
                    ExplorerPatcher.ApplyConfiguration();
                }
                Process.Start("cmd", "/c taskkill /im explorer.exe /f").WaitForExit();
                Process.Start("explorer.exe", @"C:\Windows\explorer.exe");
                Process.Start($"{Configuration.InstallPath}RetroBar\\RetroBar.exe");
            }
            else if (Configuration.TaskbarType == TaskbarType.ExplorerPatcher)
            {
                // Windows 11 Vanilla taskbar with ExplorerPatcher
                Enable();
                if (ExplorerPatcher.Enabled)
                {
                    ExplorerPatcher.ApplyConfiguration(true);
                }
            }
            Process.Start($"{Configuration.InstallPath}EnableThemeScript.bat", "post").WaitForExit();
        }