Wix创建了安装程序'无法在计算机上找到任何以前安装的兼容产品'

时间:2015-07-21 17:13:35

标签: visual-studio-2013 wix installer

我正在为多用户,多用户和演示安装工作多个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的情况下尝试过,但这并没有任何区别。

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

1 个答案:

答案 0 :(得分:0)

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

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

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

  3. 详细记录日志,看看发生了什么。我希望与CCPSearch行动和表格相关。