Click here to Skip to main content
14,690,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create a wix installer for window service. My service consists four class library projects. My questions is how can i add multiple class library projects in wix installer.

I followed this link
https://github.com/Robs79/How-to-create-a-Windows-Service-MSI-Installer-Using-WiX/blob/master/WindowsService.Installer/Product.wxs
its not shows how to add multiple class library projects. Please some one help me out how can do this. or provide some reference link where i can refer.

Thanks in Advance


What I have tried:

Product.wxs:

<?define Name = "ESS_VillageMateIntegrtion" ?>
<?define Manufacturer = "IRIZ ID TECH" ?>
<?define VersionNumber = "1.0.0.0" ?>
<?define UpgradeCode = "{FF9D7B21-A4FE-4DEB-A2FE-E77228F95831}" ?>


<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
           UpgradeCode="$(var.UpgradeCode)"
           Version="$(var.VersionNumber)"
           Language="1033"
           Name="$(var.Name)"
           Manufacturer="$(var.Manufacturer)">

    <Package InstallerVersion="300" Compressed="yes" InstallScope="perMachine" />
    <Media Id="1" Cabinet="ESS_VillageMateIntegrtion" EmbedCab="yes"></Media>

    <!-- Allow upgrades and prevent downgrades -->
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />
  </Product>

  <Fragment>
    <!-- Define the directory structure -->

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)">
          <Directory Id="APPLICATIONROOTDIRECTORY" Name="$(var.Name)" />
        </Directory>
      </Directory>
    </Directory>
  </Fragment>



  <!-- Add files to your installer package -->
  <Fragment>
    <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
      <Component Id="$(var.ESS_VillageMateIntegrtion.TargetFileName)" Guid="{F03996CC-3A49-47A7-91F1-27DBF563AE83}">
        <File Id="$(var.ESS_VillageMateIntegrtion.TargetFileName)" Source="$(var.ESS_VillageMateIntegrtion.TargetPath)" KeyPath="yes" />
      </Component>

      <Component Id="$(var.ESS_VillageMateIntegrtionServiceConfig.TargetFileName)" Guid="{CC064C9B-298A-4D6D-AF64-40DA3657AAAB}">
        <File Id="$(var.ESS_VillageMateIntegrtionServiceConfig.TargetFileName)" Source="$(var.ESS_VillageMateIntegrtionServiceConfig.TargetPath)" KeyPath="yes" />
      </Component>

      <Component Id="$(var.ESS_VillageMateService.TargetFileName)" Guid="{CB37D43D-BB08-4DF2-A7B0-87A819A66CED}">
        <File Id="$(var.ESS_VillageMateService.TargetFileName)" Source="$(var.ESS_VillageMateService.TargetPath)" KeyPath="yes" />
      </Component>

      <Component Id="$(var.ESS_VillageMateIntegrationTray.TargetFileName)" Guid="{71FD65C9-A657-4093-8D5A-28743972E536}">
        <File Id="$(var.ESS_VillageMateIntegrationTray.TargetFileName)" Source="$(var.ESS_VillageMateIntegrationTray.TargetPath)" KeyPath="yes" />
      </Component>

      <Component Id="Components">
        <!-- Remove the log file on uninstall -->
        <RemoveFile Id="log" Name="*.txt" On="both" />

        <!-- Tell WiX to install the Service -->
        <ServiceInstall Id="ServiceInstaller"
                        Type="ownProcess"
                        Vital="yes"
                        Name="ESS_VillageMateIntegrtion"
                        DisplayName="ESS_VillageMateIntegrtion Service"
                        Description="Write Data one DB to another DB"
                        Start="auto"
                        Account="LocalSystem"
                        ErrorControl="normal" />

        <!-- Tell WiX to start the Service -->
        <ServiceControl Id="StartService"
                        Start="install"
                        Stop="both"
                        Remove="uninstall"
                        Name="ESS_VillageMateIntegrtion"
                        Wait="yes" />
      </Component>
    </DirectoryRef>
  </Fragment>

</Wix>
Posted
Updated 14-Jun-19 1:16am

1 solution

I am not sure if i understood your question completely.

When you publish your service, it will output dlls of your class library project in a publish folder. Then you would need to run 'heat' command that will output a wix file referencing the files/dlls of publish folder to be included in the installer. After this step, you would need to build your wix project to get the installer. For more info on heat command refer to following link

Harvest Tool (Heat)[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900