Proper window install includes a sturdy flashing plan to set up water
https://escatter11.fullerton.edu/nfs/show_user.php?userid=9889951
Proper window installation contains a solid flashing plan to deal with water. Correct layering directs moisture outward and protects the sheathing and framing.