Benjamin
Benjamin

Reputation: 3826

Wix installer- All the sources and contents are not being copied

I have a very simple Wix Project and I have added a reference of my c# project to that. In wix project references I have set the Project Output Groups = All ,and Harvest = True

In My Products.wxs I have the following code:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="44a12fea-ec26-4237-84e1-6aefb4483c73">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate  EmbedCab="yes"/>

    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
         <Component Id="ProductComponent">
  <File Source="$(var.MyProject.TargetPath)" />
        </Component> 
    </ComponentGroup>
</Fragment>
</Wix>

The Problem is when I install the msi Installer only one dll gets install to the machine, however I am expecting to see all the project contents (such as Folders,C# classes, and dlls) in the installation folder not only a single dll files.

Upvotes: 1

Views: 1855

Answers (1)

AIVoid
AIVoid

Reputation: 97

Since WIX 3.6 HarvestProject target (Project Output Groups and Harvest flags in Votive are responsible for this) are disable by default, because it's partially broken. So you can try to enable it via adding the following to WIX project file:

<PropertyGroup>
<EnableProjectHarvesting>True</EnableProjectHarvesting>
</PropertyGroup>

Or (personally I prefer this way) you can use HarvestDirectory target - it will collect all files and folders recursively in given directory and include in installer. You can even filter collected files/folders via XSD transformations. For example and detailed explanation on how to do it - refer to my answer to this question

Upvotes: 2

Related Questions