Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 16th December 2010, 02:23   #1
dgrinberg
Junior Member
 
Join Date: Aug 2009
Posts: 8
DotNetVer.nsh - another way of checking MS.Net version

Hi all,

I know that there are a couple of methods in the wiki for determining the existence and version of Microsoft.Net, but not one of them covered everything I needed and I found them a little messy.

I have created a header file, for purely determining the existence and version of dotNet. I liked the cleanliness of the WinVer header, and decided to base DotNetVer off that.
Thanks to a little help from the community, it checks for DotNet 1.0 to 4.0, their service packs and types of installation.

Thus DotNetVer.nsh is a LogicLib extension for checking Microsoft .NET Framework versions and service packs.

"HasDotNet<version>" checks if the specific version of .NET framework is installed.

<version> can be replaced with the following values:

1.0
1.1
2.0
3.0
3.5
4.0

"AtLeastDotNetServicePack" checks if the .NET framework has a service pack version at least as specified.
"IsDotNetServicePack" checks if the .NET framework has a service pack version exactly as specified.
"HasDotNetClientProfile" checks if the .NET framework is a client profiled install.
"HasDotNetFullProfile" checks if the .NET framework is a full install.


Usage examples:

${If} ${HasDotNet4.0}
DetailPrint "Microsoft .NET Framework 4.0 installed."
${If} ${DOTNETVER_4_0} AtLeastDotNetServicePack 1
DetailPrint "Microsoft .NET Framework 4.0 is at least SP1."
${Else}
DetailPrint "Microsoft .NET Framework 4.0 SP1 not installed."
${EndIf}
${If} ${DOTNETVER_4_0} HasDotNetClientProfile 1
DetailPrint "Microsoft .NET Framework 4.0 (Client Profile) available."
${EndIf}
${If} ${DOTNETVER_4_0} HasDotNetFullProfile 1
DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) available."
${EndIf}
${If} ${DOTNETVER_4_0} HasDotNetFullProfile 0
DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) not available."
${EndIf}
${EndIf}


Code: Download from GITHUB https://github.com/dgrinberg/NSIS_headers
Hompage: http://ontheperiphery.veraida.com/


Please feel free to use and modify as you see fit. If you find any issues, let me know and I will have a look - alternatively you can fork it on GITHUB and then push any changes back to me.

Thanks all

David Grinberg
dgrinberg is offline   Reply With Quote
Old 16th December 2010, 18:19   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,302
Nice work. It would be helpful if you could upload to the NSIS Wiki.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 16th December 2010, 20:01   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,894
Thanks for the work, I'm sure lots of people will be helped by this. I didn't look in detail at your macro, but I'd suggest to use the same format for the ${Has} defines and the more elaborate ${VER} defines. So if you have ${HasDotNet4.0}, it may be better if you'd use ${DotNetVer4.0} instead of ${DOTNETVER_4_0}.
MSG is offline   Reply With Quote
Old 8th May 2011, 12:50   #4
tossnet
Junior Member
 
tossnet's Avatar
 
Join Date: Jan 2011
Location: LENS - FRANCE
Posts: 23
nice job !
If framework (4) was not install
Have you the code to download it and install it ?
thanks
tossnet is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump