Create a MSI installer for deploying fonts using Wix (including more fonts in one MSI)
<p>Please, could anyone provide a full .wxs example for creating a MSI package?</p>

<p>I've already read this thread already:
<a href="https://stackoverflow.com/questions/867511/how-to-install-open-type-fonts-using-wix">How to install Open Type Fonts using Wix</a></p>

<p>But it does not help me enough. I would add a comment there, but I've got not enough reputation points :/</p>

<p><strong>What is wrong?</strong> I receive following errors:</p>

<pre><code>D:\share\IT\install-MSI\MSI věvoj\fonty-2016&gt;candle font-Gabka2.wxs 
Windows Installer XML Toolset Compiler version 3.10.2.2516
Copyright (c) Outercurve Foundation. All rights reserved.

font-Gabka2.wxs
D:\share\IT\install-MSI\MSI věvoj\fonty-2016\font-Gabka2.wxs(14) : warning CNDL1091 : The Package/@Id attribute has been set.  Setting this attribute will allow nonidentical .msi files to have the same package code.  This may be a problem because the package code is the primary identifier used by the installer to search for and validate the correct package for a given installation.  If a package is changed without changing the package code, the installer may not use the newer package if both are still accessible to the installer.  Please remove the Id attribute in order to automatically generate a new package code for each new .msi file.

D:\share\IT\install-MSI\MSI věvoj\fonty-2016&gt;light font-Gabka2.wixobj 
Windows Installer XML Toolset Linker version 3.10.2.2516
Copyright (c) Outercurve Foundation. All rights reserved.

D:\share\IT\install-MSI\MSI věvoj\fonty-2016\font-Gabka2.wxs(34) : error LGHT0094 : Unresolved reference to symbol 'WixAction:InstallExecuteSequence/RemoveExistingProducts' in section 'Product:*'.
</code></pre>

<p>The source WXS file code:</p>

<pre><code>&lt;?xml version='1.0'?&gt;
&lt;?define ProductName = "Font Gabka2 (SVČ Lužánky)"?&gt;
&lt;?define PrevProductVersion = "1.0"?&gt; &lt;!-- Match previous version, use "1.0.0" for new install if not known --&gt;
&lt;?define ProductVersion = "1.0"?&gt; &lt;!-- Match new version --&gt;
&lt;?define ProductCode = "PUT-GUID-HERE"?&gt; &lt;!-- Re-generate for new upgrade! (http://www.guidgen.com/) --&gt;
&lt;?define ProductUpgradeCode = "PUT-GUID-HERE"?&gt; &lt;!-- When upgrading, overwrite with previous ProductCode here. --&gt;
&lt;Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'&gt;
        &lt;Product Id='*'
                UpgradeCode="$(var.ProductUpgradeCode)"
                Name="$(var.ProductName)"
                Language='1033'
                Version='$(var.ProductVersion)'
                Manufacturer='SVČ Lužánky'&gt;
                &lt;Package Id='$(var.ProductCode)'
                        Description='$(var.ProductName) $(var.ProductVersion)'
                        InstallerVersion='200'
                        Compressed='yes' /&gt;
                &lt;Media Id='1' Cabinet='setup.cab' EmbedCab='yes' /&gt;

&lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
  &lt;Directory Id="FontsFolder"&gt;
    &lt;Component Id="InstallFonts" Guid="*"&gt;  &lt;!-- New GUID HERE FOR NEW FILE (no changes for upgrade, though) --&gt;
      &lt;File Id="Gabka2.ttf" Source="Gabka2.ttf" TrueType="yes" KeyPath="yes" /&gt; 
    &lt;/Component&gt; 
  &lt;/Directory&gt;  
&lt;/Directory&gt; 

                &lt;Upgrade Id="$(var.ProductUpgradeCode)"&gt;
                        &lt;UpgradeVersion Minimum="$(var.ProductVersion)"
                                IncludeMinimum="no"
                                OnlyDetect="yes"
                                Language="1033"
                                Property="NEWPRODUCTFOUND" /&gt;
                        &lt;UpgradeVersion Minimum="$(var.PrevProductVersion)"
                                IncludeMinimum="yes"
                                Maximum="$(var.ProductVersion)"
                                IncludeMaximum="no"
                                Language="1033"
                                Property="UPGRADEFOUND" /&gt;
                &lt;/Upgrade&gt;
                &lt;Property Id="ARPSYSTEMCOMPONENT" Value="1" /&gt;
                &lt;Feature Id='InstallFeature' Title='Install Feature' Level='1'&gt;
                        &lt;ComponentRef Id='InstallFonts' /&gt;
                &lt;/Feature&gt;

                &lt;!-- Prevent downgrading --&gt;
                &lt;CustomAction Id="PreventDowngrading" Error="Newer version already installed." /&gt;

                &lt;InstallUISequence&gt;
                        &lt;Custom Action="PreventDowngrading" After="FindRelatedProducts"&gt;NEWPRODUCTFOUND&lt;/Custom&gt;
                &lt;/InstallUISequence&gt;
        &lt;/Product&gt;
&lt;/Wix&gt;
</code></pre>

<p>Thank you</p>

<p>PS: How to install <strong>more TTF fonts in one MSI</strong>? If I add more files, I get errors like this:</p>

<pre><code>error CNDL0042 : The Component element has multiple key paths set.  The key path may only be set to 'yes' in extension elements that support it or one of the following locations: Component/@KeyPath, File/@KeyPath, RegistryValue/@KeyPath, or ODBCDataSource/@KeyPath.
</code></pre>

<p>PS2: I've used this project <a href="https://github.com/pennmanor/wix-wrapper" rel="nofollow">https://github.com/pennmanor/wix-wrapper</a> as a template base for my new WIX-MSI font project.</p>