Search code examples
wix

Wix Patch generation erros


I used transformation to generate components for the files and each time the transformation generates new GIDs. This can be probably a problem this is my transformation

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
                xmlns="http://wixtoolset.org/schemas/v4/wxs"
                exclude-result-prefixes="wix">

  <!--Load all components-->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <!--Filter components-->
  <xsl:key name="pdb-search" match="wix:Component[contains(wix:File/@Source, '.pdb')]" use="@Id" />
  <xsl:template match="wix:Component[key('pdb-search', @Id)]" />
  <xsl:template match="wix:ComponentRef[key('pdb-search', @Id)]" />

  <!--Override SAMPLE.exe component-->
  <xsl:key name="sampleExe-search" match="wix:Component[wix:File/@Source='$(var.BasePath)\SAMPLE.exe']" use="@Id" />  
  <xsl:template match="wix:Component[key('sampleExe-search', @Id)]" >
    <Component Id="cmpSample" Guid="{@Guid}">
      <File Id="filSample" Source="$(var.BasePath)\SAMPLE.exe"/>
      <ProgId Id="SAMPLE Weather file" Description="Weather information used to route ships over the oceans" Icon="Sample.exe" IconIndex="0" Advertise="yes">
        <Extension Id="sps" Advertise="yes">
          <MIME ContentType="application/sps" Default="yes" />
          <Verb Id="open" Command="&amp;Open" Argument="&quot;%1&quot;" Sequence="1" />
        </Extension>
      </ProgId> 
    </Component>
    <Component Id="DesktopShortcut" Guid="60F4A4B3-DD4D-4FD6-B6AE-9C5EB8FCC0D1" Directory="DesktopFolder" Condition="CREATE_DESKTOP_ICON">
      <RegistryValue Root="HKCU" Key="SOFTWARE\TechGroup\SAMPLE_9" Name="DesktopShortcutEnabled" Value="1"></RegistryValue>
      <Shortcut Name="SAMPLE_9" Directory="DesktopFolder" Target="[#filSample]" Icon="Sample.exe"></Shortcut>
    </Component>
    <Component Id="MenuShortcut" Guid="771174C2-CAC8-4E32-9BC6-C91D5458C9FA" Directory="ProgramMenuFolder" Condition="CREATE_MENU_ITEMS">
      <RegistryValue Root="HKCU" Key="SOFTWARE\TechGroup\SAMPLE_9" Name="MenuShortcutEnabled" Value="1"></RegistryValue>
      <Shortcut Name="SAMPLE_9" Directory="ProgramMenuFolder" Target="[#filSample]" Icon="Sample.exe"></Shortcut>
    </Component>
  </xsl:template>  
  <xsl:template match="wix:ComponentRef[key('sampleExe-search', @Id)]" >
    <ComponentRef Id="cmpSample" />
    <ComponentRef Id="DesktopShortcut" />
    <ComponentRef Id="MenuShortcut" />
  </xsl:template>
  
  <!--Override SAMPLE.exe.cofig component-->
  <xsl:key name="sampleExeConfig-search" match="wix:Component[wix:File/@Source='$(var.BasePath)\SAMPLE.exe.config']" use="@Id" />
  <xsl:template match="wix:Component[key('sampleExeConfig-search', @Id)]" >
    <Component Id="cmpSampleConfig" Guid="{@Guid}">
      <File Id="filSampleConfig" Source="$(var.BasePath)\SAMPLE.exe.config" />
    </Component>     
  </xsl:template>    
  <xsl:template match="wix:ComponentRef[key('sampleExeConfig-search', @Id)]" >
    <ComponentRef Id="cmpSampleConfig" />  
  </xsl:template>

</xsl:stylesheet>

because when generating a patch I get a list of errors for each component. Since the list of components changes each time new GUIs are generated

C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpyCS6YyDTyJkQgc8huzIZDCVWgKE' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpyFmO.0Y9VC3vYYMMmrdEzut86QE' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpy_JwZlrA0E.z.S5kNPQVrbh8eDE' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpyhmgT96wXgO6xXU6TQAq_c_i1XE' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpz.VA3sXmzkRwYFkiGBOVekughW8' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpz43YohzMGP9rXZZCPv8BQdEo2ZA' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpzKkjlAgCv0Bt1Ua__5X2MYNhyFg' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpzeCdz2zW17T3jTD6M_Tb6v4JIYU' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpzfMfn0XaGQpis0F6xJ6D672J08A' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpzkJaQ576cXT1n5UZiudak0QTE_4' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpzrVlTC_vmvuBdNrhK07LvzTa2pc' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : error WIX0305: Removing component 'cmpzroMeoHBn0Bpu91Sux3KBINena0' from feature 'ProductFeature' is not supported. Either the component was removed or the guid changed in the transform 'RTM'. Add the component back, undo the change to the component guid, or remove the entire feature.
C:\patch creation\new\SAMPLE_9.msi : warning WIX1110: Component 'cmpDuCAJnvh7iERisroNVs4ez1Xrfg' was added to feature 'ProductFeature' in the transform 'RTM'. If you cannot guarantee that this feature will always be installed, you should consider adding new components to new top-level features to prevent prompts for source when installing this patch.

real screen of errors My Patch.wsx file look like this:

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Patch
    AllowRemoval="yes"
    DisplayName="Product Patch v$(Version)"
    Description="Product Patch v$(Version)"
    MoreInfoURL="https://wixtoolset.org/"
    Manufacturer="WiX Toolset"
    Classification="Update">

    <Media Id="1" Cabinet="patch.cab">
      <PatchBaseline
        Id="RTM1"
        BaselineFile="SAMPLE_9_old.msi"
        UpdateFile="SAMPLE_9.msi" />
    </Media>

    <PatchFamily Id="SequenceFamily" Version="1.1.1" />
  </Patch>
</Wix> 

And i build it with this command:

wix build -define Version=2.0 -bindpath C:\Users\purbanski\source\repos\SAMPLE-onroad\src\SAMPLEonroad\SAMPLEonroadInstallerWix\bin\x86\Release\en-us -bindpath C:\Users\purbanski\source\repos\SAMPLE-onroad\src\SAMPLEonroad\SAMPLEonroadInstallerWix\bin\x86\Release\en-us  -out MyPatchV1V2.msp Patch.wxswix build -define Version=2.0 -bindpath C:\Users\purbanski\source\repos\SAMPLE-onroad\src\SAMPLEonroad\SAMPLEonroadInstallerWix\bin\x86\Release\en-us -bindpath C:\Users\purbanski\source\repos\SAMPLE-onroad\src\SAMPLEonroad\SAMPLEonroadInstallerWix\bin\x86\Release\en-us  -out MyPatchV1V2.msp Patch.wxs

I traing build patch


Solution

  • If you generate unique GUIDs during harvesting then MSPs will not be possible. That is a fundamental design limitation of the Windows Installer.