title: How to get the Windows SDK folder in MSBuild?
body: <p>What would be the way to retrieve the Windows SDK folder in an MSBuild task?</p>
  
  <p>Using the generateBootstrapper task I'm creating a bootstrapper for my setup to be able to install the pre-requisites. This task needs the path to the folder where the pre-requisite packages are located, i.e. the Windows SDK folder </p>
  
  <pre><code>"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\"
  </code></pre>
  
  <p>when using Visual Studio 2008. So far I have been using a hard-coded path but this won't work on any system. Is there a better way to get the path?</p>
  
  <p>This is my build script:</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 
           ToolsVersion="3.5"&gt;
      &lt;ItemGroup&gt;
          &lt;BootstrapperFile Include="Microsoft.Net.Framework.2.0"&gt;
              &lt;ProductName&gt;.NET Framework 2.0&lt;/ProductName&gt;
          &lt;/BootstrapperFile&gt;
          &lt;BootstrapperFile Include="Microsoft.Windows.Installer.3.1"&gt;
              &lt;ProductName&gt;Windows Installer 3.1&lt;/ProductName&gt;
          &lt;/BootstrapperFile&gt;
      &lt;/ItemGroup&gt;
  
      &lt;Target Name="Bootstrapper"&gt;
          &lt;GenerateBootstrapper ApplicationFile="mySetup.msi" 
              Culture="de-DE" 
              ApplicationName="My Application" 
              OutputPath="$(OutDir)\de-DE" 
              BootstrapperItems="@(BootstrapperFile)" 
              Path="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\" /&gt;
  
          &lt;GenerateBootstrapper ApplicationFile="mySetup.msi" 
              Culture="en-US" 
              ApplicationName="My Application" 
              OutputPath="$(OutDir)\en-US" 
              BootstrapperItems="@(BootstrapperFile)" 
              Path="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\" /&gt;
      &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>