【发布时间】:2015-06-15 08:11:23
【问题描述】:
似乎无论我做什么,我在 WIX 中的产品中设置的任何条件都会阻止我的安装运行。下面我放了一些简单的代码来检查程序文件目录是否存在,如果存在,运行安装程序。我收到一条消息“找不到程序文件文件夹”。指示条件返回假。我在这里错过了什么?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="Toshiba" UpgradeCode="bb557911-769b-4a30-8461-3ad860ddc10e">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Property Id="PFFOLDER" >
<DirectorySearch Id="SystemFolderDriverVersion" Path="[ProgramFilesFolder]">
</DirectorySearch>
</Property>
<Condition Message="Program files folder not found.">
<![CDATA[PFFOLDER]]>
</Condition>
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
【问题讨论】:
-
没有人找到解决办法?
标签: wix conditional-statements