-
This is a simple project for VS2022. Source code WixSimpleHarvestError.zip. I tried a lot of things, but it's just not working. On building, it's generating this error
File Installer.wixproj <Project Sdk="WixToolset.Sdk/4.0.2">
<ItemGroup>
<PackageReference Include="WixToolset.Heat" Version="4.0.2" />
</ItemGroup>
<PropertyGroup>
<EnableProjectHarvesting>true</EnableProjectHarvesting>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\WinFormsApp1\WinFormsApp1.csproj" />
</ItemGroup>
</Project> File Package.wxs <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Installer" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="01a52e1f-62e1-4d03-847e-1fbfa73722c7">
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed.)" />
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.Manufacturer) !(bind.Property.ProductName)" />
</StandardDirectory>
<Feature Id="Main">
<ComponentGroupRef Id="WinFormsApp1.Binaries" />
</Feature>
</Package>
</Wix> I tried the variant mention in the documentation but I'm getting the same result. <Project Sdk="WixToolset.Sdk/4.0.2">
<ItemGroup>
<PackageReference Include="WixToolset.Heat" Version="4.0.2" />
</ItemGroup>
<PropertyGroup>
<EnableProjectHarvesting>true</EnableProjectHarvesting>
</PropertyGroup>
<ItemGroup>
<HarvestProject Include="..\WinFormsApp1\WinFormsApp1.csproj" ProjectOutputGroups="Binaries;Content;" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WinFormsApp1\WinFormsApp1.csproj" DoNotHarvest="true" />
</ItemGroup>
</Project> The file _WinFormsApp1.wxs seem to be correctly generated. <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<DirectoryRef Id="WinFormsApp1.Binaries">
<Component Id="cmpXyU0Z1m4pstj3gFehWAh3fMcvm8" Guid="*">
<File Id="filc44kgRlc0ph1L9tpQSa7H_VfJNc" Source="$(var.WinFormsApp1.TargetDir)\WinFormsApp1.runtimeconfig.json" />
</Component>
<Component Id="cmpeLAJmGoZI3JITCIHUSHabPa1P2A" Guid="*">
<File Id="filUy3u2MwjspXuV8KlOen46aR3t2s" Source="$(var.WinFormsApp1.TargetDir)\WinFormsApp1.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WinFormsApp1.Binaries">
<ComponentRef Id="cmpXyU0Z1m4pstj3gFehWAh3fMcvm8" />
<ComponentRef Id="cmpeLAJmGoZI3JITCIHUSHabPa1P2A" />
</ComponentGroup>
</Fragment>
<Fragment>
<DirectoryRef Id="WinFormsApp1.Symbols">
<Component Id="cmpNfHdJ31StCAcTjnRq3dKJGKXwLo" Guid="*">
<File Id="filCTvNheIE2KeA1kBwo6UASdpMxQk" Source="$(var.WinFormsApp1.TargetDir)\WinFormsApp1.pdb" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WinFormsApp1.Symbols">
<ComponentRef Id="cmpNfHdJ31StCAcTjnRq3dKJGKXwLo" />
</ComponentGroup>
</Fragment>
<Fragment>
<DirectoryRef Id="WinFormsApp1.Sources">
<Component Id="cmp7NeduT2BgaWrZ9L0hoC41Wyz0a8" Guid="*">
<File Id="filsmdAX6eD1rXjN2a3F4LcaK9BkN8" Source="$(var.WinFormsApp1.ProjectDir)\Form1.cs" />
</Component>
<Component Id="cmpzjRtBSGnbFA0pB6rN6UT58E6g5g" Guid="*">
<File Id="filSOrUMpHcccQH60f8JOjAk4LP.3c" Source="$(var.WinFormsApp1.ProjectDir)\Form1.Designer.cs" />
</Component>
<Component Id="cmpM61C.QCKWxODgxYyxJDt832ZIgw" Guid="*">
<File Id="filFTzgOFcNQHvsIlCDryw6Fuk1PT0" Source="$(var.WinFormsApp1.ProjectDir)\Program.cs" />
</Component>
<Component Id="cmpogJ3ctuVCBDP13zJKepQa0iS1FA" Guid="*">
<File Id="fil40N_uI2cEeyYTtFYh4I.kou4aJk" Source="$(var.WinFormsApp1.ProjectDir)\Form1.resx" />
</Component>
<Component Id="cmpRqJi7F4qQzI2YPvYFVbv1gCN7PU" Guid="*">
<File Id="fil0nrZzt2em3dn6q_aYrFWGXyNoXQ" Source="$(var.WinFormsApp1.ProjectDir)\WinFormsApp1.csproj" />
</Component>
<Directory Id="dir5HgaaZfGosP_Iaelr8SviUeEl0Q" Name="obj">
<Directory Id="dirHKHUBmicmclNuR78c.UKnnlrmzw" Name="Debug">
<Directory Id="dirhVGfzIrNMKmzRSljSwek0n1YAhQ" Name="net6.0-windows">
<Component Id="cmpMtwG5NLZ0mbdCV9.bVDhqaOos.8" Guid="*">
<File Id="filYp0Zmg4klKn639TPmksJo_pICf8" Source="$(var.WinFormsApp1.ProjectDir)\obj\Debug\net6.0-windows\WinFormsApp1.GlobalUsings.g.cs" />
</Component>
</Directory>
</Directory>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WinFormsApp1.Sources">
<ComponentRef Id="cmp7NeduT2BgaWrZ9L0hoC41Wyz0a8" />
<ComponentRef Id="cmpzjRtBSGnbFA0pB6rN6UT58E6g5g" />
<ComponentRef Id="cmpM61C.QCKWxODgxYyxJDt832ZIgw" />
<ComponentRef Id="cmpogJ3ctuVCBDP13zJKepQa0iS1FA" />
<ComponentRef Id="cmpRqJi7F4qQzI2YPvYFVbv1gCN7PU" />
<ComponentRef Id="cmpMtwG5NLZ0mbdCV9.bVDhqaOos.8" />
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="WinFormsApp1.Content" />
</Fragment>
<Fragment>
<ComponentGroup Id="WinFormsApp1.Satellites" />
</Fragment>
<Fragment>
<ComponentGroup Id="WinFormsApp1.Documents" />
</Fragment>
</Wix> Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
In the Deployment Dojo S1:E52, I walked through using Heat and how it has challenges with project harvesting. In Deployment Dojo S1:E53, I showed a working version with project references using the HeatWave Build Tools. |
Beta Was this translation helpful? Give feedback.
-
Thank you. I got it working. For people wondering. First issue with the auto harvesting, was that it was missing the Directory. The second issue with .NET core is that the harvesting is missing some files. Thanks to @robmen, I learn about the publish flag. Updated version of the project WixSimpleHarvestError.zip Installer.wixproj <Project Sdk="WixToolset.Sdk/4.0.2">
<ItemGroup>
<PackageReference Include="WixToolset.Heat" Version="4.0.2" />
</ItemGroup>
<PropertyGroup>
<EnableProjectHarvesting>false</EnableProjectHarvesting>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\WinFormsApp1\WinFormsApp1.csproj" Publish="true" />
<HarvestDirectory Include="$(IntermediateOutputPath)publish\WinFormsApp1">
<ComponentGroupName>WinFormsApp1</ComponentGroupName>
<DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
<SuppressRootDirectory>true</SuppressRootDirectory>
<SuppressRegistry>true</SuppressRegistry>
<Transforms>filter.xsl</Transforms>
</HarvestDirectory>
</ItemGroup>
</Project> Package.wxs <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Installer" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="01a52e1f-62e1-4d03-847e-1fbfa73722c7">
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed.)" />
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.Manufacturer) !(bind.Property.ProductName)" />
</StandardDirectory>
<Feature Id="Main" >
<Component Directory="INSTALLFOLDER">
<File Source="WinFormsApp1.exe" />
</Component>
<ComponentGroupRef Id="WinFormsApp1" />
</Feature>
</Package>
</Wix> filter.xsl this file is to removed PDF files and the EXE file so we can process the EXE file later like settings up services etc...
|
Beta Was this translation helpful? Give feedback.
In the Deployment Dojo S1:E52, I walked through using Heat and how it has challenges with project harvesting. In Deployment Dojo S1:E53, I showed a working version with project references using the HeatWave Build Tools.