Jump to content

Recommended Posts

Posted

This UDF can be used to detect the AutoIt-Version and UDF-Version of a UDF (if it is defined properly after the UDF standard).
The version can also be stored in the current script as global constants.

Functions:

; #CURRENT# =====================================================================================================================
; __UVD_SaveVersionToScript
; __UVD_VersionToString
; __UVD_FileGetVersion
; __UVD_GetVersion
; ===============================================================================================================================

Example:

#cs ----------------------------------------------------------------------------

     AutoIt Version: 3.3.18.0
     Author:         Kanashius

     Script Function:
        UDF Version Detection example.

#ce ----------------------------------------------------------------------------

#include <File.au3>
#include "UDFVersionDetection.au3"

; these variables are automatically generated and updated, when the script is called
; (and the UDFs are in the right location, maybe switch these with different ones)
; see __UVD_GetVersion documentation for more information on the structure
Global Const $__Version_UDF_TreeListExplorer = [["3.3.18.1", 3, 3, 18, 1],["2.13", 2, 13]]
Global Const $__Version_UDF_IPC = [["3.3.18.1", 3, 3, 18, 1],["1.0.0", 1, 0, 0]]

If Not @Compiled Then ; only do this, if the script is executed as .au3
    Local $arFiles = ["..\AutoItIPC\IPC.au3", "..\AutoItTreeListExplorer\TreeListExplorer.au3"]
    For $i=0 to UBound($arFiles)-1 Step 1
        ConsoleWrite(__UVD_VersionToString(__UVD_FileGetVersion($arFiles[$i]))&@crlf)
        __UVD_SaveVersionToScript($arFiles[$i])
    Next

    Local $sAutoItIncludeFolder = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)-1)&"\"&"Include"
    Local $arFiles = _FileListToArray($sAutoItIncludeFolder)
    For $i = 1 to UBound($arFiles)-1 Step 1
        ConsoleWrite(__UVD_VersionToString(__UVD_FileGetVersion($sAutoItIncludeFolder&"\"&$arFiles[$i]))&" >> "&$arFiles[$i]&@crlf)
    Next
EndIf

Changelog:

Version 1.0.0
- release of the first version

 

I hope you find this UDF useful and please leave a comment, if you have any suggestions to make it better or if you found any bugs.

Thank you to everyone who helps to improve the UDF :)

UDFVersionDetection.au3 UDFVersionDetection-Example.au3

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
×
×
  • Create New...