<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Sample code to detect .NET Framework install state and service pack level</title><link>http://blogs.msdn.com/astebner/pages/9763379.aspx</link><description>Introduction Many installers and applications require that one or more versions of the .NET Framework be installed on the system in order to be able to install and function correctly. This article provides sample C++ code that can be used in a setup program</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Sample code to detect .NET Framework install state and service pack level</title><link>http://blogs.msdn.com/astebner/pages/9763379.aspx#9928111</link><pubDate>Tue, 24 Nov 2009 17:38:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9928111</guid><dc:creator>astebner</dc:creator><description>&lt;p&gt;For anyone reading this in the future, here is a link to a starting point you can use to convert this sample code to C# - &lt;a rel="nofollow" target="_new" href="http://geekswithblogs.net/lorint/archive/2006/01/30/67654.aspx"&gt;http://geekswithblogs.net/lorint/archive/2006/01/30/67654.aspx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One note of caution here - if you write this detection code in C#, then if the computer you run it on doesn't have any version of the .NET Framework installed on it, the code won't be able to run. &amp;nbsp;If you know for sure that at least one version of the .NET Framework will always be present on the computers that you run it on, it should probably be OK to write the detection code in C# though.&lt;/p&gt;
&lt;p&gt;Also, if you need to detect the .NET Framework version or service pack level within an MSI, you should not use this detection code or a custom action. &amp;nbsp;You can instead use the AppSearch, RegLocator and LaunchCondition tables. &amp;nbsp;There are built-in detection properties in WiX that you can use for this if you use WiX to create your MSI. &amp;nbsp;You can find more information about these detection properties at &lt;a rel="nofollow" target="_new" href="http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm"&gt;http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm&lt;/a&gt;.&lt;/p&gt;
</description></item></channel></rss>