title: Verify if is installed, if yes then ignore some files
body: <p>I need ignore some files ("<em>.sdf" and "</em>.config") only when I'm doing a update on a installed application.</p>
  
  <p>I'm getting the files recursively:</p>
  
  <pre><code>[Files]
  Source: "..\..\bin\Release\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
  Source: "..\..\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt"
  </code></pre>
  
  <p>Exist some way?</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Answer 1</strong></p>
  
  <p>Using <strong>onlyifdestfileexists</strong> and <strong>onlyifdoesntexist</strong>:</p>
  
  <p>If the files don't exist (<strong>onlyifdoesntexist</strong>), copy all you want on first installation.</p>
  
  <p>If the files exist (<strong>onlyifdestfileexists</strong>), add in Excludes those extensions that you don't want to update.</p>
  
  <pre><code>Source: "..\..\bin\Release\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
  Source: "..\..\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt"
  Source: "..\..\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion onlyifdestfileexists recursesubdirs createallsubdirs; Excludes: "*.key, *.udb, *.~db, *.crt, *.sdf, *.config"
  </code></pre>
  
  <p><strong>Answer 2 (It was not fully tested)</strong></p>
  
  <p>Using function to verify the existence of application folder.</p>
  
  <pre><code>[Files]
  Source: "..\..\bin\Release\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
  Source: "..\..\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt";  Check: not IsInstalled
  Source: "..\..\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt, *.sdf, *.config";  Check: IsInstalled
  
  [code]
  function IsInstalled: Boolean;
  begin
    if DirExists(ExpandConstant('{app}\')) then 
    begin
      Result := True;
    end else
      Result := False;
  end;
  </code></pre>