Archive: checking .NET versions


checking .NET versions
Hi

I have been using the .NET script that checks for .NET installed, and it works just fine.

However as .NET 1.1 is now out - the script does not check for differnet versions :-) ... would someone mind updating the script so it can check for 1.1 as well as 1.0. Sorry its a little beyond my skills to change.

Also in case people are planning on doing this, I have found that using GACutil.exe to put .NET components into the global assembly cache works just fine in NSIS. ;-)

Thanks

DabossUK


I don't think it will be too hard to add a check for a minial version in the script. If you add and upload it here I'll update the archive page.


Hey

Sorry, but changing that code is a little over my skill level. Still do not funny understand all the functions.

However, I scrapped the .NET script (for some reason the version is NOT stored in the registry from what I can see. So I have used this method instead. Does the job so guess thats ok ;-) ?


IfFileExists $WINDIR\Microsoft.NET\Framework\v1.1.4322\*.* abort
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Service requires the Microsoft .NET Framework 1.1 to run. $\r$\nThe installer cannot find a version installed on this machine. $\r$\n Do you wish to install from the Internet ? $\r$\nIf not please install .NET Framework and rerun the installer." IDYES +1 IDNO Abort2
ExecShell open http://msdn.microsoft.com/netframewo...s/howtoget.asp
Abort


That may not work if the directory is
v1.1.4323 or something slightly different.

You should find the directory that is v1.1* using FindFirst/Next:

ClearErrors
FindFirst $R0 $R1 "$WINDIR\Microsoft.NET\Framework\v1.1*"
loop:
IfErrors error
IfFileExists "$R1\*.*" exit
ClearErrors
FindNext $R0 $R1
Goto loop
error:
MessageBox MB_OK "You do not have M$ .NET 1.1 or higher installed!"
exit:
FindClose $R0

Of course, this solution won't work once .NET 1.2 is released. :D


Can someone post the full script on how to check if 1.1 is intalled


See above.


i'm no good with coding there any change u code cut and paste me together a scrip and tell me where to stick it in the nsi file :)


Put it in a section or function where you need to know the version.


how?


I have no idea what you mean. This is normal NSIS script code. If you don't know the script langauge you'll have to learn it first.