Page 1 of 1

NET Framework installed

Posted: Wed Nov 04, 2015 4:10 pm
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()

Re: NET Framework installed

Posted: Wed Nov 04, 2015 4:48 pm
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

Re: NET Framework installed

Posted: Wed Nov 04, 2015 5:37 pm
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

Re: NET Framework installed

Posted: Wed Nov 04, 2015 5:39 pm
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