title: Removing file from MSI's binary table does not change MSI file size
body: <p>I tried to google my problem but without much luck.
  I'm trying to modify an MSI file through C#'s winform.
  The issue I'm having is that when I delete files (that I've added!) from the binary table, the records are gone but the MSI's file size is not reduced.</p>
  
  <p>Here is how I add new files to the binary table:</p>
  
  <pre><code>        view = database.OpenView("INSERT INTO Binary (Name,Data) VALUES ('" + fileName + "', ?)");
          record = installer.CreateRecord(1);
          record.SetStream(1, filePath);
          view.Execute(record);            
          view.Close();
          if(record != null)
              Marshal.ReleaseComObject(record);
          Marshal.FinalReleaseComObject(view);
  </code></pre>
  
  <ul>
  <li><p>A commit is happening later in the code :</p>
  
  <pre><code>database.Commit();
  Marshal.FinalReleaseComObject(database);
  Marshal.FinalReleaseComObject(installer); 
  </code></pre></li>
  </ul>
  
  <p>This is how I delete a record:</p>
  
  <pre><code>  view = database.OpenView("SELECT * FROM Binary WHERE Name = '" + binary + "'");
    view.Execute(null);
    Record record = view.Fetch();
    if (record != null &amp;&amp; record.FieldCount &gt; 0)
    {                            
        view.Modify(MsiViewModify.msiViewModifyDelete, record);              
    }            
    view.Close();
    if (record != null)
        Marshal.ReleaseComObject(record);
    Marshal.FinalReleaseComObject(view);
  </code></pre>
  
  <p>I don't think there is a problem with the deletion as files that were inserted using Orca were deleted just fine.</p>
  
  <p>When I delete (either with Orca or with my code) a record that was inserted by me using the first code block above, the record is gone but the MSI's file size is reduced just by 10-20KB (probably the record's size) even if the file was 20MB. </p>
  
  <p>So...  Where is my problem...??</p>
  
  <p>Hope I explained the situation well enough for you. </p>
  
  <p>btw, just adding that I tried inserting a photo into the binary table using the code above and extracted the file using Orca. It was fine and the photo was OK. So it does work, just wrong I guess.</p>