安装多个实例MSI时“应用转换时出错”

时间:2013-09-13 21:13:16

标签: wix windows-installer

我正在尝试使用WiX版本3.7.1224.0探索实例转换。我创建了一个测试项目(下面的源代码),我可以安装默认的ProductCode,但是当我尝试安装生成的MSI时,我收到一个错误:

msiexec /i SetupProject1.msi /l*vx install.log MSINEWINSTANCE=1 TRANSFORMS=":Alpha"
  

应用转换时出错。验证指定的转换路径是否有效

install.log似乎表明Property表中有一行“常规转换”期望查找和修改,但我不确定它可能正在寻找什么属性。我一直在阅读有关多个实例转换的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

Product.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 excerpt

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.

1 个答案:

答案 0 :(得分:0)

事实证明,转换正在设置INSTANCENAME属性(显而易见,回想起来)。该属性需要具有默认值,因此它在属性表中列出。

<Property Id="INSTANCENAME" Value="Default" />