Headliner or Glass... Which should go First?

For anyone who has done one or the other first what are your thoughts? My Duster has been apart for a Long time and while I know the headliner is trimmed BY the window seals I've never installed a headliner and seek the wisdom of the Experienced.

I'm sure they have been Both installed while the other is still there but would like to do it in the best order with the Least amount of cussing.