the gasket is actually pressed on from the underside of the panel. The gasket has metal reinforcements in the rubber, which sort of clap to the edge of the panel, for lack of a more technical way to describe it. There may be a slight amount of glue in places. The last time I bought a sunroof gasket was for my 85 745i (greymarket), which has the same sunroof as the e23 7 series, and it was quite expensive, like $120. Hope it's not still like that. I need to order one for my 750 as we speak!
1991 535i 176k (under serious surgery: repaint, interior swap, manual conversion, etc.)
1993 750iL 132k