View Full Version : Predefined Folder for CSIDL_COMMON_DOCUMENTS

06-06-2008, 04:20 PM

Something I was really hoping the RTM of IS2009 would have is still missing.

There really should be a Predefined Folder for CSIDL_COMMON_DOCUMENTS.

Currently, you have to work around this via Installscript and a custom action and to set a property and then folders to that property.

It would make things a lot simpler, especially for Basic MSI projects.

06-07-2008, 10:21 AM
As Windows Installer doesn't provide one, whatever we do would have to be a lot like the custom action scenario you describe. The only savings would be that it could be more easily included in the default template project. Perhaps you could make your own template with this already included?

06-09-2008, 12:43 PM
Michael... well making my own template would be too easy, which is why... lol.

But, your point on maybe making the default template have that value, may be valuable.

06-09-2008, 01:06 PM

Do you have any insight why Windows Installer does not provide this value? I have always wondered this too.

Like Lance above, we have created our own custom action to set this value.

06-10-2008, 01:56 PM
I don't have any official insight, but as a guess, the backwards compatibility story is complex when they add predefined directories. It's also possible they just haven't seen enough desire for it to seem worth it.

Say for instance that in MSI v.X, a directory under TARGETDIR with name CommonDocumentsFolder is just another directory, but in v.X+1 it now resolves to a useful value. People who aren't paying close attention might not realize they depend on v.X+1 in order to get their directory populated, and thus install directly to the root folder on machines running v.X or earlier.

Then if you jump the hurdle and make it work on v.X and earlier, you have to write the same code as you do now, only it's even more complex because the directory may be set legitimately. So is it worth it? It almost makes the plain custom action approach seem more solid.