Jump to content

dotNet version information from registry


SmOke_N
 Share

Recommended Posts

  • Moderators

I needed something to use quickly to determine the version of .Net running on the client pc.

My older method of using the navigator.userAgent string from a shell object won't work anymore with the newer versions of IE installed on the clients machines :( so, 20 lines of quick code needed to be revised into something that would.

Utilizing the information provided here: http://support.microsoft.com/kb/318785/en-us , you have the dotNetRegVersions.au3 attached below.

One thing I could not do was the Win8 - 4.5 version, no test environment for that.

So, those of you that would like to make it better, add to, whatever, feel free... As usual, no time taken to do headers, some day maybe ( or someone else can add them ), pretty simple calls and examples should explain it all.

Example:

#include "dotNetRegVersions.au3"
#include <Array.au3>

MsgBox(64 + 262144, "Example", ".Net exists = " & _dotNet_reg_Exists() & @CRLF)


MsgBox(64 + 262144, "Example", "Version 1.1 or greater exists = " & (_dotNet_reg_VersionIsAtLeast("1.1")))

MsgBox(64 + 262144, "Example", "Version 1.1 exists = " & (_dotNet_reg_VersionExists("1.1")))
MsgBox(64 + 262144, "Example", "Version 2.0 exists = " & (_dotNet_reg_VersionExists("2.0")))

Global $ga_all = _dotNet_reg_VersionAll()
_ArrayDisplay($ga_all, "All Versions")

Global $ga_latest = _dotNet_reg_VersionLatest()
_ArrayDisplay($ga_latest, "Latest")

Changed: Most of the sub-funcs to 1 func/switch statement. Added AdmiralAlkex 4.5 msdn find ( Thanks )

dotNetRegVersions.au3

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Neat, thanks for that. That covers a part sure, but not all that it does and or what I needed.

I could have broke it up into 1 func, and still might, but I was in a hurry and copy and paste was more appealing at the time :) .

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

One thing I could not do was the Win8 - 4.5 version, no test environment for that.

According to THIS article you should be looking at Release to see if 4.5 is installed. I can confirm that it shows 378389 om Win8. Win7/.net4 doesn't have that value.

Screenshot:

https://dl.dropbox.com/u/18344147/Mixed%20images/dotNet%20versions.png

Hello,

you can find all version in only one funstion :

That doesn't differentiate between v4 and v4.5
Link to comment
Share on other sites

  • Moderators

@AdmiralAlkex, thanks for that.

I made changes for that as well as condensed the helper funcs, new include uploaded above.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Tested and it worked, plus I learned what I don't have on my system of .Net.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • Moderators

Fixed 1.0 verification issue, added headers/change history log... see first post.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...