Another approach for what you need is to use a search to retrieve the registry value. The property of the search can then be used by a Property set with formatted custom action to set "APPDIR". This custom action can use the search property in its condition to run only if the search finds something.
FOLLOW US
Get the latest news in Application Packaging