![]() |
|
[AutoIt]Getting installed .NET framework versions - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Coding (https://sinister.li/Forum-Coding--71) +--- Thread: [AutoIt]Getting installed .NET framework versions (/Thread-AutoIt-Getting-installed-NET-framework-versions) |
[AutoIt]Getting installed .NET framework versions - 1234hotmaster - 11-26-2011 Required Code: #include <File.au3>
#include <Array.au3>Function Code: Func GetInstalledDotNetVersions()
;By 1234hotmaster
$dotnet = _FileListToArray(@WindowsDir & "\Microsoft.NET\Framework\","*",2)
_ArrayDelete($dotnet,0)
If @error Then Return
Return $dotnet
EndFuncI know its VERY simple but it might be interesting for some people ![]() This function returns an array with all versions of .NET installed. RE: [AutoIt]Getting instlled .NET framework versions - ArkPhaze - 11-26-2011 Nice, I actually wrote a vbs script for this too. I might as well post it here since there's no where else on the forum for it, and it relates to the same idea as this script you have. Code: Dim Action_ :Set Action_ = CreateObject("Wscript.Shell")
Dim Obj_, Ver, Respond
Dim Regstry :Regstry = Array( _
"1 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\1.0.3705\Version", _
"1.1 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\1.1.4322\Version", _
"2 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\Version", _
"3 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Version", _
"3.5 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\Version", _
"4 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Version")
On Error Resume Next
For Each Obj_ In Regstry
Ver = Split(Obj_," - ")
If IsNull(Action_.RegRead(Ver(1))) Then
Respond = Respond & "Not Installed: " & Ver(0) & vbCrLf
Else
Respond = Respond & "Currently Installed: " & Ver(0) & " - " & "[" & Action_.RegRead(Ver(1)) & "]" & vbCrLf
End If
Next
MsgBox Respond, 64,".Net Framework Information"4 is a bit iffy though, some people seem to have it shown in a different place in the registry for some reason. Maybe the difference between getting it through a windows update or installing it manually? not sure yet. RE: [AutoIt]Getting installed .NET framework versions - 1234hotmaster - 11-26-2011 cool! but the script i made is even for future frameworks... Your code checks for hardcoded registry values but mine gets the folders in the Microsoft.NET/Framework ![]() btw i think you can post it in [link=http://www.hackcommunity.com/Forum-Batch-and-Shell-Scripting]This[/link] and i think it would be the best of all the threads in that section because all of them are fork bombs with the threads author's labeling them as "Viruses"
RE: [AutoIt]Getting installed .NET framework versions - ArkPhaze - 11-26-2011 True, I could change it around to work the way yours does, but any missing frameworks I wouldn't be able to show. I might anticipate a framework 5.5, and they come out with a 5.1 or 5.2 if I wanted to have placeholders for them like my current script has, and then it wouldn't work. But obviously if you use your script... Whatever it doesn't return, means you don't have that framework, so I guess it's good enough lol |