0

I want to create an .msi file using the WiX Toolset within a GitHub Action. Since I generate a .wxs file (Components.wxs) using the "heat" command, I have two files (Components.wxs and Product.wxs) that need to be used during compilation. Unfortunately, the reference to the Components.wxs file is not working.

The Components.wxs file look kinder:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="PATH">
            <Component Id="SOMEDLL.dll" Guid="*">
                <File Id="SOMEDLL.dll" KeyPath="yes"
                      Source="SourceDir\SOMEPATH" />
            </Component>
        </DirectoryRef>
    </Fragment>
<Fragment>
    <ComponentGroup Id="Components">
            <ComponentRef Id="SOMEDLL.dll" />
    </ComponentGroup>
</Fragment>

Initially, I attempted to directly use a ComponentGroupRef with the respective Id from the Components.wxs file within my Product tag in the Product.wxs.

<Feature Id="ProductFeature" 
     Title="Setup" 
     Level="1">
    <ComponentGroupRef Id="Components" />
</Feature>

However, this consistently resulted in the error Product.wxs(21) : error LGHT0094 : Unresolved reference to symbol 'WixComponentGroup:Components' in section 'Product:*'.

Subsequently, I tried adding the following tag to the ItemGroup section in the Setup.wixproj: <Compile Include="Components.wxs" />. However, this did not bring about any changes.

Now, I attempted to include a .wxi file in the project, which is included in the Product.wxs and references the ComponentGroup in the Components.wxs file. Unfortunately, I encountered an error stating that the ComponentGroupRef tag is not allowed.

IncludeComponents.wxi:

<?xml version="1.0" encoding="utf-8"?>
<Include>
    <ComponentGroupRef Id="Components" />
</Include>

In the Product.wxs:

<Feature Id="ProductFeature" 
     Title="Setup" 
     Level="1">
    <ComponentGroupRef Id="Components" />
</Feature>

Error: IncludeComponents.wxi(3) : error CNDL0005 : The Wix element contains an unexpected child element "ComponentGroupRef".

Here is the run-block in the GitHub action:

run: |
  cd Setup
  C:\wix\heat.exe dir ..\publishData -ag -dr PublishData -srd -sfrag -suid -cg Components -out Components.wxs
  C:\wix\candle.exe -ext C:\wix\WixIIsExtension.dll -ext C:\wix\WixUIExtension.dll Components.wxs Product.wxs 
  C:\wix\light.exe Product.wixobj -ext C:\wix\WixIIsExtension.dll -ext C:\wix\WixUIExtension.dll -out MySetup.msi

I have no idea why this is not working, and after a day, I've reached the limit of my patience. Can someone please tell me how to properly reference another .wxs file within the Product.wxs file? Thanks for any help.

2 Answers 2

0

The issue is that this line in your .wixproj does not seem to be finding this file:

<Compile Include="Components.wxs" />

You don't provide enough information to know why that file is not found, but (assuming WiX v3) you need two Compile items in your .wixproj:

<ItemGroup>
  <Compile Include="Products.wxs" />
  <Compile Include="the\correct\path\to\the\Components.wxs" />
</ItemGroup>

What you are attempting to do with the Include file (.wxi) is confusing you. You don't need and should not use Include files.

Sign up to request clarification or add additional context in comments.

3 Comments

First of all thank you for the help. However, I don't think it's the fault, because the Components.wxs is in the same directory as the .wixproj file. Could it be the command itself C:\wix\candle.exe -ext C:\wix\WixIIsExtension.dll -ext C:\wix\WixUIExtension.dll Components.wxs Product.wxs is wrong? Must the .wixproj also be specified there?
MSBuild.exe, not candle.exe, interprets the .wixproj. Editing the .wixproj will have no effect. Your candle.exe command-line could be correct but the error is coming from light.exe. You should edit your question to be clear about how you are building.
ohh man, you are right. The light command is wrong, not the candle command. I've been looking for it wrong all along. I will add the complete run block to my question. Sorry
0

I found the error. In the light command the Components.wixobj had to be included before the Product.wixobj.

1 Comment

The order doesn't matter. You just need both files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.