I have a managed code custom action which uses the following code to read a custom table.
var Configfolder = session.Database.OpenView(session.Database.Tables["ProtectedConfigFolders"].SqlSelectString);
This works how ever when I try and read the directory table in the same way
var dirview = session.Database.OpenView(session.Database.Tables["Directory"].SqlSelectString);
I get
exception of type 'Microsoft.Deployment.WindowsInstaller.BadQuerySyntaxException' occurred in Microsoft.Deployment.WindowsInstaller.dll.
If your custom action is executed after CostFinalize you can reference the Directory table values by just just treating them like MSI properties (i.e. grab a directory the same way you would grab "ProductVersion" or "ProductName" in a custom action).