You should be able to create a public property within your MSI using AdvancedInstaller (Install Parameters page, Properties). Note that public properties must be ALL_CAPS while private properties can contain lower case letters.
Refer to the public property in your custom action(s) to retrieve the value of the property at runtime.
When invoking an msi from a command line you can set the value of a public property like this:
msiexec.exe /i "C:\MyAwesomeApp.msi" AWESOME_PROP="myValue"
From your description, it appears you are compiling your MSI into a bootstrapper. My understanding is that the bootstrapper exe will pass the arguments for a public property into the MSI on your behalf, ala:
C:\MyAwesomeApp.exe /i AWESOME_PROP="myValue"
I've found that it takes quite a bit of trial and error to get your custom actions to refer to the contents of a public property and to function the way that you want them to, but this is probably because I am not great at authoring MSI's. In my case, I've found building small, test installers as a proof of concept more or less helps me to debug what I'm trying to do. Once I get it right, I add that piece to the actual AIP file that I am working with and test there as well. Rinse and repeat as necessary!