Deciphering the MSI Directory table, part 7 (directories are properties)
In my last blog entry, I wrapped up saying that we'd talk about how to make your install directory configurable this time. I'm sorry but I lied. There is an important but confusing truth that you must understand before we continue. Directories are Properties.
Some of you may have already caught on to this because the MSI SDK documentation for what I call standard directories is labeled "System Folder Properties". Also, if you at the ProgramFilesFolder directory you'll see it's actually called the "ProgramFilesFolder Property". I've avoided using the word "Property" to describe what we've known as "Directory identifier" until now to avoid confusion.
So what does it mean that Directories are really Properties?
Well, for one, it means that anywhere you can put a Property reference, you can put a Directory identifier instead. When the Windows Installer resolves a Directory identifier as a Property it gets the full path for the directory. For example you could put "[ProgramFilesFolder]" in the Value column of the Registry table and get the full path to the Program Files directory in the registry key. See the Formatted topic in the MSI SDK for more information. Also, remember from our previous examples, that all Windows Installer paths end with a backslash.
The fact that Directories are Properties also means that Type 51 CustomActions can be used to change install locations. But we'll talk more about that next time...