最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

installation - Heat harvesting in Wix 5 - wix doesn't find the namespace components - Stack Overflow

programmeradmin0浏览0评论

I am trying to create an MSI file using Wix version 5.0.2. In my VS project, I added the NuGet package FireGiant.HeatWave.BuildTools.wixext and also the HeatWave extension for VS2022. My goal is to create an MSI that installs a WPF application in Program Files. For that, it must install the published WPF. It also needs to create an appearance folder to store some icons, and a runtime folder to store the Python executable file and the other necessary subfolders and files for Python. I am stuck on trying to capture the WPF project output. This is my code so far:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns=";
     xmlns:hbt=";>
    <Package Manufacturer="Denis Ivanov" 
             Name="Adjustrix Desktop" 
             UpgradeCode="5e40079f-d71d-4357-8339-bea315159720"
             Version="0.1">
        <StandardDirectory Id="ProgramFilesFolder">
            <Directory Id="PFRoot" Name="Adjustrix">
                <Directory Id="DesktopRoot" Name="Desktop">
                    <Directory Id="AppearanceFolder" Name="appearance"/>
                    <Directory Id="RuntimeFolder" Name="runtime"/>
                </Directory>
            </Directory>
        </StandardDirectory>

    <Feature Id="AppearanceInstall">
        <Component Directory="AppearanceFolder">
            <File Source="C:\Users\denis\source\repos\Adjustrix\Logo3.ico"/>
        </Component>
    </Feature>

    <Feature Id="ProgramInstall">
        <Component Directory="DesktopRoot">
            <File Source="C:\Users\denis\source\repos\Adjustrix\AdjustrixWPF\bin\Release\net8.0-windows\AdjustrixWPF.exe"/>
        </Component>
        <Component Directory="RuntimeFolder">
            <hbt:HarvestProjectOutput Id="AdjustrixWPF">
                
            </hbt:HarvestProjectOutput>
        </Component>
    </Feature>
</Package>

This is from my wix project file to show that I am referencing the WPF project:

<Project Sdk="WixToolset.Sdk/5.0.2">
<ItemGroup>
  <PackageReference Include="FireGiant.HeatWave.BuildTools.wixext" Version="5.0.3" />
  <PackageReference Include="WixToolset.Heat" Version="5.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdjustrixWPF\AdjustrixWPF.csproj" 
                  Publish="true" 
                  HarvestOutputGroup="PublishedItemsOutputGroup" />
</ItemGroup>
</Project>

When I try to build the code from the command line, I get these errors:

error WIX0200: The Component element contains an unhandled extension element 'HarvestProjectOutput'. Please ensure that the extension for elements in the '' namespace has been provided. C:\Users\denis\source\repos\Adjustrix\AdjustrixWpfInstaller\Package.wxs(27) : error WIX0230: The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components using a Directory as a KeyPath or containing ODBCDataSource child elements cannot use an automatically generated guid. Make sure your component doesn't have a Directory as the KeyPath and move any ODBCDataSource child elements to components with explicit component guids. C:\Users\denis\source\repos\Adjustrix\AdjustrixWpfInstaller\Package.wxs(27) : error WIX0330: The Component/@Id attribute was not found; it is required when there is no valid keypath to use as the default id value. I tried to fix it, but got stuck. Any help will be appreciated!

I am trying to create an MSI file using Wix version 5.0.2. In my VS project, I added the NuGet package FireGiant.HeatWave.BuildTools.wixext and also the HeatWave extension for VS2022. My goal is to create an MSI that installs a WPF application in Program Files. For that, it must install the published WPF. It also needs to create an appearance folder to store some icons, and a runtime folder to store the Python executable file and the other necessary subfolders and files for Python. I am stuck on trying to capture the WPF project output. This is my code so far:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset./schemas/v4/wxs"
     xmlns:hbt="http://www.firegiant/schemas/v4/wxs/heatwave/buildtools">
    <Package Manufacturer="Denis Ivanov" 
             Name="Adjustrix Desktop" 
             UpgradeCode="5e40079f-d71d-4357-8339-bea315159720"
             Version="0.1">
        <StandardDirectory Id="ProgramFilesFolder">
            <Directory Id="PFRoot" Name="Adjustrix">
                <Directory Id="DesktopRoot" Name="Desktop">
                    <Directory Id="AppearanceFolder" Name="appearance"/>
                    <Directory Id="RuntimeFolder" Name="runtime"/>
                </Directory>
            </Directory>
        </StandardDirectory>

    <Feature Id="AppearanceInstall">
        <Component Directory="AppearanceFolder">
            <File Source="C:\Users\denis\source\repos\Adjustrix\Logo3.ico"/>
        </Component>
    </Feature>

    <Feature Id="ProgramInstall">
        <Component Directory="DesktopRoot">
            <File Source="C:\Users\denis\source\repos\Adjustrix\AdjustrixWPF\bin\Release\net8.0-windows\AdjustrixWPF.exe"/>
        </Component>
        <Component Directory="RuntimeFolder">
            <hbt:HarvestProjectOutput Id="AdjustrixWPF">
                
            </hbt:HarvestProjectOutput>
        </Component>
    </Feature>
</Package>

This is from my wix project file to show that I am referencing the WPF project:

<Project Sdk="WixToolset.Sdk/5.0.2">
<ItemGroup>
  <PackageReference Include="FireGiant.HeatWave.BuildTools.wixext" Version="5.0.3" />
  <PackageReference Include="WixToolset.Heat" Version="5.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdjustrixWPF\AdjustrixWPF.csproj" 
                  Publish="true" 
                  HarvestOutputGroup="PublishedItemsOutputGroup" />
</ItemGroup>
</Project>

When I try to build the code from the command line, I get these errors:

error WIX0200: The Component element contains an unhandled extension element 'HarvestProjectOutput'. Please ensure that the extension for elements in the 'http://www.firegiant/schemas/v4/wxs/heatwave/buildtools' namespace has been provided. C:\Users\denis\source\repos\Adjustrix\AdjustrixWpfInstaller\Package.wxs(27) : error WIX0230: The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components using a Directory as a KeyPath or containing ODBCDataSource child elements cannot use an automatically generated guid. Make sure your component doesn't have a Directory as the KeyPath and move any ODBCDataSource child elements to components with explicit component guids. C:\Users\denis\source\repos\Adjustrix\AdjustrixWpfInstaller\Package.wxs(27) : error WIX0330: The Component/@Id attribute was not found; it is required when there is no valid keypath to use as the default id value. I tried to fix it, but got stuck. Any help will be appreciated!

Share Improve this question edited Feb 2 at 13:48 Denis Ivanov asked Feb 2 at 13:01 Denis IvanovDenis Ivanov 496 bronze badges 3
  • And I would also like to ask if someone can clarify how to setup Wix to use Program Files, not Program Files (x86). I tried to specify Win64="yes" or Platform="64" inside the Package tag, but these properties were not recognized by Wix. – Denis Ivanov Commented Feb 2 at 13:03
  • 1 The error message suggests that you are missing the PackageReference to FireGiant.HeatWave.BuildTools.wixext... or are maybe referencing an older version of it. Can you update your question to include the whole .wixproj or, at least, the part that shows the PackageReferences? – Rob Mensching Commented Feb 2 at 13:34
  • I updated it. By the way, I was just watching your video tutorials - they are awesome! It is amazing that it is you who is answering my question here! Thanks! – Denis Ivanov Commented Feb 2 at 13:49
Add a comment  | 

1 Answer 1

Reset to default 1

It looks as though you have the PackageReference set correctly. My guess is that you did not do a "restore" after adding the PackageReference lines to your .wixproj. Any of the following options will work:

  1. msbuild -Restore from the command-line will restore all your package references and do the default action (usually, "Build"). I pretty much always use this command-line so I don't have to think about whether I did a restore.
  2. dotnet build from the command-line ends up (for the most part) the same as the first option. I've started adopting this in command-line examples because it is easier (and, thus, always works).
  3. Use Visual Studio (with HeatWave). Visual Studio does a bunch of stuff as part of the build process. Restoring is one of them.

I used dotnet build with your example files and things worked.

发布评论

评论列表(0)

  1. 暂无评论