I take it you are unaware that the windshield and rear glass are caulked (adhesive sealed) in place?
This is a job best left for professionals to re-seal. Anything else is a band-aid. You could take off the trim and silicone around the outside of the window without removing the glass, but once again, its a temporary fix.