Repository: Kyome22/RunCat_for_windows
File: RunCat365/Program.cs (C#)

Code before:
            var value = rKey.GetValue("SystemUsesLightTheme");
            rKey.Close();
            if (value is null) return Theme.Light;
            return (int)value == 0 ? Theme.Dark : Theme.Light;
        }

        private static async Task<bool> GetStartupAsync() {
            if (IsRunningAsPackaged()) {
                if (startupTask is null) startupTask = await StartupTask.GetAsync("RunCatStartup");
                if (startupTask is null) return false;
                if (startupTask.State == StartupTaskState.Enabled) return true;
                return false;
            } else {
                var keyName = @"Software\Microsoft\Windows\CurrentVersion\Run";
                using var rKey = Registry.CurrentUser.OpenSubKey(keyName);
                if (rKey is null) return false;
                var value = (rKey.GetValue(Application.ProductName) is not null);
                rKey.Close();
                return value;
            }
        }

        private static async Task<bool> SetStartupAsync(bool isChecked) {
            if (IsRunningAsPackaged()) {
                bool active = !isChecked;
                bool changeCheck = false;
                if (startupTask is null) startupTask = await StartupTask.GetAsync("RunCatStartup");
                if (active) {
                    switch (startupTask.State) {
                        case StartupTaskState.Enabled:
                            changeCheck = true;
                            break;
                        case StartupTaskState.Disabled:
                            StartupTaskState newState = await startupTask.RequestEnableAsync();
                            if (newState == StartupTaskState.Enabled) {
                                changeCheck = true;
                            } else {
                                MessageBox.Show("Launch at Startup could not be activated.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                changeCheck = false;
                            }
                            break;
                        case StartupTaskState.DisabledByUser:
                            MessageBox.Show("Launch at startup was disabled by the user, enable it in Task Manager > Startup, search RunCat365 and enable it.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            changeCheck = false;
                            break;
                        case StartupTaskState.DisabledByPolicy:
                            MessageBox.Show("Launch at startup was disabled by policy.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            changeCheck = false;
                            break;
                    }
                } else if (!active) {

Review comment (suggestion):
```suggestion
                var active = !isChecked;
                var changeCheck = false;
```

Code after:
            var value = rKey.GetValue("SystemUsesLightTheme");
            rKey.Close();
            if (value is null) return Theme.Light;
            return (int)value == 0 ? Theme.Dark : Theme.Light;
        }

        private void ShowBalloonTip()
        {
            if (UserSettings.Default.FirstLaunch)
            {
                contextMenuManager.ShowBalloonTip();
                UserSettings.Default.FirstLaunch = false;
                UserSettings.Default.Save();
            }
        }

        private void UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            if (e.Category == UserPreferenceCategory.General)
            {
                var systemTheme = GetSystemTheme();
                contextMenuManager.SetIcons(systemTheme, manualTheme, runner);
            }
        }

        private static void OpenRepository()
        {
            try
            {
                Process.Start(new ProcessStartInfo()
                {
                    FileName = "https://github.com/Kyome22/RunCat365.git",
                    UseShellExecute = true
                });
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error: {e.Message}");
            }
        }

        private void Exit()
        {
            cpuRepository.Close();
            animateTimer.Stop();
            fetchTimer.Stop();
            contextMenuManager.HideNotifyIcon();
            Application.Exit();
        }

        private void OnApplicationExit(object? sender, EventArgs e)