title: How to write launch condition for MVC3 in WIX?
body: <p>I have WIX deployment project in VS2010. My application needs MVC 3.0 installed.
  The question is <strong>how to create launch condition in installer so that it check whether MVC3 is present on server?</strong></p>
  
  <p>This looks a simple question, but all ways to do this that I know, have problems:</p>
  
  <p><strong>1) Using standard property to check application installation</strong> (al shown in <a href="http://weblogs.asp.net/jacqueseloff/archive/2009/04/17/detecting-asp-net-mvc-1-0-using-wix.aspx" rel="nofollow">http://weblogs.asp.net/jacqueseloff/archive/2009/04/17/detecting-asp-net-mvc-1-0-using-wix.aspx</a>):</p>
  
  <pre><code>&lt;Condition Message='ASP.NET MVC 3.0 is required to proceed with the installation.'&gt;Installed OR ASP_NET_MVC_3_0&lt;/Condition&gt;
  </code></pre>
  
  <p>The problem that it always evaluates to false. Maybe there is no such property "ASP_NET_MVC_3_0". 
  More to say it doesn't even work in example with MVC1.0 checking.</p>
  
  <p><strong>2) Manual RegistrySearch WIX condition.</strong>
  The problem here is because I haven't registry node 
  <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\ASP.NET MVC 3</strong>
  <em>This is the second question: Why is it missed??</em> I definitely have MVC 3 installed. And Mvc 1.0 and 2.0 before that, but there isn't any MVC node under ASP.NET branch (only 2.0.50727.0 and 4.0.30319.0 subkeys).</p>
  
  <p><strong>3) FileSearch to find MVC dll.</strong></p>
  
  <pre><code>   &lt;Condition Message='ASP.NET MVC 3.0 is required to proceed with the installation.'&gt;
       Installed OR ASP_NET_MVC_3_0_DLL
     &lt;/Condition&gt;
  
     &lt;Property Id='ASP_NET_MVC_3_0_DLL'&gt;
       &lt;DirectorySearch Id='MVC_DLL_DIR' Path='[ProgramFilesFolder]\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies'&gt;
         &lt;FileSearch Id='MVC_DLL_FILE' Name='System.Web.Mvc.dll' MinVersion='3.0.20105.0'/&gt;
       &lt;/DirectorySearch&gt;
     &lt;/Property&gt;
  </code></pre>
  
  <p>But it is not guaranteed that MVC locates in Program files - it could be installed somewhere else.</p>
  
  <p>I think the best answer would be why MVC installation didn't make registry entry and how to prevent situation on server. But any other solutions to main problem (launch condition) would be helpful.</p>
  
  <p>PS: My OS is Windows 7.</p>