Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HarvestSuppressUniqueIds does not take effect under HarvestDirectory item. #7556

Open
mobigliani opened this issue Jun 16, 2023 · 0 comments
Labels
up for grabs No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue"

Comments

@mobigliani
Copy link

  • Which version of WiX are you building with?

4.0.1

  • Which version of Visual Studio are you building with (if any)?

Visual Studio Professional 2019 16.11.27

  • Which version of the WiX Toolset Visual Studio Extension are you building with (if any)?

FireGiant HeatWave 1.0.1.1

  • Which version of .NET are you building with?

.NET Framework 4.8.04084

  • If the problem occurs when installing your packages built with WiX, what is the version of Windows the package is running on?

N/A

  • Describe the problem and the steps to reproduce it.

Using WixToolset.Heat (4.0.1) I am attempting to harvest directory containing some dlls with the following .wixproject:

<Project>
  <Import Project="Sdk.props" Sdk="WixToolset.Sdk" Version="4.0.1" />
  <PropertyGroup>
    <HarvestDirectorySuppressFragments>true</HarvestDirectorySuppressFragments>
    <HarvestDirectorySuppressRegistry>true</HarvestDirectorySuppressRegistry>
    <Configurations>Release</Configurations>
    <Platforms>x64</Platforms>
  </PropertyGroup>
  <PropertyGroup>
    <Platform Condition=" '$(Platform)' == '' ">x64</Platform>
    <OutputName>Test</OutputName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
    <SuppressPdbOutput>True</SuppressPdbOutput>
    <DefineConstants>
        SupportDllsSource=$(ProjectDir)dlls;
    </DefineConstants>
    <CompilerAdditionalOptions />
    <SuppressIces>ICE60;ICE80</SuppressIces>
    <VerboseOutput>False</VerboseOutput>
    <OutputPath>bin</OutputPath>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="WixToolset.Heat" Version="4.0.1" />
  </ItemGroup>
  <ItemGroup>
    <!-- HarvestSuppressUniqueIds does not seem to work for HarvestDirectory. -->
    <HarvestDirectory Include="$(ProjectDir)dlls">
      <ComponentGroupName>SupportDlls</ComponentGroupName>
      <DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
      <PreprocessorVariable>SupportDllsSource</PreprocessorVariable>
      <HarvestSuppressUniqueIds>true</HarvestSuppressUniqueIds>
    </HarvestDirectory>
  </ItemGroup>
  <Import Project="Sdk.targets" Sdk="WixToolset.Sdk" Version="4.0.1" />
</Project>

Despite of using HarvestSuppressUniqueIds metadata under HarvestDirectory, intermediate _SupportDlls_dir.wxs file has unique identifiers generated for all files and components:

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
    <Fragment>
        <DirectoryRef Id="INSTALLFOLDER">
            <Directory Id="dirKp0.VhR1CxGJt79bLLrscVR_Bgw" Name="dlls">
                <Component Id="cmpIVP03Fs637JFviIfqpKS1bLF4rs" Guid="*">
                    <File Id="filqIf7Yt2814OoNFpZL2TICTQahic" KeyPath="yes" Source="$(SupportDllsSource)\Microsoft.AspNetCore.Http.Abstractions.dll" />
                </Component>
                <Component Id="cmpjXSsFsZxdvhv8iUZbEMN4z7dwyQ" Guid="*">
                    <File Id="file.yDnqHgoieDXriUElOAY.Z5r1A" KeyPath="yes" Source="$(SupportDllsSource)\Microsoft.AspNetCore.Http.Features.dll" />
                </Component>
            </Directory>
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="SupportDlls">
            <ComponentRef Id="cmpIVP03Fs637JFviIfqpKS1bLF4rs" />
            <ComponentRef Id="cmpjXSsFsZxdvhv8iUZbEMN4z7dwyQ" />
        </ComponentGroup>
    </Fragment>
</Wix>

Defining HarvestSuppressUniqueIds as a property common to all Harvest items works properly. It isn't satisfying solution, however, when dealing with multiple directories to harvest with different settings.

  • Describe the behavior you expected and how it differed from the actual behavior.

Using HarvestSuppressUniqueIds metadata under HarvestDirectory item should stop generating unique identifiers and infer them from file names, as it takes place when using standalone heat.exe tool from command line.

@barnson barnson added up for grabs No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue" and removed triage labels Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up for grabs No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue"
Projects
None yet
Development

No branches or pull requests

2 participants