title: Inno Setup Automatic Setup update
body: <p>I'm trying to create a setup using Inno Setup which should autoupdate itself if there is a newer version of the installer available.
  For the download part I want to use the Inno Setup plugin "Inno Download Plugin v1.2" from "Mitrich Software"</p>
  
  <p><strong>update:</strong>
  this is the version check I'm currently using, it works good but has a slight delay when I run the setup</p>
  
  <pre class="lang-pascal prettyprint-override"><code>function DownloadFile(const AURL: string; var AResponse: string): Boolean;
  var
    WinHttpRequest: Variant;
  begin
    Result := True;
    try
      WinHttpRequest := CreateOleObject('WinHttp.WinHttpRequest.5.1');
      WinHttpRequest.Open('GET', AURL, False);
      WinHttpRequest.Send;
      AResponse := WinHttpRequest.ResponseText;
    except
      Result := False;
      AResponse := GetExceptionMessage;
    end;
  end;
  
  procedure InitializeWizard;
  var
    response: string;
  begin
    if DownloadFile('{#MyAppVersionFile}', response) then
    begin
      if CompareStr(response,'{#MyAppVersion}') &gt; 0 then
      begin
        MsgBox('{#MyAppName} v'+ response +' is available!' #13#10 'Please download the latest version!', mbInformation, MB_OK)
      end;
    end else
    begin
      MsgBox('Could not perform version check! Are you connected to the internet?', mbInformation, MB_OK)
    end;
  end;
  </code></pre>