0

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.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139

1 Answers1

0

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).

jbudreau
  • 1,287
  • 1
  • 10
  • 22
  • I ended up doing that as I had to finish the product. But I really wanted to read the table to get the parent directory in the end I just used the Directory.GetParent method however found it odd that I couldn't read that table and wondered if maybe it was a bug in DTF as i could also read the file table and component table in the same way with no problems. However I could find no other reference to this problem. I will wait and if no one comes up with the answer by tomorrow I will mark your answer. Although it doesn't answer my question is was the solution i used and is technically correct. – Craig Reeves Mar 30 '15 at 16:08