请任何人都可以提供完整的.wxs示例来创建MSI程序包?创建MSI安装程序以使用Wix部署字体(在一个MSI中包括更多字体)
我已经阅读此线程已经: How to install Open Type Fonts using Wix
但它并不能帮助我就好了。我会在那里添加评论,但我没有足够的声望点:/
有什么不对?我收到以下错误:
D:\share\IT\install-MSI\MSI věvoj\fonty-2016>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>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:*'.
源WXS文件代码:
<?xml version='1.0'?>
<?define ProductName = "Font Gabka2 (SVČ Lužánky)"?>
<?define PrevProductVersion = "1.0"?> <!-- Match previous version, use "1.0.0" for new install if not known -->
<?define ProductVersion = "1.0"?> <!-- Match new version -->
<?define ProductCode = "PUT-GUID-HERE"?> <!-- Re-generate for new upgrade! (http://www.guidgen.com/) -->
<?define ProductUpgradeCode = "PUT-GUID-HERE"?> <!-- When upgrading, overwrite with previous ProductCode here. -->
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Id='*'
UpgradeCode="$(var.ProductUpgradeCode)"
Name="$(var.ProductName)"
Language='1033'
Version='$(var.ProductVersion)'
Manufacturer='SVČ Lužánky'>
<Package Id='$(var.ProductCode)'
Description='$(var.ProductName) $(var.ProductVersion)'
InstallerVersion='200'
Compressed='yes' />
<Media Id='1' Cabinet='setup.cab' EmbedCab='yes' />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="FontsFolder">
<Component Id="InstallFonts" Guid="*"> <!-- New GUID HERE FOR NEW FILE (no changes for upgrade, though) -->
<File Id="Gabka2.ttf" Source="Gabka2.ttf" TrueType="yes" KeyPath="yes" />
</Component>
</Directory>
</Directory>
<Upgrade Id="$(var.ProductUpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductVersion)"
IncludeMinimum="no"
OnlyDetect="yes"
Language="1033"
Property="NEWPRODUCTFOUND" />
<UpgradeVersion Minimum="$(var.PrevProductVersion)"
IncludeMinimum="yes"
Maximum="$(var.ProductVersion)"
IncludeMaximum="no"
Language="1033"
Property="UPGRADEFOUND" />
</Upgrade>
<Property Id="ARPSYSTEMCOMPONENT" Value="1" />
<Feature Id='InstallFeature' Title='Install Feature' Level='1'>
<ComponentRef Id='InstallFonts' />
</Feature>
<!-- Prevent downgrading -->
<CustomAction Id="PreventDowngrading" Error="Newer version already installed." />
<InstallUISequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>
</Product>
</Wix>
谢谢
PS:如何安装更多的TTF字体在一个MSI?如果我添加更多的文件,我得到的错误是这样的:
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.
PS2:我用这个项目https://github.com/pennmanor/wix-wrapper作为模板基地为我的新维克斯-MSI字体项目。
谢谢PhilDW的proble是但是,我不是WIX开发人员,而且我对XML格式和功能非常陌生,所以我不完全理解这意味着什么“不需要为降级预防定制操作或升级元素。使用majorupgrade元素“ - 如果有人可以在这里或某处发布功能性的WIX文件来创建MSI以部署字体,我将非常高兴。有一个网站看起来像这样(https://www.hass.de/) ,但它不起作用 - 源代码仅包含部分行,大部分源代码丢失:/ – crysman
我已经解决了这两个问题,稍后我会在这里报告如何,现在没时间了。 – crysman