We are using SharpSetup for creating our installer. We have some custom logic there (custom dialogs etc.) followed by the actual Wix installer, which among other things installs a service. To install the service we use the ServiceInstall tag.
We now want to allow selection of the user which will run the service. We have all of our installation flow in place, but we're stuck with altering the ServiceInstall configuration: our XML file does not list a user or password, and we can't figure out how to use our user/password pair to override what's written in the XML file.
I was thinking of using environment variables (which are apparently supported in Wix), but my understanding is that they are evaluated too early (i.e. when the installer launches which is before I let the end-user configure the service account). In addition, environment variables seem pretty unsecure to use for storing passwords.
I started exploring the content of the MsiConnection.Instance object that's available to me, and I fount what appears to be the service "Component", but it did not seem as if I could configure it.
I could always resort to manually installing the service using my own code, but I was hoping to leverage the Wix/MSI capabilities for this.
Can the ServiceInstall configuration be programmatically overridden?