title: C++ automatically update to new version
body: <p>I've been searching for a good solution for 3 days now, but I haven't been able to find any so far. My situation is:</p>
  
  <p>A client has application installed (C++, console Application). The application on start-up will check it's version number with the server and get back or it is up-to-date or that it should download a new version.</p>
  
  <p>If it has to download the new version, I would like to download the new script with Curl to the name say: <strong>Application2.exe</strong></p>
  
  <p>However, I want it to replace the old <strong>Application.exe</strong> which triggered the download of the new version.</p>
  
  <p>My solution was: <strong>Application.exe</strong> downloads <strong>Application2.exe</strong>. When downloaded, it should trigger <strong>Updater.exe</strong> which sleeps for let's say 5 seconds. Within these 5 seconds (or whatever timespan which suites best). Within these 5 seconds, <strong>Application.exe</strong> has time to shutdown and after 5 seconds the <strong>Updater.exe</strong> replaces <strong>Application.exe</strong> with <strong>Application2.exe</strong>.</p>
  
  <p>Now the update is finished and the client has the newest version installed.</p>
  
  <p>Is this solution possible regarding system locking files, etc?</p>