Configuring a Rust-based Windows service [asking for informed opinions, please]

Hi, I'm writing a Windows Service (that is, an app that runs on bootup), and, in particular, am working on the part that should configure it.

I don't have any existing interfaces that I need to comply with (it's more-or-less greenfield) other than needing to accept incoming connections on port 443, and again, needing to run at bootup.

I've already got the installer and stuff set up, so I just have one question:

Should I mess with getting it to configure with the Windows Registry, or just use a config file? And, relatedly, should I attempt to use serde with the Windows Registry? Does a serde backend for the registry exist? Or would it make sense to write one?

the winreg crate seems to provide serde support for storing data in the windows registry and has an example in its readme:

https://crates.io/crates/winreg

Maybe relevant: Microsoft discourages storing values larger than 2KiB in the registry:

1 Like

For config avoid the registry. A config file is easier to edit, share, version and whatnot. That said, you should prefer the registry if your users are typical Windows IT admins because those guys are likely to expect it that way.

1 Like