I need to install my windows service, and have at least one instance of it. The user decides how many services they will have. But which approach will I take?
- Try to make my ServiceInstall foreach the number of windows services or install them with an customization via installutil?
and then I have to solve so it does not install duplicates. But I can make an xml file that contains the service names to be installed, and read from there.
But I have read that people don’t like using foreach in wix because it complicates stuff much more, and some people say installutil isn’t good either. But since I don’t know how many services it will be I have to solve it something like this.
And with installutil i won’t get rollback either?
Does anyone know another approach?
You can run custom action which patches your MSI including service elements to install. This approach allows you to read service names from wherever you want and install as many services as you need.
Though it would be quite non-trivial for those who read your installer source code later. And to be honest I’ve never used this approach. But it should work…