1

I use wix 3.5 for install project. I have a file which can be installed as service or as file. I try to make it like this:

<Component Id="MyProgrammAsService" Guid="*">
    <File Id="MyFile" Name="File.exe" DiskId="1" Source="$(var.SourceDir)\MyFile.exe" />
    <ServiceInstall ...
      </ServiceInstall>                        
      </RegistryKey>
  </Component>
<Component Id="MyProgrammWithoutService" Guid="*">
   <File Id="MyFile" Name="File.exe" DiskId="1" Source="$(var.SourceDir)\MyFile.exe" />
</Component>

But error was throw Duplicate symbol 'File:AdminToolsConsoleFile' found. How can I bypass this problem?

UPD: Feature code:

  <Feature>
       <ComponentRef Id="SyncWithoutService" />
       <Feature Id="MyProgrammAsServiceFeature" Level="100" 
                Description="Install as service" 
                Title="Register as service" AllowAdvertise="no">
                <ComponentRef Id="MyProgrammAsService" />
       </Feature>
       <ComponentGroupRef Id="MyGroup"  />
  </Feature>
3
  • 2
    Just call your file in the MyProgrammAsService component Id="MyFileForService" or something. The issue is it is trying to make two entries in the Files table with the same primary key name which you can't do. Aug 18, 2017 at 15:50
  • @BrianSutherland I try this and get this error Installation of a conditionalized component would cause the target file 'ksj7lq1r.exe' to be installed in '[ProgramFilesFolder]\Project\' by two different components on an LFN system: 'MyProgrammAsService' and 'MyProgrammWithoutService'. This would break component reference counting. Aug 21, 2017 at 2:34
  • Unless your requirements prevent you from doing so, you could simply install File.exe to a different folder when installing it without the service.
    – philselmer
    Aug 22, 2017 at 14:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.