This may help: sample "<WixSharp>\Wix# Samples\InstallDir" shows how to overwrite the default installdir. In the sample it is set from the Install_CustomDirectory.cmd batch file but you can do the same from your custom action.
But the easiest way is to modify the InstallDir dialog to implement your "path generation" instead of going with the custom action.
But the easiest way is to modify the InstallDir dialog to implement your "path generation" instead of going with the custom action.