Wix 补丁生成错误

问题描述 投票:0回答:1

我使用转换来生成文件的组件,每次转换都会生成新的 GID。这可能是一个问题 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>

因为在生成补丁时我会得到每个组件的错误列表。由于每次生成新的 GUI 时组件列表都会发生变化

C:\patch creation\new\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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\SPOS_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.

错误的真实屏幕 我的 Patch.wsx 文件如下所示:

<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> 

我用这个命令构建它:

wix build -define Version=2.0 -bindpath C:\Users\purbanski\source\repos\spos-onboard\src\SposOnboard\SposOnboardInstallerWix\bin\x86\Release\en-us -bindpath C:\Users\purbanski\source\repos\spos-onboard\src\SposOnboard\SposOnboardInstallerWix\bin\x86\Release\en-us  -out MyPatchV1V2.msp Patch.wxs

我训练构建补丁

wix
1个回答
0
投票

如果您在收获期间生成唯一的 GUID,则 MSP 将无法实现。这是 Windows Installer 的基本设计限制。

© www.soinside.com 2019 - 2024. All rights reserved.