Leaderboard
Popular Content
Showing content with the highest reputation on 10/06/2023 in all areas
-
Yea right ....reading memory to get an excel value.... whatever...2 points
-
A reasonably speedy and overly simplistic hash generator (definately not a cryptographic hash) I had a minor project that I didn't feel like putting in the effort to use any recognized hashing algorithm, so I made this one as a quick and dirty, just "for sh*ts and giggles" algorithm. Useable, but don't take it seriously. Maybe just an example of how you can compartmentalize your UDF and avoid using global variables. CornedBeefHash.au31 point
-
I'm a bit late to this argument party, but . . . since you are not using this for encryption, you don't really have to worry about using established algorithms. You can even create your own simplified hash. I just uploaded a quick and dirty hash I have used in the past. I just cleaned it up and turned it into a UDF. Take a look, have a laugh, then do what works for your app. 🙃 https://www.autoitscript.com/forum/topic/210942-cornedbeef-hash-udf/1 point
-
One last chance. I made an example for you with user interface. Save the script below as MyApp.au3 Global Const $sDomain = 'https://your-domain.tld' Global Const $sAppVersion = '1.0.0' ; Current app version Global $hMain, $cCurrentVersion, $cNewestVersion, $cProgress, $iUpdateSize ; This will check if the application ; has been updated and delete the updater DeleteUpdater() ; MyApp UI $hMain = GUICreate('My app', 360, 130) $cCVLabel = GUICtrlCreateLabel('Current version', 10, 10, 100, 30, 0x200) $cCurrentVersion = GUICtrlCreateLabel($sAppVersion, 110, 10, 50, 30, 0x1201) $cNVLabel = GUICtrlCreateLabel('Newest version', 10, 50, 100, 30, 0x200) $cNewestVersion = GUICtrlCreateLabel('', 110, 50, 50, 30, 0x1201) $cCheckForUpdate = GUICtrlCreateButton('Check for update', 200, 10, 150, 30) $cUpdate = GUICtrlCreateButton('Update', 200, 50, 150, 30) $cProgress = GUICtrlCreateProgress(10, 90, 340, 30) GUICtrlSetFont($cCVLabel, 10, 500, 0, 'Tahoma') GUICtrlSetFont($cCurrentVersion, 10, 500, 0, 'Tahoma') GUICtrlSetFont($cNVLabel, 10, 500, 0, 'Tahoma') GUICtrlSetFont($cNewestVersion, 10, 500, 0, 'Tahoma') GUICtrlSetFont($cCheckForUpdate, 10, 500, 0, 'Tahoma') GUICtrlSetFont($cUpdate, 10, 500, 0, 'Tahoma') GUISetState(@SW_SHOW, $hMain) While True Switch GUIGetMsg() Case $cCheckForUpdate CheckForUpdate() Case $cUpdate UpdateApp() Case -3 Exit EndSwitch WEnd ; This function check if there are new versions available Func CheckForUpdate() Local $sVersion = InetRead($sDomain & '/versions.txt') If $sVersion Then $sVersion = BinaryToString($sVersion) Local $aSplit = StringSplit($sVersion, '|') If IsArray($aSplit) Then GUICtrlSetData($cNewestVersion, $aSplit[1]) $iUpdateSize = $aSplit[2] EndIf EndIf EndFunc ; This function check if the current version is the newest version, ; otherwise will download the last version and apply the update Func UpdateApp() Local $sCurrentVersion = GUICtrlRead($cCurrentVersion) Local $sNewestVersion = GUICtrlRead($cNewestVersion) If $sCurrentVersion And $sNewestVersion Then Local $fCompare = CompareVersions($sCurrentVersion, $sNewestVersion) Switch $fCompare Case -1, 0 MsgBox(0x40, 'Info', 'Current version is the last available.', 10) Case 1 Local $sFileName = StringReplace($sNewestVersion, '.', '_') & '.dat' Local $hRequest = InetGet($sDomain & '/versions/' & $sFileName, @ScriptDir & '\update.dat', 1, 1) Do $iRead = InetGetInfo($hRequest, 0) GUICtrlSetData($cProgress, Int($iRead * 100 / $iUpdateSize)) Until InetGetInfo($hRequest, 2) GUICtrlSetData($hRequest, 100) If InetGetInfo($hRequest, 3) Then FileMove(@ScriptDir & '\update.dat', @ScriptDir & '\update.exe') ShellExecute(@ScriptDir & '\update.exe', ' --update') Else MsgBox(0x10, 'Error', 'Download error.', 10) EndIf EndSwitch Else MsgBox(0x10, 'Error', 'Please check first if a newer version is available.', 10) EndIf EndFunc ; This function compare current application version with the newest available ; as it is in versions.txt Func CompareVersions($sCurrentVersion, $sNewestVersion) Local $aCurrentVersion = StringSplit($sCurrentVersion, '.') Local $aNewestVersion = StringSplit($sNewestVersion, '.') If Not IsArray($aCurrentVersion) Or Not IsArray($aNewestVersion) Then Return 0 If $aCurrentVersion[0] <> $aNewestVersion[0] Then Return 0 For $Index = 1 To $aCurrentVersion[0] If Number($aCurrentVersion[$Index]) > Number($aNewestVersion[$Index]) Then Return -1 If Number($aCurrentVersion[$Index]) < Number($aNewestVersion[$Index]) Then Return 1 Next Return 0 EndFunc ; This function delete the updater Func DeleteUpdater() If IsArray($CmdLine) Then If $CmdLine[0] = 1 Then If StringLeft($CmdLine[1], 6) = '--del:' Then Local $sProc = StringTrimLeft($CmdLine[1], 6) Local $Timeout = 15000 Local $Timer = TimerInit() While (ProcessExists($sProc)) ProcessClose($sProc) Sleep(100) If TimerDiff($Timer) > $Timeout Then ExitLoop WEnd FileDelete(@ScriptDir & '\' & $sProc) EndIf EndIf EndIf EndFunc Assume that this script is your actual application. Create two directories: FirstBuild and LastBuild. Then build the script as executable and this will be your first application version (MyApp.exe). Move this executable in FirstBuild directory. To create a new version just change in the script above this line Global Const $sAppVersion = '1.0.0' ; Current app version with a new app version, for example Global Const $sAppVersion = '1.1.0' ; Current app version and build the script again (MyApp.exe). Move this executable in LastBuild directory. Then prepare a versions.txt file that will contain the info about newest version of the application. This file should look like this: 1.1.0|918528 where first part (1.1.0) it's the latest app version and second part (918528) it's the size of MyApp.exe from LastBuild directory in bytes. Before uploading this files to your host you have to build an updater. The updater code it's simple and will never change, just provide to FileInstall the full path to latest version of MyApp.exe from LastBuild directory (don't use variables for this, it has to be literal path). If IsArray($CmdLine) Then Switch $CmdLine[0] Case 1 Switch $CmdLine[1] Case '--update' Deploy() EndSwitch EndSwitch EndIf Func Deploy() Local $Timeout = 15000 Local $Timer = TimerInit() While (ProcessExists('MyApp.exe')) ProcessClose('MyApp.exe') Sleep(100) If TimerDiff($Timer) > $Timeout Then ExitLoop WEnd If Not ProcessExists('MyApp.exe') Then FileInstall('<Full Path to latest version of MyApp.exe>', @ScriptDir & '\MyApp.exe', 1) Run('MyApp.exe --del:update.exe', @ScriptDir, @SW_HIDE) Else MsgBox(0x10, 'Error', 'Update error!', 10) EndIf EndFunc Build the updater script and rename the executable as 1_1_0.dat since hosts don't accept executable files to be uploaded on the servers. Upload version.txt in your root directory and for 1_1_0.dat create a directory named "versions" in root directory and upload the file. That's all. Now go and run MyApp.exe from FirstBuild directory, press the button Check for updates and the app will display your latest available version, then you can press Update button and the application will be updated. The current application will be closed by the updater and restarted as latest version. When the latest application will start it will delete the updater.1 point
-
And a extra code pack will not help you? i usual install the mega pack from https://www.codecguide.com/download_kl.htm Of course , I don't have win111 point
-
Version 1.0.6
373 downloads
AT Command UDF - for control AT Modems, send SMS, get SMS Changelog: #cs 1.0.0 2020/10/03 . First version - Danyfirex + mLipok 1.0.1 2020/10/04 . Added - Function - _ATCmd_IsPINReady - Danyfirex . Added - Function - _ATCmd_IsPINRequired - Danyfirex . Added - Function - _ATCmd_IsSIMInserted - Danyfirex . Added - Function - _ATCmd_IsSenderSupported - Danyfirex . Added - Function - _ATCmd_OnPINReques - Danyfirex . Added - Function - _ATCmd_SMS_ListTextMessages - Danyfirex . Added - Function - _ATCmd_SetPIN - Danyfirex . Added - Function - __ATCmd_GetPINCounter - Danyfirex - Added - ENUM - $ATCmd_ERR_PIN - Danyfirex - Added - ENUM - $ATCmd_ERR_SIM - Danyfirex . Changed - __ATCmd_ComposePDU() - using _ATCmd_UseUCS2() internally instead parameter - Danyfirex . Suplemented - #CURRENT# - Danyfirex . . 1.0.2 2020/10/05 . Added - ENUM - $ATCmd_MSGLIST_* - mLipok . Added - ENUM - $ATCmd_STATUS__* - mLipok - Added - ENUM - $ATCmd_ERR_PARAMETER - mLipok . Added - _ATCmd_UsePDU() - parameter validation - mLipok . Added - _ATCmd_UseUCS2() - parameter validation - mLipok . Added - more error logs . Changed - MagicNumber replaced with Standard UDF constants - mLipok . Small refactoring - mLipok . . 1.0.3 2020/10/05 . CleanUp - Danyfirex . . 1.0.4 2020/10/05 . Small refactoring - Danyfirex . CleanUp - Danyfirex . . 1.0.5 2020/10/23 . _ATCmd_FullLoging - mLipok . _ATCmd_CMEESetup() ... @WIP - mLipok . $ATCMD_STATUS_11_SUBSCRIBERNUMBER - mLipok . . 1.0.6 2020/10/25 . __ATCmd_CMSErrorParser() - mLipok . . @LAST https://www.nowsms.com/gsm-modem-cms-error-code-list https://m2msupport.net/m2msupport/at-command-to-enable-error-codes/ https://www.micromedia-int.com/en/gsm-2/73-gsm/669-cme-error-gsm-equipment-related-errors https://assets.nagios.com/downloads/nagiosxi/docs/ATCommandReference.pdf https://www.maritex.com.pl/product/attachment/40451/15b4db6d1a10eada42700f7293353776 https://www.multitech.net/developer/wp-content/uploads/2010/10/S000463C.pdf https://www.telit.com/wp-content/uploads/2017/09/Telit_AT_Commands_Reference_Guide_r24_B.pdf https://docs.rs-online.com/5931/0900766b80bec52c.pdf PDU Format / Testers / Encoders / decoders https://m2msupport.net/m2msupport/sms-at-commands/#pduformat http://smstools3.kekekasvi.com/topic.php?id=288 #ce Saludos1 point -
Reading the properties is "easy" $sProperty = Execute("$oWord_Appl." & $sProperty)You missed the $ sign.1 point