title: Disk caching issue with inno-setup?
body: <p>I will try to be as brief as possible without attaching all the related source files. I have tracked down the issue as much as my Pascal knowledge allows me...</p>
  
  <p>I thing I found a disk caching problem that occurs, for my case, at step <strong>ssInstall</strong>. I have an installer for an app that, if it finds an older app version installed, it will invoke an uninstallation like this:</p>
  
  <pre><code>procedure CurStepChanged(CurStep: TSetupStep);
  var
    uninstallStr: String;
    ResultCode: Integer;
  begin
    if (CurStep = ssInstall) and IsUpdatableApplicationInstalled() then
    begin
    uninstallStr := GetUninstallString();
    uninstallStr := RemoveQuotes(uninstallStr);
    Result := Exec(uninstallStr, '/SILENT /NORESTART /SUPPRESSMSGBOXES', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
    if Result and (ResultCode = 0) then
      Log('CurStepChanged = ssInstall; uninstall OK');
    //-------------
    //Sleep(30000);
    //-------------
  end;
  </code></pre>
  
  <p>Also the folders/files are defined like this:</p>
  
  <pre><code>[Dirs]
  Name: "{app}\db"; Flags: uninsalwaysuninstall
  
  [Files]
  Source: "..\bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion createallsubdirs recursesubdirs
  Source: "..\java\jre\*"; DestDir: "{app}\jre"; Flags: ignoreversion recursesubdirs createallsubdirs
  blah...
  </code></pre>
  
  <p><strong>Test case1;</strong> Normal installation: Everything goes smoothly.
  Log file part:</p>
  
  <pre><code>Starting the installation process.
  Creating directory: C:\Program Files                               &lt;---
  Creating directory: C:\Program Files\MyApp                         &lt;---
  Creating directory: C:\Program Files\MyApp\db                      &lt;---
  Creating directory: C:\Program Files\MyApp\jre                     &lt;---
  Creating directory: C:\Program Files\MyApp\jre\lib
  Creating directory: C:\Program Files\MyApp\jre\lib\applet
  Directory for uninstall files: C:\Program Files\MyApp
  Creating new uninstall log: C:\Program Files\MyApp\unins000.dat    &lt;--- !!!
  -- File entry --
  Dest filename: C:\Program Files\MyApp\unins000.exe                 &lt;--- !!!
  blah...
  </code></pre>
  
  <p><strong>Test case2;</strong> Update old version: When getting to step <strong>ssInstall</strong>, the uninstaller launches, it finishes then the installation begins.
  Log file part:</p>
  
  <pre><code>CurStepChanged = ssInstall; uninstall OK
  Starting the installation process.
  Creating directory: C:\Program Files\MyApp\jre\lib
  Creating directory: C:\Program Files\MyApp\jre\lib\applet
  Directory for uninstall files: C:\Program Files\MyApp
  Creating new uninstall log: C:\Program Files\MyApp\unins001.dat    &lt;--- !!!
  -- File entry --
  Dest filename: C:\Program Files\MyApp\unins001.exe                 &lt;--- !!!
  blah...
  </code></pre>
  
  <p>As you can see some folders do not get created and my app fails later on when it tries to write to <i>'db'</i> folder.</p>
  
  <p>If I uncomment the <strong>Sleep()</strong> command, everything runs smoothly and both the log files are identical.</p>
  
  <p>It seems the disk has enough time to flush the changes! Somehow there must be a flush() command missing in inno-setup.</p>
  
  <p>Can any of the inno-gurus comment or help somehow?
  Is there a flush() i could call, instead of the sleep()?
  Any help is appreciated. I just want to be sure before I file a bug request.</p>