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

Heat is not harvesting native x64 COM DLLs properly #8803

Closed
1 task done
Nico-Ko opened this issue Oct 29, 2024 · 2 comments · May be fixed by wixtoolset/wix#577
Closed
1 task done

Heat is not harvesting native x64 COM DLLs properly #8803

Nico-Ko opened this issue Oct 29, 2024 · 2 comments · May be fixed by wixtoolset/wix#577
Assignees
Labels

Comments

@Nico-Ko
Copy link

Nico-Ko commented Oct 29, 2024

WiX Version

5.0.2

.NET or MSBuild or Visual Studio Version

.NET 8.0.400 Visual Studio 17.11.2

HeatWave Version

1.0.4

Windows Version

Win 11 23H2

Repro Repo

https://github.com/Nico-Ko/Example-Repository

Repro Steps

  1. Build the Polygon Project to build a native X64 COM DLL
  2. Build the SetupProjectX64 to try to harvest the COM DLL with the HarvestFile Element and a Heat.exe call

Actual Result

Heat harvests the COM DLL and generates the wxs file and shows this warning:
warning HEAT5150: Could not harvest data from a file that was expected to be a SelfReg DLL

The build then fails with these two errors:
WIX0010 The TypeLib/@language attribute was not found; it is required.
WIX0047 The TypeLib element is non-advertised and therefore requires a parent File element.

Expected Result

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
    <Fragment>
        <DirectoryRef Id="INSTALLFOLDER" />
    </Fragment>
    <Fragment>
        <ComponentGroup Id="HeatExeX64">
            <Component Id="cmp1gt63DaJVcY.cQns0p9EJHfGeGo" Directory="INSTALLFOLDER" Guid="{A14CE815-D5FF-4D52-A8DF-535A54AE06A5}">
                <File Id="fil4WCy4.aIkUUAfD79mnQaoCiRm18" KeyPath="yes" Source="$(DllPath)\Polygon.dll">
                    <TypeLib Id="{4069CF31-301C-4D97-A532-C99FA94041B3}" Description="PolygonLib" HelpDirectory="INSTALLFOLDER" Language="0" MajorVersion="1" MinorVersion="0">
                        <Class Id="{B7EF56BD-C04F-4DB6-B7E1-0FF4BEA3A711}" Context="InprocServer32" Description="PolyCtl class" ThreadingModel="apartment" Version="1.0" Insertable="yes" Programmable="yes" Control="yes" />
                        <Interface Id="{0B624377-52DB-4963-AD0B-2E648EBC3DA1}" Name="_IPolyCtlEvents" ProxyStubClassId32="{00020420-0000-0000-C000-000000000046}" />
                        <Interface Id="{CD1F2176-9058-4E2B-ABAF-ECC703CA832F}" Name="IPolyCtl" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    </TypeLib>
                </File>
                <RegistryValue Root="HKCR" Key="CLSID\{b7ef56bd-c04f-4db6-b7e1-0ff4bea3a711}\MiscStatus\1" Value="131473" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="CLSID\{b7ef56bd-c04f-4db6-b7e1-0ff4bea3a711}\MiscStatus" Value="0" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="CLSID\{b7ef56bd-c04f-4db6-b7e1-0ff4bea3a711}\ToolboxBitmap32" Value="[!fil4WCy4.aIkUUAfD79mnQaoCiRm18], 106" Type="string" Action="write" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

This file was created by a Heat version where the following line was patched:

https://github.com/wixtoolset/wix/blob/a75f23d32c3892e9977e7a48b4b347342ab182a9/src/tools/heat/UtilFinalizeHarvesterMutator.cs#L859C32-L859C132

From this:

else if (5 == parts.Length && String.Equals("win32", parts[4], StringComparison.OrdinalIgnoreCase))

to this:

else if (5 == parts.Length && (String.Equals("win32", parts[4], StringComparison.OrdinalIgnoreCase) || String.Equals("win64", parts[4], StringComparison.OrdinalIgnoreCase)))

This appears to fix the issue, however it is not clear to us if this is the right location. So we created this bug to make sure we did not overlook something.

Please let us know if this fix should be submitted as a Pull Request.

Acknowledgements

  • I acknowledge that this is a fully completed bug report. It is not a question or attempt to get help debugging my issue (because those should be sent to Discussions).
@Nico-Ko Nico-Ko added the triage label Oct 29, 2024
@barnson
Copy link
Member

barnson commented Nov 19, 2024

We'd take a pull request. Note that Heat is deprecated: #6838

@Nico-Ko
Copy link
Author

Nico-Ko commented Nov 20, 2024

@barnson Could you please assign me to this issue then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants