After installing 4.8, your app that required v4.0.30319 will automatically run under 4.8 via in-place update compatibility.
For your convenience, here are the free download links: net framework 4.0 v 30319 windows 7 64 bit free download
Note: Microsoft has removed the direct download link for the original 4.0 standalone installer from their main catalog because it is outdated. They redirect users to 4.8 (see above). After installing 4