为什么我的 Wix 属性没有被评估? [英] Why isn't my Wix Property being evaluated?

查看:21
本文介绍了为什么我的 Wix 属性没有被评估?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试模拟 VS.net 安装 MSI 的 InstallURL 属性......我已经到了 WIX MSI 将打开浏览器到我希望它去的下载页面的地方.我认为事情进展顺利,因为在我的测试机器上,当我没有安装 MSXML6 组件时打开了网页.然而,当我发现即使我确实安装了该组件,网页也能打开时,事情就开始走下坡路了.

I'm trying to simulate the InstallURL property of a VS.net install MSI... I've got to the ponit where the WIX MSI will open a browser to the download page that I want it to go to. I thought things were going great because on my test machine, the web page opened when I didn't have the MSXML6 component installed. However things went downhill when I discovered that the web page opened even when I DID have the component installed.

我正在使用带有 RegistrySearch 的属性搜索 MSXML6 组件.但是,据我所知,注册表值甚至没有被评估,因此它总是"看起来像是没有安装.

I'm searching for the MSXML6 component using a Property w/ a RegistrySearch. However, as best as I can tell, the registry value isn't even being evaluated, and thus it "always" looks like it isn't installed.

这是我的 WXS 的相关部分:

Here's the relevant portion of my WXS:

    <Property Id="MSXML6">
        <RegistrySearch Id="MSXML6Search" Root="HKCR" Key="Msxml2.DOMDocument.6.0" Type="raw" />
    </Property>
    <Property Id="TEST">
        <RegistrySearch Id="TESTSearch" Root="HKLM" Type="raw" Name="Version" Key="SOFTWARE\Microsoft\DirectX" />
    </Property>
    <Property Id="cmd.exe" Value="cmd.exe" />
    <CustomAction Id="OpenMSXML6Download" Property="cmd.exe" ExeCommand="/c start http://www.microsoft.com/downloads/details.aspx?FamilyID=993c0bcf-3bcf-4009-be21-27e85e1857b1" Execute="immediate" Return="check" />
    <CustomAction Id="OpenMSXML6DownloadError" Error="This component requires MSXML6. =[MSXML6]=[cmd.exe]=[TEST]=  A web browser has been opened to the download page.  Please install MSXML6 and then re-install the connector." />

    <!-- installation execution sequence -->
    <InstallExecuteSequence>
        <!-- wires the error dialog to the downgrade event -->
        <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>

        <!-- execution to delete old install info after upgrade-->
        <RemoveExistingProducts After="InstallValidate" />

        <!-- Forces MSXML6 to be pre-installed -->
        <!-- <Custom Action="OpenMSXML6Download" Before="FindRelatedProducts">NOT MSXML6</Custom> -->
        <Custom Action="OpenMSXML6Download" Before="FindRelatedProducts">NOT MSXML6</Custom>
        <Custom Action="OpenMSXML6DownloadError" After="OpenMSXML6Download">NOT MSXML6</Custom>
    </InstallExecuteSequence>

    <!-- ui information for the custom actions above. -->
    <InstallUISequence>
        <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
        <Custom Action="OpenMSXML6Download" Before="FindRelatedProducts">NOT MSXML6</Custom>
        <Custom Action="OpenMSXML6DownloadError" After="OpenMSXML6Download">NOT MSXML6</Custom>
    </InstallUISequence>

如果没有定义 MSXML6,它会打开网页,然后打印自定义错误消息.请注意,我正在尝试在错误消息中打印属性的值(我不确定这是否有效,但似乎有效.)我看到的文本说此组件需要 MSXML6.==[cmd.exe]==..." 所以它打印的是 'cmd.exe' 属性的值,而不是其他两个...也许是因为我明确定义了属性,我不确定..无论如何,我还运行了 MSI 并进行了调试,在日志文件中,我完全没有看到对 MSXML6 或 TEST 属性的任何引用.我已经确认确实设置了注册表值,尽管我不是 100% 确定如何处理 Msxml2 注册表项,因为它没有任何实际值,只有默认值.(我假设去掉 'Name' 参数是处理这个问题的正确方法.)

What this does is if MSXML6 isn't defined then it opens the web page and then prints the custom error message. Note that I'm trying to print the value of the property in the error message (I'm not sure if this is valid or not, but it seems to be.) The text that I see says "This component requires MSXML6. ==[cmd.exe]==..." so it is printing the value of the 'cmd.exe' property but not the other two... maybe that's because I define the property explicitly, I'm not sure... Anyway, I also ran the MSI with debugging on, and in the log file, I see absolutely no reference at all to the MSXML6 or the TEST properties ever being set. I've confirmed that the registry values are indeed set, although I'm not 100% sure how to handle the Msxml2 registry key, since it doesn't have any real values, only a default value. (I'm assuming that leaving off the 'Name' parameter is the right way to handle this.)

帮助??

推荐答案

我设法解决了这个问题……这是一个非常简单的答案.基本问题是自定义操作在 AppSearch 之前执行,这是评估 RegistrySearch 属性的地方.请参阅我的博客文章 CTICcoder 了解详情.

I managed to figure this one out... it was quite a simple answer. Basic issue was that the Custom Actions were executing before AppSearch, which is where the RegistrySearch properties get evaluated. See my blog post at CTICoder for details.

这篇关于为什么我的 Wix 属性没有被评估?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆