NSIS: Find and download .Net Version
Asked Answered
R

2

5

How can I get the version of .NET with NSIS? And if I don't have the necessary version, it redirects me to a site to download it.

I've found some solutions to this, but they usually have some hard coded stuff (e.g. dozens of specific links).

Is there some good solution for this?

Thank you

note: I dont want to use windows installer/clickonce.

Runesmith answered 14/3, 2009 at 18:31 Comment(0)
W
3

Take a look here. I believe I've changed some things from the NSIS forums, but this works quite well

http://stochfit.svn.sourceforge.net/viewvc/stochfit/trunk/StochFitMain/Installer.nsi?revision=108&view=markup

Weighin answered 14/3, 2009 at 18:48 Comment(1)
Thanks for sharing. Saved me a lot of trouble and exposed me to some nice NSIS usage patterns. :)Rigorous
M
5

There is no singular version of .NET. You could have 2.0 installed but not 1.1, or vice versa; you could have 3.5 installed which would include 2.0 and 3.0; etc. So you can't, in that sense, check for the version. Instead, you should probably check whether the particular version you need exists.

  • The NSIS site has a script for checking the registry for all installed versions, then the file system for whether an mscorlib.dll exists for each of them.
  • A number of alternatives can be found here.
  • You could use tools like this one to detect the available versions.
Morvin answered 14/3, 2009 at 18:40 Comment(1)
Thanks for the answer. I know there is no single version of .NET, what I needed to know is a specific one.Runesmith
W
3

Take a look here. I believe I've changed some things from the NSIS forums, but this works quite well

http://stochfit.svn.sourceforge.net/viewvc/stochfit/trunk/StochFitMain/Installer.nsi?revision=108&view=markup

Weighin answered 14/3, 2009 at 18:48 Comment(1)
Thanks for sharing. Saved me a lot of trouble and exposed me to some nice NSIS usage patterns. :)Rigorous

© 2022 - 2024 — McMap. All rights reserved.