Install service optionally but still install file (wix3.11) #7604
-
Hi, I'm working on an installer which has two features. Either/both features require installing the same exe in the same location. I want it such that for one feature it would be installed as a service, the other feature would be installed as just an executable. Regardless of which feature is installed, the file is installed at the same location - I have been trying to create two components (within the same directory - which is probably the problem...):
And then I have two ComponentGroups
and
But because two components have the same file in the same directory I get an error message, something along the lines of:
In my Product I have
I don't necessarily like the idea of two components, but I want to install the service if MainApp is installed (or both MainApp and ServiceApp), and without service if only ServiceApp is installed. Any thoughts about how to go about this? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There are ways, some worse than others, but my recommendation would be to recognize the fact that in Windows service binaries, for several reasons (including security concerns) shouldn't be found in any search paths, while binaries that a use will invoke usually should be. So, I'd place the file in a directory that'll be accessible via a search path for the non-service case, and instead place that exact same file into a different directory (possibly named "service"?) for the service case. |
Beta Was this translation helpful? Give feedback.
There are ways, some worse than others, but my recommendation would be to recognize the fact that in Windows service binaries, for several reasons (including security concerns) shouldn't be found in any search paths, while binaries that a use will invoke usually should be.
So, I'd place the file in a directory that'll be accessible via a search path for the non-service case, and instead place that exact same file into a different directory (possibly named "service"?) for the service case.