这应该很容易,但几个小时后我就空白了.(
我做了一个注册表搜索(实际上是两个),因为我需要检查前两个安装中的任何一个,然后将我的新文件安装到找到的先前安装的位置.
然后我需要将我的新文件安装到找到'PROD#'的'InstallLocation'.
<!— Look for the UnInstall key of the 1st possible product -->
<!— GUID = {E928E024-DEFE-41A7-8469-D338212C4943} -->
<Property Id='PROD1'>
<RegistrySearch Id='PROD_REG1'
Type='raw'
Root='HKLM'
Key='$(var.REGKEY_PROD1)'
Name='InstallLocation' />
</Property>
<!— Look for the UnInstall key of the 2nd possible product -->
<!— GUID = {A40A9018-DB9D-4588-A591-F012600C6300} -->
<Property Id='PROD2'>
<RegistrySearch Id='PROD_REG2'
Type='raw'
Root='HKLM'
Key='$(var.REGKEY_PROD2)'
Name='InstallLocation' />
</Property>
<!-- How do I set INSTALL_HERE Property to whichever ‘InstallLocation’ was found? -->
<!-- Define the …Run Code Online (Sandbox Code Playgroud) 我想做的是:
<Property Id="LICENSEKEYPATH">
REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE
<DirectorySearch Id="ProgramDataSearch" AssignToProperty="yes" Depth="4" Path="[#ProductDirInAppData]">
<FileSearch Id="LicenseFileSearch" Name="lic-conf.enp"/>
</DirectorySearch>
</Property>
Run Code Online (Sandbox Code Playgroud)
当我的应用程序被卸载时,只有这样,我是否要搜索许可证文件并获取其路径.目前,虽然代码没有给出任何错误,但即使我正在安装文件,它仍然会搜索许可证文件路径.因此,设置会延迟很长时间.更重要的是,wix设置在第一个屏幕中显示其搜索此属性的效果,然后继续其他屏幕.
那么,如何仅在卸载期间搜索文件或设置属性的值?