As I recall, the headliner goes between the body and the windshield interior molding, but not under the windshield gasket.
[on edit] I just read the tech tip
HERE and it says the headliner DOES go under the lip of the windshield gasket. What do I know?

I'd assume that installing the headliner without the windshield installed and installing it with the headliner in the way would make it a PITA (more than it already is).