If you use managed custom action then you just assign assign the installdir new value:
But you decided not to use .NET so you will need to do this in raw MSI/WiX.
session["INSTALLDIR"] = <physical folder of parent web sire> + <service name>;