mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 22:35:11 +00:00
Fixed an UnauthorizedAccessException when modifying the auto-startup registry entry.
This commit is contained in:
@@ -198,7 +198,13 @@ namespace OpenHardwareMonitor.GUI {
|
||||
|
||||
autoStart = new UserOption(null, startupManager.Startup, startupMenuItem, settings);
|
||||
autoStart.Changed += delegate(object sender, EventArgs e) {
|
||||
startupManager.Startup = autoStart.Value;
|
||||
try {
|
||||
startupManager.Startup = autoStart.Value;
|
||||
} catch (InvalidOperationException) {
|
||||
MessageBox.Show("Updating the auto-startup option failed.", "Error",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
autoStart.Value = startupManager.Startup;
|
||||
}
|
||||
};
|
||||
|
||||
readHddSensors = new UserOption("hddMenuItem", true, hddMenuItem, settings);
|
||||
|
Reference in New Issue
Block a user