【问题标题】:Wix created installer 'Could not find any previously installed compliant products on the machine'Wix 创建了安装程序“在机器上找不到任何以前安装的兼容产品”
【发布时间】:2015-10-11 06:54:28
【问题描述】:

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

但是我在使用其他两个时遇到了问题,在这两种情况下,当我双击 msi 时,它都会显示“在机器上找不到任何以前安装的兼容产品来安装此产品”。这似乎与安装程序错误 1608 有关。

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

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

确实,我的机器上目前没有安装的版本可以升级,但我知道这不是必需的,即使升级代码和majorupgrade 标签在那里。这也意味着它要查找的注册表项不在 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\2.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\2.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\2.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\2.0 MU\gebruikers_handleiding.pdf"></File>
      </Component>
      <Component>
        <File Source="D:\Handleidingen\2.0 MU\installatie_handleiding.pdf"></File>
      </Component>
     </ComponentGroup>
     </Fragment>
    </Wix>

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

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

【问题讨论】:

    标签: visual-studio-2013 wix installation


    【解决方案1】:

    我建议跟进错误消息的原因。文档说这是 CCPSearch 表中某些内容的结果。假设 Windows Installer 的行为并不完全奇怪:

    1. 使用 Orca 打开 MSI 文件,查看 CCPSearch 表中是否有内容,如果有,请找出它来自何处并删除它。

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

    3. 获取详细日志并查看发生了什么。我希望与 CCPSearch 操作和表相关。

    【讨论】:

    • 有趣的是,我在过去的 15 年里从未使用过那张桌子。我错过了什么令人兴奋的事情吗?
    • 非常感谢菲尔。通过使用 Orca 查看 msi 并查看 CCPSearch 表,我发现变量“GetFactuur2KingFolder”。这指向我磁盘上不存在的文件夹。对于单用户安装程序,它确实存在。创建文件夹后,安装程序将正确运行。非常感谢!
    • 是问题所在。通过将其更改为“否”,它开始工作。但我现在也完全删除了该块,因为它显然没有做太多。
    • @Chris - 这是某种“允许升级”机制。很久以前,我似乎记得某些版本的 Office 只有在您的系统上安装了 Microsoft Works 版本(我假设它是非 MSI)时才会安装。
    • 我从 SDK 中发现了很多东西,只是从未使用过它。我总是通过类型 19 或启动条件进行应用搜索和我自己的自定义业务规则。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-11
    • 1970-01-01
    • 1970-01-01
    • 2018-05-18
    • 2019-09-22
    • 1970-01-01
    • 2014-08-11
    相关资源
    最近更新 更多