title: Inno Setup - How to delete a folder (if it is empty) from code?
body: <p>I always install a program (<code>B</code> = <code>{app}</code>) inside of the <code>C:\A</code> (<code>C:\A\B</code>). I need to know how to use the <code>DelTree</code> function to delete <code>B</code> folder and <code>A</code> folder (the <code>A</code> folder only if is empty).</p>
  
  <p>This is my code to delete B folder:</p>
  
  <pre class="lang-pascal prettyprint-override"><code>DelTree(ExpandConstant('{app}'), True, True, True);
  </code></pre>
  
  <hr>
  
  <p>I need this to rollback an installation of prerequisities, when the installation fails or is cancelled. So I cannot use <code>UninstallDelete</code> or <code>InstallDelete</code> sections.</p>