Inno Setup: Do not install subfolder if it exists already
<p>I am trying to package everything in <code>C:\App\Web\*</code> into an installer.</p>

<p>If the database sub-folder <code>mysql\data</code> exists, then I <strong>do not</strong> want to replace these files. </p>

<p>This is my Inno Setup script:</p>

<pre><code>[Files]
Source: "C:\App\Web\xampp-control.exe"; DestDir: "{app}"; Flags:     ignoreversion
Source: "C:\App\Web\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\App\Web\*"; DestDir: "{app}"; Excludes: "C:\App\Web\mysql\data\*"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: DirExists(ExpandConstant('{app}\mysql\data\*'))
</code></pre>

<p>The files in <code>mysql\data</code> still get replaced. </p>

<p>I want the installer to avoid overwriting the data folder if the application is already installed (i.e. performing an upgrade). </p>