|Id||String||Primary key used to identify this particular entry. If this is not specified, a stable identifier will be generated at compile time based on the other attributes.|
|On||Enumeration|| This value determines when the folder may be removed. This attribute's value must be one of the following:
|Property||String||The id of a property that resolves to the full path of the source directory. The property does not have to exist in the installer database at creation time; it could be created at installation time by a custom action, on the command line, etc. The property value can contain environment variables surrounded by percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before being evaluated for a full path.|
The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's File Costing, the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't create properties for the Directory hierarchy in your package until later, in the CostFinalize action.
An easy workaround for a typical use case of removing a folder during uninstall is to write the directory path to the registry and to load it during uninstall. See The WiX toolset's "Remember Property" pattern for an example.
If you use custom actions to set properties, ensure that they are scheduled before the WixRemoveFoldersEx custom action.