簡體   English   中英

Wix創建的安裝程序“在計算機上找不到任何以前安裝的兼容產品”

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

我正在為單用戶,多用戶和演示安裝開發多個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>

我在沒有upgradecode和MajorUpgrade的情況下進行了嘗試,但這沒有任何區別。

我想念什么? 有沒有辦法找出此錯誤指的是什么?

我建議跟進錯誤消息的原因。 文檔說這是CCPSearch表中某些內容的結果。 假設Windows Installer的行為並不奇怪:

  1. 使用Orca打開MSI文件,以查看CCPSearch表中是否存在某些內容,如果有,請弄清楚該文件的來源並清除它。

  2. 我假設在一個或兩個序列中都有一個CCPSearch動作,再次假設該錯誤就是它所說的那樣,因此,如果您看到它,則找出它來自何處。 我認為除非有必要,否則WiX不會插入操作(或表)。 我沒有在源中看到任何合並模塊或任何內容,但是MSI文件可能包含操作和表。

  3. 記錄詳細日志,看看發生了什么。 我希望與CCPSearch操作和表有關。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM