NSIS Installer with .NET 4.0
Asked Answered
S

2

11

Is there a standard/preferred method for automatically downloading and installing the .NET 4.0 Framework from an NSIS installer, if the machine doesn't already have it?

There are several examples for making this work on older versions of the framework, but seemingly none of them work for 4.0. Before I hack something together myself, I wanted to see if anyone here knew of something already out there.

Thank you for your time.

Sunless answered 22/8, 2010 at 17:27 Comment(1)
I misunderstood your question so have deleted my answer.Roma
M
9

What is the problem? The solution should be the same as for any other .NET version.

Something like this should work:

ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" Install
IntOp $8 $0 & 1

Result is in reg $8

Substitute Client with Full to detect the non-client version.

Mata answered 25/8, 2010 at 5:12 Comment(0)
M
7

Why not simply include the .NET 4.0 redist with your NSIS installer and execute it when you don't detect 4.0 registry entries?

If you think that 50 MB is too much to package with your installer then download it only when needed.

It would help if you listed what you've tried that has not worked. (I suspect that you've probably seen the 3rd link and the lang spec trips you up?)

Mestizo answered 25/8, 2010 at 4:42 Comment(2)
Just saw your link, still the same detection method as previous versions :)Mata
Thank you Paul, this is helpful. I think I am going to include the web installer (~860k) in my installer, and if .NET is needed, let it download the .NET components. I wish I could give both you and leppie the bounty, your posts have helped me equally.Sunless

© 2022 - 2024 — McMap. All rights reserved.