Wix 创建了安装程序 'Could not find any previously installed compliant products on the machine'

Wix created installer 'Could not find any previously installed compliant products on the machine'

我正在为单用户、多用户和演示安装开发多个 Wix 安装程序。单用户版本的第一个工作正常,也可以根据 UpgradeCode 升级旧的 Visual Studio 安装项目。

但我在处理其他两个问题时遇到了问题,在这两种情况下,当我双击显示 "Could not find any previously installed compliant products on the machine for installing this product" 的 msi 时。这似乎与安装程序错误 1608 有关。

它发生在我的开发机器上,也发生在我试过的另一台(清晰的)测试机器上。

我确实从单用户项目中复制了代码,但随后更改了相关名称和位置并插入了新的升级代码(或者在一种情况下,像我为单用户所做的那样,从旧安装程序中复制它版本)。

目前我的机器上确实没有要升级到的安装版本,但我知道这不是必需的,即使那里有升级代码和主要升级标签。这也意味着它要查找的注册表项不在 Windows 注册表中。

这是我通过 Visual Studio 2013 使用的代码(在 Wix 3.9 中,我也尝试了 3.10,但这没有区别):

    <?xml version="1.0" encoding="UTF-8"?>
    <?define Productname = "dealerdemo"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
    <Product Id="*" Name="$(var.Productname)" Language="1033" Version="2.1.65.0" Codepage="1252" Manufacturer="CompanyName" UpgradeCode="885e6689-9af3-45db-a241-fd35b8c60147">
    <Package InstallerVersion="200" Description="Installeer $(var.Productname)" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="Een nieuwere versie van $(var.Productname) is al geïnstalleerd." />
    <MediaTemplate EmbedCab="yes" />

    <Property Id="ARPPRODUCTICON" Value="20.ico" />

    <Feature Id="ProductFeature" Title="$(var.Productname)" Level="1">
      <ComponentGroupRef Id="Main" />
      <ComponentGroupRef Id="Documentation" />
      <ComponentRef Id="RegistryEntries" />
      <!--<ComponentRef Id="ApplicationShortcut" />-->
    </Feature>

    <Property Id="GETINSTALLFOLDER" ComplianceCheck="yes">
      <DirectorySearch Id="Search" Path="[WindowsVolume]" AssignToProperty="no">
        <DirectorySearch Id="GetFolder" Path="MU 2.0" />
      </DirectorySearch>
    </Property>

    <!-- Search for the InstallDir section in the registry and check the location still exists -->
    <Property Id="PREVIOUSINSTALLFOLDER" ComplianceCheck="no">
      <RegistrySearch Id="InstallDirSearch" Root="HKLM" Key="SOFTWARE\CompanyName\MU 2.0" Name="InstallDir" Type="raw">
        <DirectorySearch Id="Search" Path="[PREVIOUSINSTALLFOLDER]" />
      </RegistrySearch>
    </Property>

    <!-- Set default location -->
    <Property Id="INSTALLDIR" Value="C:\MU 2.0\"></Property>

    <!-- Try to find location in registry -->
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
    <CustomAction Id="SetINSTALLDIR"  Property="INSTALLDIR" Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
    <InstallExecuteSequence>
      <Custom Action="SetINSTALLDIR" After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
    </InstallExecuteSequence>
    <InstallUISequence>
      <Custom Action="SetINSTALLDIR" After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
    </InstallUISequence>

    <!-- SHOW LICENSE, INSTALL DIR AND INSTALL FILES -->
    <WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
    <WixVariable Id="WixUIBannerBmp" Value="installeruibanner.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="installeruidailog.bmp" />

    <Icon Id="20.ico" SourceFile="20.ico" />
    <UIRef Id="WixUI_InstallDir" />

    <PropertyRef Id="NETFRAMEWORK45" />
    <Condition Message="Het .NET Framework 4.5.1 is niet gevonden. Herstart de installatie nadat deze is geïnstalleerd op deze PC.">
      <![CDATA[Installed OR (NETFRAMEWORK45 >= "#378675")]]>
    </Condition>

    <Condition Message="Oudere Windows versies dan Windows Vista SP2 worden niet ondersteund voor 2.1">
      <![CDATA[Installed OR ( VersionNT > 600 or ( VersionNT = 600 and ServicePackLevel > 1 ))]]>
    </Condition>

    </Product>

    <!-- DID NOT FIND WAY NOT TO MENTION PROGRAM FILES, ALTHOUGH IT'S NEVER SUGGESTED TO THE USER -->
     <Fragment>
     <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="MU 2.0" />
        <Directory Id="MANUALS" />
      </Directory>

      <!-- Save shortcut to program menu -->
      <Directory Id="ProgramMenuFolder">
        <Directory Id="Shortcut" Name="MU 2.1"/>
      </Directory>

      <!-- Save shortcut to desktop folder -->
      <Directory Id="DesktopFolder" SourceName="Desktop" />

      <!-- Create InstallDir registry item for upgrades-->
      <Component Id="RegistryEntries" Guid="A4E4CDC6-0635-4C03-BA1E-1B3856598536">

        <RegistryKey Root="HKLM"
                     Key="SOFTWARE\CompanyName\MU 2.0"
              Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]" />
        </RegistryKey>

        <!-- Create key for writing unhandled errors to Application eventlog-->
        <RegistryKey Root="HKLM"
                     Key="SYSTEM\CurrentControlSet\services\eventlog\Application.0"
                     Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Name="eventlog" Value="" />
        </RegistryKey>

      </Component>

    </Directory>

    <SetDirectory Id="MANUALS" Value="[INSTALLDIR]\Handleidingen" />
   </Fragment>

   <!--INSTALL FILES-->
   <Fragment>
    <ComponentGroup Id="Main" Directory="INSTALLDIR">
      <Component>
        <File Source="D:\INSTALLER\MUdemo.0.exe" KeyPath="yes">
          <Shortcut Id="Shortcut" Directory="Shortcut" Name="MU 2.1" Description="MU 2.1" WorkingDirectory="INSTALLDIR" Advertise="yes" Icon ="20.ico" />
          <Shortcut Id="ApplicationDesktopShortcut" Directory="DesktopFolder" Name="MU 2.1" Description="MU 2.1" WorkingDirectory="INSTALLDIR" Advertise="yes" Icon ="20.ico" />
        </File>
        <RemoveFolder Id="Shortcut" Directory="Shortcut" On="uninstall"/>
        <RemoveFolder Id="DesktopFolder" Directory="DesktopFolder" On="uninstall"/>
      </Component>
      <Component>
        <File Source="D:\INSTALLER\MUdemo.0.exe.config"></File>
      </Component>
    </ComponentGroup>
    <ComponentGroup Id="Documentation" Directory="MANUALS">
      <Component>
        <File Source="D:\Handleidingen\activeren_administratie.pdf"></File>
      </Component>
      <Component>
        <File Source="D:\Handleidingen.0 MU\gebruikers_handleiding.pdf"></File>
      </Component>
      <Component>
        <File Source="D:\Handleidingen.0 MU\installatie_handleiding.pdf"></File>
      </Component>
     </ComponentGroup>
     </Fragment>
    </Wix>

我在没有 upgradecode 和 MajorUpgrade 的情况下尝试过,但这没有任何区别。

我错过了什么?有没有办法找出这个错误指的是什么?

我建议跟进错误消息的原因。文档说这是 CCPSearch table 中某些东西的结果。假设 Windows 安装程序的行为并不完全异常:

  1. 用 Orca 打开 MSI 文件,看看 CCPSearch table 中是否有东西,如果有,找出它的来源并删除它。

  2. 我假设在一个或两个序列中有一个 CCPSearch 操作,再次假设错误是它所说的,所以如果你看到它然后找出它来自哪里。除非必要,否则我认为 WiX 不会插入操作(或 table)。我没有在源代码中看到任何合并模块或任何内容,但 MSI 文件可能包含操作和 table.

  3. 获取详细日志,看看发生了什么。我希望与 CCPSearch 行动和 table 有关。