nutdotnet / WinNUT-Client

WinForms-based client for monitoring your Uninterruptible Power Supply (UPS) connected to a Network UPS Tools (NUT) server.
GNU General Public License v3.0
209 stars 19 forks source link

Transfer settings from Windows Registry to .NET Application Settings #100

Closed gbakeman closed 8 months ago

gbakeman commented 1 year ago

WinNUT preferences are stored in the User Registry hive. This is a self-rolled solution that requires the user to venture into their Registry when required to access the preferences manually or clear them out. To take advantage of the more easily manageable and integrated system, we can use the .Net Application Settings system. This will be a multi-part project:

Registry/Preferences migration dialog

WinNUT will have added a new dialog (structured with new-to-WinNUT DataBinding, BackgroundWorker and MVC/MVP design patterns) that will assist the user with migrating to the standard .Net Application Settings system. References to the old system of registry preferences will be removed throughout WinNUT except as to assist the migration dialog. The migration dialog will support operations of importing, backing up (to .REG file) and deleting the old preference Registry keys. If the user opts to cancel or do nothing, then the old Registry keys will be left alone and a fresh copy of settings will be used instead. This dialog will only be displayed once as long as the new settings remain intact.

Please provide any feedback about this below.

DUN-Cosmos commented 11 months ago

It would be nice to add a backup & restore feature for the setting.

gbakeman commented 11 months ago

It would be nice to add a backup & restore feature for the setting.

Thank you for the comment. I'm definitely planning on an import and full backup system (which will likely create an importable .reg file), but I'm not so sure about a restore feature. I want this to be a one-and-done situation, so going forward WinNUT will rely on the new Settings system exclusively and the old Registry system will no longer exist in WinNUT. What do you think about this?

Edit; I also added more information about what I'm thinking in the original post if you wouldn't mind looking at that.

DUN-Cosmos commented 11 months ago

For the old Registry system, as you say a exported .reg file will be plainly sufficient.

I don't know how the .NET Application Settings work so I can't tall is this need a restore feature.

gbakeman commented 8 months ago

For anyone monitoring this: please give the latest build a try. I believe all major work on this feature is completed. I've tested the import, backup and deletion features a few times on my own machine, but I'd like to hear from at least one other person confirming success. If I don't hear from anyone in a week or so, I think I'll go ahead and push out a pre-release.

gbakeman commented 8 months ago

Going ahead and deploying.