Hello Nigel,
Indeed, a solution would be the one you presented - to rename the original file so it is not overwritten and on uninstall to rename it back.
Another solution would be to copy the original file into a different location and then copy it back on uninstall, after the files were removed.
Best regards,
Catalin