In Windows Install XML toolset, to install a service, we group <ServiceInstall> with a <File> in a <Component>. To conditionally install the service, we put <Condition> under the <Component>. However if the condition is false, the file will not be installed too. If I put the <File> in an unconditional <Component>, then the service has no executable file path and thus installation will fail. If I put the <File> in both <Component>, duplicate symbols will be found.
The question is, can we install a service conditionally, but install the associated executable file unconditionally?
Thanks!
Create two components with the different GUIDs’ and Ids’ and mutually exclusive conditions: one for the file and service, and another for file only. Something like this:
You will get a LGHT1076 warning which could be suppressed since the conditions in the components are mutually exclusive.