Warning in Wix Setup

2019-03-01 01:11发布

问题:

I am new to Wix toolkit. I am creating one setup using Wix Toolkit for my Application. But when I try to build it using Wix. It shows this warning.

C:\Users\BNK\Desktop\wix - popup\setup.wxs(60) : warning LGHT1076 : ICE69: Mismatched component reference. Entry 'FCONStartMenuShortcut' of the Shortcut table b elongs to component 'FCONShortcut'. However, the formatted string in column 'Tar get' references file 'FCONUCClient.exe' which belongs to component 'FCONUCClient .exe'. Components are in the same feature.

Can anybody show me what's wrong in my code? Here is the Wix Setup codes...

<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' >

  <Product Name='FCON UC Client 1.0.9' Id='PUT-GUID-HERE' 
          UpgradeCode='PUT-GUID-HERE'
          Language="'1033'" Codepage='1252' Version='1.0.9' 
          Manufacturer='BNK Systems JLT' >
    <!-- Product Info-->

    <Package Id='*' Keywords='Installer' Description="FCON UC Client 1.0.9"
      Comments='All Rights Reserved BNK Systems JLT.' 
      Manufacturer='BNK Systems JLT' InstallerVersion='100' Languages='1033'
      Compressed='yes' SummaryCodepage='1252' />
    <!-- Package Info-->
    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1' />
    <!-- Setup is CDROM Installer Package-->
    <Property Id='DiskPrompt' 
              Value="BNK Systems JLT FCON UC Client Installation" />
    <!-- Definition for DiskPrompt used in Media above -->

    <Directory Id="TARGETDIR" Name="SourceDir">
      <!--  Directory Structure Root -->
      <Directory Id="ProgramFilesFolder">
        <!-- Install the Package in Program Files Folder -->
        <Directory Id="APPLICATIONROOTDIRECTORY" Name="BNK Systems">
          <!-- Create a Folder namely BNK Systems  inside Program Files ; Id APPLICATIONROOTDIRECTORY can be defined later-->
          <Directory Id="APPLICATIONFILEDIRECTORY" Name="FCON UC Client">
            <!-- Create a Folder namely FCON UC Client inside BNK Systems; Id APPLICATIONFILEDIRECTORY can be defined later -->

          </Directory>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <!-- Program Files StartMenu Folder-->
        <Directory Id="FCONStartMenuFolder" Name="BNK Systems"/>
      </Directory>
    </Directory>

    <DirectoryRef Id="APPLICATIONFILEDIRECTORY">
      <!-- Definition of Directory APPLICATIONFILEDIRECTORY  -->
      <Component Id="FCONUCClient.exe" Guid="*">
        <!-- Application files & settings to be installed goes here-->
        <File Source="FCON UC Client.exe" KeyPath="yes" Checksum="yes"/>
        <File Source="Asterisk.NET.dll" />
        <File Source="Dotnetrix.TabControl.dll" />
        <File Source="FCON UC Client.exe.manifest" />
        <File Source="jabber-net.dll" />
        <File Source="muzzle.dll" />
        <File Source="netlib.Dns.dll" />
        <File Source="zlib.net.dll" />
        <File Source="inittrial.exe" />
     </Component>
    </DirectoryRef>

    <DirectoryRef Id="FCONStartMenuFolder">
      <Component Id="FCONShortcut" Guid="*">
        <Shortcut Id="FCONStartMenuShortcut"
                     Name="FCON UC Client 1.0.9"
                   Description="FCON UC Client 1.0.9"
                    Target="[#FCONUCClient.exe]"
                          WorkingDirectory="APPLICATIONFILEDIRECTORY"/>
       <RemoveFolder Id="FCONStartMenuFolder" On="uninstall"/>

       <RegistryValue Root="HKCU" Key="Software\Microsoft\FCONUCClient" 
                      Name="installed" Type="integer" Value="1" KeyPath="yes"/>

      </Component>
    </DirectoryRef>

    <!-- Step 3: Tell WiX to install the files -->
    <Feature Id="InstallFCON" Title="FCON UC Client 1.0.9" Level="1">
      <ComponentRef Id="FCONUCClient.exe" />
      <!--<ComponentRef Id="documentation.html" />-->
      <ComponentRef Id="FCONShortcut" />
    </Feature>

  </Product>
</Wix>

回答1:

Some advice from experience:

  • Use one file per component, this avoids all sorts of problems (exception: multi file .net assemblies which should be placed together in one component. There may be other exceptions too, but as a general rule: one file per component).
  • Add shortcuts to the same component where the file they reference is located. In your case this means moving FCONStartMenuShortcut to the FCONUCClient.exe component.
  • Only the key file of each component is checked to determine if the component as a whole should be installed. When you put several files in the same component this means that none of the files will be updated in an upgrade if the key file is not upgraded. This violates Microsoft's best practice rules (component rules).

Please give these sites a skim to help you size up the technology:

  • http://wix.tramontana.co.hu/
  • http://wixtoolset.org/documentation/manual/v3/main/wix_learning.html
  • http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with (nice code-based one, for the "tinkerers" to get a flying start)