title: How can I install .NET framework as a prerequisite using Inno Setup?
body: <p>I have a question similar to <a href="https://stackoverflow.com/q/4104011/850848">Inno Setup: Verify that .NET 4.0 is installed</a>, but it seems to be slightly different. </p>
  
  <pre class="lang-pascal prettyprint-override"><code>[Files]
  Source: "dependencies\dotNetFx40_Full_x86_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled
  Source: "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\MySql.Data\v4.0_6.5.4.0__c5687fc88969c44d\MySql.Data.dll"; DestDir: "{app}\lib"; StrongAssemblyName: "MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, ProcessorArchitecture=MSIL"; Flags: "gacinstall sharedfile uninsnosharedfileprompt"
  
  [Run]
  Filename: {tmp}\dotNetFx40_Full_x86_x64.exe; Description: Install Microsoft .NET Framework 4.0; Parameters: /q /norestart; Check: FrameworkIsNotInstalled
  
  [code]
  function FrameworkIsNotInstalled: Boolean;
  begin
    Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Microsoft\.NETFramework\policy\v4.0');
  end;
  </code></pre>
  
  <p>As you can see, I'm trying to register a file with the GAC. Unfortunately on some machines it's possible that the .NET framework is <em>not</em> installed. So I need to install it first. Is there anyway that I can force an installation of the .NET runtime <em>before</em> I try to register my files?</p>