Settings retained on upgrade (Windows installer)

I'd like it if my settings were retained during an upgrade. I currently have to change the max memory usage, port and path as well as resetting the username for the service (it reverts to Local System). These things should be retained during the upgrade.