When uninstalling (on Windows at least), you don't need to worry about this, Blender will ask you if you want to keep or remove your config files etc, simply choose the former and after reinstalling, your settings will still be there.
Additionally, if you uninstall and the version you are installing is different from the last, press Copy Previous Settings and it will apply your stored config to your fresh install after which you can save as your new default with CtrlU.