我正在尝试使用 WiX 版本 3.7.1224.0 探索实例转换。我创建了一个测试项目(下面的源代码),我可以正确安装默认的 ProductCode,但是当我尝试安装生成的 MSI 时,出现错误:
msiexec /i SetupProject1.msi /l*vx install.log MSINEWINSTANCE=1 TRANSFORMS=":Alpha"
应用转换时出错。验证指定的转换路径是否有效
install.log 似乎表明“常规转换”希望找到并修改属性表中的一行,但我不确定它可能正在寻找什么属性。我一直在阅读有关多实例转换的 MSDN 文档以及描述其<InstanceTransforms>
工作原理的 WiX 文档和博客文章,但我不知道它在寻找什么。
汇编
"%WIX%\bin\candle.exe" -out obj\Debug\ -arch x86 Product.wxs
"%WIX%\bin\Light.exe" -out SetupProject1.msi -cultures:null obj\Debug\Product.wixobj
产品.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0"
Manufacturer="ABC"
UpgradeCode="ce6fdce7-5c23-4379-af59-f70c520ad1b6">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Property Id="INSTANCENAME" Secure="yes" />
<InstanceTransforms Property="INSTANCENAME">
<Instance Id="Alpha" ProductCode="{16756BA2-9FAC-4BA4-9FFD-FC2F06B1315E}" ProductName="SetupProject1 Alpha"/>
<Instance Id="Bravo" ProductCode="{D32D3643-5A46-421E-9216-1B1C9037DC37}" ProductName="SetupProject1 Bravo"/>
<Instance Id="Charlie" ProductCode="{ED9BC4F0-8CB8-4813-B677-F0E4A52D1890}" ProductName="SetupProject1 Charlie"/>
</InstanceTransforms>
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentRef Id="FileComponent" />
</Feature>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1">
<Component Id="FileComponent" Guid="*">
<File Source="File1.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
</Product>
</Wix>
install.log 摘录
MSI (c) (E4:8C) [13:49:28:343]: TRANSFORM: Applying regular transform to database.
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: _Tables 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: _Columns 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: _Validation 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: AdminExecuteSequence 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: AdminUISequence 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: AdvtExecuteSequence 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: Component 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: Directory 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: Feature 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: FeatureComponents 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: File 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: InstallExecuteSequence 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: InstallUISequence 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: LaunchCondition 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2262 2: Media 3: -2147287038
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 2254 2: 3: Property
DEBUG: Error 2254: Database: Transform: Cannot update row that doesn't exist. Table: Property
1: 2254 2: 3: Property
Error applying transforms. Verify that the specified transform paths are valid.
Alpha
MSI (c) (E4:8C) [13:49:28:343]: Note: 1: 1708
MSI (c) (E4:8C) [13:49:28:344]: Product: SetupProject1 Alpha -- Installation failed.
MSI (c) (E4:8C) [13:49:28:344]: Windows Installer installed the product. Product Name: SetupProject1 Alpha. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: ABC. Installation success or error status: 1624.