If you do the upgrade first then a key is made and stored for that system... you can then do a fresh install using the Microsoft tool and that should detect the new key without issue but to be clear, you must finish a upgrade first to have this option.
p.s. the Microsoft tool is here Link Removed