Yes, this can be done by setting the formatted reference as the value of a a installer class parameter. Inside the custom action you can retrieve the formatted reference from the parameter.
The next question, is how to retrieve the value inside the custom action. For future readers who may read this thread, this is what I did for my C# custom action...
In the AI New Installer Class Parameter dialog I entered the following: