General answer: in order to install / uninstall Windows service by MSI package made with WiX, you should only leverage ServiceInstall and ServiceControl elements, as Christopher mentioned to you in this thread.
Now, answering your specific questions:
- The error message is quite descriptive - you have more than one element marked as
KeyPath='yes'
in a single component. There can only be one key path. You can find more information here (see the section describingKeyPath
column of the Component table). - I think you can safely move the
usermodule.exe
into a separate component. If you say that stopping the service drops that process, and we know that service operations on uninstall happen before the file removal, then it sounds safe to just let Windows Installer do its job uninstalling the components. - As mentioned in the previous point, I don't think so.
Hope this helps.