title: Restart Delphi Application Programmatically
body: <p>It should not be possible to run multiple instances of my application. Therefore the project source contains:</p>
  
  <pre><code>CreateMutex (nil, False, PChar (ID));
  if (GetLastError = ERROR_ALREADY_EXISTS) then
    Halt;
  </code></pre>
  
  <p>Now I want to restart my application programmatically. The usual way would be:</p>
  
  <pre><code>AppName := PChar(Application.ExeName) ;
  ShellExecute(Handle,'open', AppName, nil, nil, SW_SHOWNORMAL) ;
  Application.Terminate;
  </code></pre>
  
  <p>But this won't work in my case because of the mutex. Even if I release the mutex before starting the second instace it won't work because shutdown takes some time and two instance cannot run in parallel (because of common resources and other effects).</p>
  
  <p>Is there a way to restart an application with such characteristics? (If possible without an additional executable)</p>
  
  <p>Thanks in advance.</p>