I have been working on a project where I need to install a Java service running as a spring boot application from a Wix installer for Windows. It should autodetect if there is already a JRE instance installed globally on the system, and if so, use it, otherwise, install a private JRE for this application. After looking for complete solutions, and working through many different problems, I have come up with a configuration that works. It manually installs the service via Wix and sets all the registry keys that the procrun program needs instead of using procrun to install the service.
I am new to the site (as a submitter), but I will post the Wix XML that I created as an answer. It isn't perfectly polished, but hopefully will help others get through the hurdles that I had to jump through to make this work.