0

我正在为我的应用程序开发一个设置,我需要为它构建一个设置。我正在使用 wix 来构建设置,并且我需要验证是否安装了 dot net 框架。这是我以前的代码

<Property Id="NETFX40CLIENTREDIST">
  <RegistrySearch
    Id="NetFx40ClientRedist"
    Root="HKLM"
    Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Client"
    Name="Version"
    Type="raw" />
</Property>
<Condition
  Message="Microsoft .Net Framework 4 Client Profile was not installed. 
 Please download and install from 
   http://www.microsoft.com/en-in/download/confirmation.aspx?id=17113 ">
      <![CDATA[Installed OR NETFX40CLIENTREDIST>="10.0.30319"]]>
    </Condition>

这种情况在 32 位机器上运行良好,而在某些 64 位机器上,即使 dot net 框架已安装它显示此验证,它也不会检测到。

仅在未安装 dot net framework 时才需要显示我的条件。我需要支持 DotNetFramework 4 及更高版本。尤其是4.6.1也必须支持。

4

1 回答 1

1

The detection mechanism has already been implemented in the WixNetFxExtension. This will give you these properties: http://wixtoolset.org/documentation/manual/v3/customactions/wixnetfxextension.html

于 2016-06-22T09:24:33.573 回答