【发布时间】:2021-09-28 04:18:47
【问题描述】:
如果已经安装了早期版本,我正在尝试让我的 WIX 包使用以前的安装目录。以前的版本没有为安装位置创建注册表项。因此,我尝试使用 ComponentSearch (Util Extension) 来查找主可执行文件。安装目录是包含可执行文件的目录的父目录。 ComponentSearch 给了我目录 C:\InstallDirectory\DirectoryContainingEXE。如何获取 C:\InstallDirectory?
<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Fragment>
<util:ComponentSearch Id="ExeComponentSearch" Guid="{COMPONENT GUID}" Result="directory" Variable="InstallFolder"/>
</Fragment>
</Include>
【问题讨论】: