NET Framework installed

Share your advanced PureBasic knowledge/code with the community.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

NET Framework installed

Post by Kwai chang caine »

Hello at all

I have need to know what NET framework is present on my PC
I have found this code
http://www.zem.fr/net-comment-trouver-l ... installes/
And thanks to a DENIS code
http://www.purebasic.fr/french/viewtopi ... 327#p11327
I have translate it for enumerate the number of version of .NET

That's works, perhaps someone have better or more reliable :wink:

Code: Select all

Procedure.s NetFrameworkPresent()

 Define PhraseKey$
  
 If RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, "Software\Microsoft\NET Framework Setup\NDP\", 0, #KEY_ENUMERATE_SUB_KEYS, @hKey) = #ERROR_SUCCESS 
   
  While Enum <> #ERROR_NO_MORE_ITEMS 

   lpcchName = 256 
   lpszName$ = Space(lpcchName)
    
   Enum = RegEnumKeyEx_(hKey, iSubkey, @lpszName$, @lpcchName, 0, 0, 0, @lpftLastWrite) 
   iSubkey + 1

   If Not FindString(PhraseKey$, lpszName$, 1) And Left(lpszName$, 1) = "v"
    PhraseKey$ + lpszName$ + #CRLF$
   EndIf
  
  Wend 
 
  RegCloseKey_(hKey) 
 
 EndIf
 
 ProcedureReturn PhraseKey$

EndProcedure 

Debug NetFrameworkPresent()
ImageThe happiness is a road...
Not a destination
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Re: NET Framework installed

Post by ElementE »

Very good!
On my 32-bit Vista computer the program instantly reported following NET versions:
  • v2.0.50727
    v3.0
    v3.5
    v4
    v4.0
Think Unicode!
User avatar
Kiffi
Addict
Addict
Posts: 1504
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: NET Framework installed

Post by Kiffi »

Hello KCC,

there are more Frameworks (see "To find .NET Framework versions by viewing the registry (.NET Framework 4.5 and later)"):

https://msdn.microsoft.com/en-us/librar ... .110).aspx

Greetings ... Peter
Hygge
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: NET Framework installed

Post by Kwai chang caine »

ElementE wrote:Very good!
On my 32-bit Vista computer the program instantly reported following NET versions:
Thanks to have testing 8)

@Kiffy

Hello KIFFI always happy to talk to you :wink:

Justely i say in the same time you write to me, i have just not understand a thing
In my list i not have v4.5 or more, and when i have try to installing the v4.5 .NET say to me they are already a better version of the v4.5 installed :shock:

So thanks to you, i see perhaps why :D
ImageThe happiness is a road...
Not a destination
Post Reply