【发布时间】: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