You can use
dotNetInstaller, see:
GitHub - dblock/dotnetinstaller: A widely used, general-purpose setup bootstrapper for MS Windows.[
^]
I would advise however to use the webinstaller if possible, as this intelligently detects what components are not installed and installs them.
Here is another interesting '
InnoSetup Dependency Installer'
GitHub - stfx/innodependencyinstaller: Modular InnoSetup Dependency Installer[
^]
When you look in the InnoSetup code, you can find the download links like this one for .NET framework 4:
dotnetfx40full_url = 'http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe';
Some newer Windows versions already have .NET framework versions installed, but sometimes it must be 'activated' under program features, this might be related to the message that you got.