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.

Here is how I add new files to the binary table:

```
        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);

```

* A commit is happening later in the code :

```
database.Commit();
Marshal.FinalReleaseComObject(database);
Marshal.FinalReleaseComObject(installer); 

```

This is how I delete a record:

```
  view = database.OpenView("SELECT * FROM Binary WHERE Name = '" + binary + "'");
  view.Execute(null);
  Record record = view.Fetch();
  if (record != null && record.FieldCount > 0)
  {                            
      view.Modify(MsiViewModify.msiViewModifyDelete, record);              
  }            
  view.Close();
  if (record != null)
      Marshal.ReleaseComObject(record);
  Marshal.FinalReleaseComObject(view);

```

I don't think there is a problem with the deletion as files that were inserted using Orca were deleted just fine.

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. 

So... Where is my problem...??

Hope I explained the situation well enough for you. 

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.