# HG changeset patch # User Brad Greco # Date 1592069300 14400 # Node ID c4fc74593a78e7cfdd38d5a524a49c3421f19489 # Parent 7645122aa7a914867046cfa2250bebf968634cca Mono fix diff -r 7645122aa7a9 -r c4fc74593a78 ServerMonitor/Forms/SettingsForm.cs --- a/ServerMonitor/Forms/SettingsForm.cs Tue Jun 09 20:59:00 2020 -0400 +++ b/ServerMonitor/Forms/SettingsForm.cs Sat Jun 13 13:28:20 2020 -0400 @@ -48,6 +48,8 @@ ErrorSoundComboBox.SelectedIndex = getSoundSettingIndex(ErrorSoundComboBox); WarningSoundComboBox.SelectedIndex = getSoundSettingIndex(WarningSoundComboBox); InformationSoundComboBox.SelectedIndex = getSoundSettingIndex(InformationSoundComboBox); + + AutorunCheckBox.Enabled = !Helpers.IsMono(); } /// Gets whether an autorun registry key for this program exists. @@ -55,6 +57,10 @@ private bool GetAutorun() { RegistryKey key = Registry.CurrentUser.OpenSubKey(autorunKey, false); + if (key == null) + { + return false; + } string value = (string)key.GetValue(autorunName, string.Empty); return value.StartsWith(Application.ExecutablePath); } @@ -63,6 +69,11 @@ /// Whether autorun should be enabled or disabled. private void SetAutorun(bool autorun) { + if (Helpers.IsMono()) + { + return; + } + RegistryKey key = Registry.CurrentUser.OpenSubKey(autorunKey, true); if (autorun) key.SetValue(autorunName, Application.ExecutablePath.ToString());