Search the Community
Showing results for tags 'update'.
-
Automatique upgrade to Windows 11 Put in the same Directory your *.ISO file and the Skip_TPM_Check_on_Dynamic_Update.cmd from MediaCreationTool.bat. ISO can be made from uupdump.net Compile with AutoIt and run. W11 22h2 will be deployed. Have fun. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Description=Auto Upgrade W11 #AutoIt3Wrapper_Res_ProductName=Auto Upgrade W11 #AutoIt3Wrapper_Run_Tidy=y #Tidy_Parameters=/reel #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/mo #AutoIt3Wrapper_Res_ProductVersion=1.0.1.1 #AutoIt3Wrapper_Res_Fileversion=1.0.1.1 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.16.0 Author: Cramaboule Date: December 2022 Script Function: Auto Upgrade to W11 Source: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-command-line-options?view=windows-11 Bug: Not known To do: V1.0.1.1 14.02.2022: Fixed: Mounting ISO with spaces in path in now fixed. Changed: Alwayas unzipp and always install TPM with the 'install' argument. Fixed: Small bugs V1.0.1.0 17.01.2023: Changed: Get drive letter by loop! V1.0.0.1 29.12.2022: Changed: Get drive letter from powershell Changed: Check if zip is already expended Changed: Check if iso file is mounted Changed: Display message V1.0.0.0 28.12.2022: Inital relase #ce ---------------------------------------------------------------------------- #RequireAdmin #include <Array.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> $sIsoFile = @ScriptDir & '\22621.963.221202-2359.NI_RELEASE_SVC_PROD1_CLIENTPRO_OEMRET_X64FRE_FR-FR.ISO' Global $Title = 'Auto Upgrade W11' Global $font = 'Segoe UI Light', $sFinalMessage SplashTextOn($Title, '', 300, 400, -1, -1, $DLG_TEXTLEFT, $font, 14, 400) _Splash('Checking free space') $iFreeSpace = DriveSpaceFree(@HomeDrive & "\") ; usualy C:\ If Round(Number($iFreeSpace) / 1024, 2) < 15 Then If (MsgBox($MB_ICONERROR + $MB_YESNO, 'No free space', 'You must have at least 15 Go free on your hard disk.' & @CRLF & 'You have: ' & Round(Number($iFreeSpace) / 1024, 2) & ' Go' & @CRLF & @CRLF & 'Would you like to continue ?') = $IDNO) Then Exit EndIf _Splash('Done') _Splash('Unzipping zip file') RunWait(@ComSpec & ' /c ' & 'powershell -command "Expand-Archive -Path W11bypassTPM.zip -Force"') _Splash('Done') _Splash('Skipping TPM') RunWait(@ComSpec & ' /c ' & 'W11bypassTPM\MediaCreationTool.bat-main\bypass11\Skip_TPM_Check_on_Dynamic_Update.cmd install') _Splash('Done') _Splash('Mounting ISO') If Not (_GetDriveLetter()) Then RunWait(@ComSpec & ' /c ' & 'powershell -command "Mount-DiskImage -ImagePath \"' & $sIsoFile & '\""') EndIf $sDrive = _GetDriveLetter() _Splash('Done') If $sDrive Then _Splash('Running setup.exe') Run(@ComSpec & ' /c ' & 'start ' & $sDrive & ':\setup.exe /auto upgrade /dynamicupdate disable /eula accept') Sleep(10000) ; 10 secondes Exit Else _Splash('Error: No Setup found') MsgBox($MB_TOPMOST + $MB_ICONERROR, 'Error', 'No "Setup.exe" found' & @CRLF & 'Error: ' & $sDrive) Exit EndIf Func _GetDriveLetter() Local $sOutput = '' For $i = 1 To 26 ; A = 65 $Letter = Chr($i + 64) If FileExists($Letter & ':\sources\install.wim') Then Return $Letter EndIf Next Return False EndFunc ;==>_GetDriveLetter Func _Splash($message) $sFinalMessage = $sFinalMessage & $message & @CRLF ControlSetText($Title, "", "Static1", $sFinalMessage) EndFunc ;==>_Splash
-
Hello, I am %*&%*+$ with the Windows Updates every 2 weeks or so... And my people who never do their updates... So... fortunately, I have AutoIt and my brain (lol) Basically my approach is the following: I push the new KB's and users will receive a notification when they want to do their updates 1. Reboot, install and shutdown at the end of the day 2. Reboot later 3. Reboot now As I am in Switzerland I made it in 3 languages: French, German, English (thank to Brett Francis (BrettF)) The thing behind: I download the msu file from the Windows Catalog. I put it on my server where they can download it (internally and externally). I made a dat file (ini file) with the new build of Win 10/11 and the KB file name. I put as well the file time of the exe. Thus it can do an automatique update of my AutoIt prg itself. My prg will download the dat file, test the hash, and do the updates if necessary, then display the gui. There is a task scheduler that runs my prg. You 'just' need to run once on the PC and it will deploy by itself. (I push it through a sort of Remote Management software, that run under 'SYSTEM') What you need to change for you: - In Write-datFile.au3: Line 17: Your own server (for me it is an UNC path) $sServerFile = '\\Path\to\myWEB\SERVER\ManageWU.dat' - In Shutdown.au3: Line 36: Your own Task Scheduler folder: Local $iPID = RunWait(@ComSpec & " /c " & 'SCHTASKS /Delete /TN "FOLDER\shutdown" /F', @SystemDir, @SW_HIDE) - Your Logo !!! (logo.bmp) - In ManageWU.au3: Line 12: Your own server (for me it is an UNC path) #AutoIt3Wrapper_Run_After=copy "%out%" "\\Path\to\myWEB\SERVER\" Line 102: Your external web adresse: Global $sRootDwl = 'https://path/to/myWEB/SERVER' Line 294, 494, 513 : Your own Task Scheduler folder: Local $iPID = RunWait(@ComSpec & ' /c SCHTASKS /create /TN "FOLDER\ManageWU" /xml "' & $rootdir & '\ScheduleManageWU.xml" /F', @SystemDir, @SW_HIDE, BitOR($STDERR_CHILD, $STDOUT_CHILD)) Run('SCHTASKS /create /tn "FOLDER\Shutdown" /tr "' & $rootdir & '\Shutdown.exe" /sc ONSTART /RU "SYSTEM" /RL "HIGHEST" /F') Run('SCHTASKS /create /tn "FOLDER\Shutdown" /tr "' & $rootdir & '\Shutdown.exe" /sc ONSTART /RU "SYSTEM" /RL "HIGHEST" /F') FileInstall are in 283-288: just compile other programs and make sure they are in the right place... FileInstall('logo.bmp', $rootdir & '\', $FC_OVERWRITE + $FC_CREATEPATH) FileInstall('.\LngFiles\FRENCH.XML', $rootdir & '\LngFiles\', $FC_OVERWRITE + $FC_CREATEPATH) FileInstall('.\LngFiles\ENGLISH.XML', $rootdir & '\LngFiles\', $FC_OVERWRITE + $FC_CREATEPATH) FileInstall('.\LngFiles\GERMAN.XML', $rootdir & '\LngFiles\', $FC_OVERWRITE + $FC_CREATEPATH) FileInstall('ScheduleManageWU.xml', $rootdir & '\', $FC_OVERWRITE + $FC_CREATEPATH) FileInstall('Shutdown.exe', $rootdir & '\', $FC_OVERWRITE + $FC_CREATEPATH) I believe that's all ! Comments are welcome C. Edit: typo ManageWU-IE.zip 60 downloads ManageWU-IE.zip
- 2 replies
-
- window update
- update
-
(and 1 more)
Tagged with:
-
Hey guys, I having some hard times getting false-positive, probably because I am trying to execute my AutoUpdater. Here is my code: Global $iUpdateTimer = 0 While 1 checkUpdates(10) WEnd Func checkUpdates($iDelay = 10) $iDelay = $iDelay * 1000 * 60 If TimerDiff($iUpdateTimer) > $iDelay Then ConsoleWrite('checking for updates...' & @CRLF) $iUpdateTimer = TimerInit() If FileExists('AutoUpdater.exe') Then ShellExecuteWait('AutoUpdater.exe') ; this is the line which cause my problem EndIf EndFunc And AutoUpdater code: #include <MsgBoxConstants.au3> #include <FileConstants.au3> Global $sExecName = 'test.exe' Global $sUpdatePath = @UserProfileDir &'\desktop\AnyAppName\update\'& $sExecName Global $sUserPath = @UserProfileDir &'\desktop\AnyAppName\'& $sExecName Global $sCopyright = 'someUniqueStringHere' If Not FileExists($sUpdatePath) Then Exit 0 If FileGetVersion($sUpdatePath, $FV_LEGALCOPYRIGHT) <> $sCopyright Then Exit 0 ; checking if we really want to update and execute the file If FileGetVersion($sUpdatePath) > FileGetVersion($sUserPath) Then $iResponse = MsgBox(BitOR($MB_YESNO, $MB_ICONQUESTION),'AnyAppName', 'There is an update available, would you like to update?') If $iResponse == $IDYES Then If ProcessExists($sExecName) Then ProcessClose($sExecName) Sleep(500) EndIf FileCopy($sUpdatePath, $sUserPath, $FC_OVERWRITE) Sleep(3000) ShellExecute($sUserPath) Exit 1 EndIf EndIf Exit 0 I am not trying to ask, why is my code is getting recognized as false-positive, because this is quite obvious, but is there any other way to get things done without running external process?
-
Hi, I created a gui with date field but formatted as time in HH:mm. It always shows "now-time". Even if I try to set it with GUICtrlSetData. #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate = GUICtrlCreateDate("", 20, 20, 100, 20, $DTS_TIMEFORMAT) ; to select a specific default format Local $sStyle = "HH:mm" ; Just display hours and minutes <<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSendMsg($idDate, $DTM_SETFORMATW, 0, $sStyle) ConsoleWrite(GUICtrlRead($idDate) & @CRLF) GUICtrlSetData($idDate, "00:00") ConsoleWrite(GUICtrlRead($idDate) & @CRLF) GUISetState(@SW_SHOW) ; Loop until the user exits. While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox($MB_SYSTEMMODAL, "Time", GUICtrlRead($idDate)) EndFunc ;==>Example How can I set the time field with another time and how can this field be set blank? Regards, Conrad
- 4 replies
-
- guictrlcreatedate
- time
-
(and 3 more)
Tagged with:
-
Include this script to your actual project and when SUP_Check() is called your script is going to download the next version and self update him self then restart. I am sorry but i did not bother to make a UDF or a more user friendly and flexible module since i still have a lot to go on my initial project 1- inside your project you include thoses line , all together and before your script actual code, beside your log system if you have one #include "self_update.au3" SUP_SetLogCallBack("_log") ; optional , used to send log to your allready log system if success self loggin is disable SUP_SetCheckCallBack("SUP_DownloadProgress") ; optional , will send the % of the download in progress SUP_Start("VALID HTTP URL To YPOUR NEW FILE","DOWNLOAD FULL FILE PATH NAME") ; mandatory 2- Now anywhere in your script you call this line to check for a newer version $fileVersionUrl: is if your using a custom web page to send fast information on the file like version that optional, if empty will always update when check $parentGui="": the self updated will create a gui with a progress bar and try to attach it self to the $parentGui , that optional SUP_Check($fileVersionUrl="",$parentGui="") 3- to check if your script has just restarted after a update if IsDeclared("updateComplete") then ConsoleWrite("Update Complete Sucess Bravo!") endif File: SUP_SelfUpdate.au3 The script can be compiled alone for debug purpose , look for 1 line to uncomment inside the script if running alone #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=e:SelfUpdate.exe #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include-once ;*************** Line to be use inside your own project************ ; ;~ #include "self_update.au3" ;~ SUP_SetLogCallBack("_log") ;~ SUP_SetCheckCallBack("SUP_DownloadProgress") ;~ SUP_Start("e:SelfUpdate_FF.exe",@TempDir&"SelfUpdate_FF.exe") ; ;******************************************************************* Global $SUP_LOGS_CALL[1] = [0] Global $SUP_DOWN_CALL[1] = [0] Global $SUP_URL Global $SUP_FILE Global $SUP_INFO_FILE Global $SUP_DEST_FILE Global $SUP_PID ;**************Uncomment to self debug that script alone************* ;~ SUP_Start(@ScriptDir&"SelfUpdate.exe",@TempDir&"SelfUpdate.exe") ;******************************************************************** Func SUP_Start($SUPURL,$SUPFILE) $SUP_URL = $SUPURL $SUP_FILE = $SUPFILE $SUP_INFO_FILE = $SUP_FILE&".info" if $CmdLine[0] > 0 Then Switch $CmdLine[1] case "update" SUP_InitInfo() if Not ProcessWaitClose($SUP_PID,30) Then SUP_Log("UPDATE - Could not complete since """&$SUP_DEST_FILE&""" will not close",false) Exit EndIf if Not FileCopy($SUP_FILE,$SUP_DEST_FILE,1) Then SUP_Log("UPDATE - Could not copy the new file to """&$SUP_DEST_FILE&"""",false) Exit EndIf Run($SUP_DEST_FILE&" updatecomplete") exit case "updatecomplete" SUP_Delete() ;~ SUP_Log("UPDATE - Complete sucess") Assign("updateComplete",true,2) EndSwitch ;~ Else ;~ SUP_Check() ;for testing to be remove when linked with main EndIf ;~ sleep(5000) EndFunc Func SUP_InitInfo() local $data = FileRead($SUP_INFO_FILE) $data = StringSplit($data,"|") if $data[0] <> 2 Or $data[1]="" or $data[2] = "" Then SUP_Log("UPDATE - Info File is invalid") sleep(4000) exit EndIf $SUP_PID = $data[1] $SUP_DEST_FILE = $data[2] EndFunc Func SUP_Delete() FileDelete($SUP_FILE) FileDelete($SUP_INFO_FILE) EndFunc Func SUP_SetCheckCallBack($funcCallBack) ReDim $SUP_DOWN_CALL[$SUP_DOWN_CALL[0]+2] $SUP_DOWN_CALL[0] += 1 $SUP_DOWN_CALL[$SUP_DOWN_CALL[0]] = $funcCallBack EndFunc Func SUP_Check($fileVersionUrl="",$parentGui="") ;~ if $RUN then return local $version = FileGetVersion(@AutoItExe) local $nextVersion = "always update" if $fileVersionUrl <> "" Then $nextVersion = BinaryToString(InetRead($fileVersionUrl,1)) ;~ SUP_Log($version&" "&$nextVersion) if $nextVersion = "" Or $version = $nextVersion Then SUP_Log("UPDATE - No new version found") Return EndIf SUP_Log("UPDATE - New version found") SUP_Log("UPDATE - Downloading version "&$nextVersion) local $size = InetGetSize($SUP_URL,1) FileDelete($SUP_FILE) local $handle = InetGet($SUP_URL,$SUP_FILE,1,1) local $byteRead, $error = false #include <WindowsConstants.au3> GUICreate("ProgressBar",200,30,-1,-1,BitOR($WS_MINIMIZEBOX,$WS_DLGFRAME,$WS_POPUP,$WS_GROUP,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST),$parentGui) local $progress = GUICtrlCreateProgress(0,0,200,30) GUISetState(@SW_SHOW) local $pct do Sleep(250) $byteRead = InetGetInfo($handle, 0) if @error Then $error = true ExitLoop EndIf GUICtrlSetData($progress,$byteRead*100/$size) $pct = Round($byteRead*100/$size,2) SUP_Log("UPDATE - Percent done: "&$pct) If $SUP_DOWN_CALL[0] > 0 Then For $i = 1 to $SUP_DOWN_CALL[0] Call($SUP_DOWN_CALL[$i],$pct) Next EndIf Until InetGetInfo($handle, 2) GUIDelete() if $error or Not InetGetInfo($handle,3) Then InetClose($handle) SUP_Log("UPDATE - Downloading next version failed") SUP_Delete() Return EndIf InetClose($handle) FileDelete($SUP_INFO_FILE) FileWrite($SUP_INFO_FILE,@AutoItPID&"|"&@ScriptFullPath) SUP_Log("UPDATE - Exiting to complete update") Run($SUP_FILE&" update") if @error Then SUP_Log("UPDATE - Unable to open the new file") SUP_Delete() Return endif SUP_Log("UPDATE - Exiting") sleep(1000) Exit EndFunc Func SUP_SetLogCallBack($funcCallBack) ReDim $SUP_LOGS_CALL[$SUP_LOGS_CALL[0]+2] $SUP_LOGS_CALL[0] += 1 $SUP_LOGS_CALL[$SUP_LOGS_CALL[0]] = $funcCallBack EndFunc Func SUP_Log($msg,$useCallBack=true) If $useCallBack And $SUP_LOGS_CALL[0] > 0 Then For $i = 1 to $SUP_LOGS_CALL[0] Call($SUP_LOGS_CALL[$i],$msg) Next Return EndIf if @Compiled Then MsgBox(0,"Message",$msg) ConsoleWrite($msg&@CRLF) EndFunc
- 4 replies
-
- update
- selfupdate
-
(and 2 more)
Tagged with:
-
Hi, made this, may come handy to someone ^^ #Code with comments #NoTrayIcon Global $b = "http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player", $url[3] = [$b & "_ax.exe", $b & ".exe", $b & "_ppapi.exe"] HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36") ;Just trying to fit in Global $expectSameTableOrder = 0 ;WebSite table order may change, so use this as time concious setting $cur = _CurVer() ;Grabs the lastest versions available from adobe's website $ver = _GetFlashVersions() ;Grabs installed versions from the registry ;compare the versions For $x = 0 To 2 ;UBound($ver)-1 Local $idx = 0, $_match = 0 If $expectSameTableOrder Then $_match = 1 $idx = $x + 1 Else Do $_match = StringInStr($cur[$idx][1], $ver[$x][1]) $idx += 1 Until ($idx > (UBound($cur) - 1)) Or ($_match > 0) EndIf If $ver[$x][0] = "" Then $_match=0 If $_match > 0 Then If _VersionCompare($cur[$idx - 1][0], $ver[$x][0]) = 1 Then ;// outdated download url is $url[$x] ConsoleWrite("[Lastest:" & $cur[$x][0] & "|Installed:" & $ver[$x][0] & "]" & @TAB & $cur[$x][1] & " its outdated!" & @LF) EndIf EndIf Next Exit Func _CurVer() ;[0]ActiveX (IE) [1]NPAPI (firefox) [2]PPAPI (chrome/opera) Local $__page = BinaryToString(InetRead("https://www.adobe.com/software/flash/about/", 3), 4) Local $__rex = StringRegExp($__page, '(?s)(?:<td[^>]*>(.*?)(?:\\|</td>))', 3) ;_ArrayDisplay($__rex) Local $__ret[1][2], $_skip = 0 If @OSBuild >= 9200 Then $_skip = 1 For $x = 1 To 8 Step 2 If Not (($x = 1 And $_skip) Or ($x = 3 And Not $_skip)) Then $p = UBound($__ret) If $x < 6 Then ReDim $__ret[$p + 1][2] $__ret[$p - 1][1] = $__rex[$x] $__ret[$p - 1][0] = $__rex[$x + 1] EndIf Next Return $__ret EndFunc ;==>_CurVer Func _GetFlashVersions() Local $__fpver[3][2] = [['', "ActiveX"], ['', "PPAPI"], ['', "NPAPI"]] $__fpver[0][0] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerActiveX", "Version") ;IE $__fpver[1][0] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerPlugin", "Version") ;Firefox $__fpver[2][0] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerPepper", "Version") ;Chrome/opera Return $__fpver EndFunc ;==>_GetFlashVersions Func _VersionCompare($sVersion1, $sVersion2) If $sVersion1 = $sVersion2 Then Return 0 Local $aVersion1 = StringSplit($sVersion1, ".,"), _ $aVersion2 = StringSplit($sVersion2, ".,") If UBound($aVersion1) <> UBound($aVersion2) Or UBound($aVersion1) = 0 Then ; Compare as Strings If $sVersion1 > $sVersion2 Then Return SetExtended(1, 1) ; @extended set to 1 for string comparison. ElseIf $sVersion1 < $sVersion2 Then Return SetExtended(1, -1) ; @extended set to 1 for string comparison. EndIf Else For $i = 1 To UBound($aVersion1) - 1 ; Compare this segment as numbers If StringIsDigit($aVersion1[$i]) And StringIsDigit($aVersion2[$i]) And _ StringLen($aVersion1[$i]) = StringLen($aVersion2[$i]) Then ; <<<<<<<<<<<<<<<<<<<<<< If Number($aVersion1[$i]) > Number($aVersion2[$i]) Then Return SetExtended(2, 1) ; @extended set to 2 for number comparison. ElseIf Number($aVersion1[$i]) < Number($aVersion2[$i]) Then Return SetExtended(2, -1) ; @extended set to 2 for number comparison. EndIf Else ; Compare the segment as strings If $aVersion1[$i] > $aVersion2[$i] Then Return SetExtended(1, 1) ; @extended set to 1 for string comparison. ElseIf $aVersion1[$i] < $aVersion2[$i] Then Return SetExtended(1, -1) ; @extended set to 1 for string comparison. EndIf EndIf Next EndIf ; This point should never be reached Return SetError(2, 0, 0) EndFunc ;==>_VersionCompare Thanks to @jguinch for helping me with the regex EDIT1: Code updated, now skips inexistent installations, added $expectSameTableOrder for timewise routines, _VersionCompare fixed (didn't add "= 1" in the if statement,now seems to be working fine For someone looking for a GUI http://pxc-coding.com/portfolio/alternative-flash-player-auto-updater/ [Not mine]
-
Hi... I am trying to add a record in Binary Table in an MSI file. As Binary table has two fields/columns Name &Data , I am giving any string for Name(column 1) and streaming binary data from a VBS file into Data(column 2) . I have tried with VB script and it is working fine, Here is the VB Script file Dim Installer Dim Database Dim View Dim Record Dim query query="INSERT INTO `Binary` (`Name`, `Data`) VALUES ('NewBlob', ?)" Set Installer = CreateObject("WindowsInstaller.Installer") Set Record = Installer.CreateRecord(1) Record.SetStream 1, "C:\Users\Admin\Desktop\coder\CA_Test.vbs" Set Database = Installer.OpenDatabase("C:\Users\Admin\Desktop\7z920.msi", 1) Set View = Database.OpenView(query) View.Execute Record Database.Commit when i tried the same thing in autoit it is not working and it is not giving any syntax error. AutoIt file: #include <File.au3> $idVarInput_CAName="CA_Test" $filepath="C:\Users\Admin\Desktop\coder\CA_Test.vbs" $idVarInput_MSIPath="C:\Users\Admin\Desktop\7z920.msi" $value="?" Local $Query = "INSERT INTO Binary(Name,Data) VALUES('" & $idVarInput_CAName & "','" & $value & "')" $oInstaller = ObjCreate("WindowsInstaller.Installer") $oRec=$oInstaller.CreateRecord(1) $r=$oRec.SetStream(1,$filepath) $oDB = $oInstaller.OpenDataBase($idVarInput_MSIPath,1) $oView = $oDB.OpenView($Query) $oView.Execute($oRec) $oDB.commit() Please Help! Thanks...
- 1 reply
-
- binary table
- update
-
(and 2 more)
Tagged with:
-
Hello, Im using GUICtrlCreateListView to make table with items. But when it is new item with same first column a want just update allready existing row. Its posible? I cant figure it, if its better use other funkcion pls. tell me. Thank
-
AutoIt&SciTEUpdater v1.0.2.1 Update of 2 Sept 2015
wakillon posted a topic in AutoIt Example Scripts
AutoIt&SciTEUpdater v1.0.2.1.au3 External files are included in script. If UAC Enable, Run as Admin the first time. Previous downloads : 611 Source : AutoItAndSciTEUpdater v1.0.2.1.au3 Executable : AutoIt&SciTEUpdater.exe For never miss AutoIt (Release/Beta) and SciTE4AutoIt3 updates. -
Hi guys, I'm using this startup example to allow the program menu to insert an option to "AutoStart" the script. What I'd like to do is update the checkbox of the menu item after they click it to then reflect the "AutoStart" state (on or off). How do I update the menu on the event someone clicks the menu option? The registry is updating correctly, and if I close and re-run the script the menu is updated, but not in the same script execution. I wasn't sure with TrayItemSetState for my "Func AutoStart()" Function what the "controlID" was. I tried 0 through to 3 and "AutoStart" text. Perhaps this is where I'm going wrong? ; Add custom tray icon menu #NoTrayIcon #include <MsgBoxConstants.au3> #include <TrayConstants.au3> Opt("TrayMenuMode", 3) Opt("TrayOnEventMode", 1) #include '_Startup.au3' TrayCreateItem("AutoStart") TrayItemSetOnEvent(-1, "AutoStart") If _StartupRegistry_Exists() Then TrayItemSetState(-1, $TRAY_CHECKED) Else TrayItemSetState(-1, $TRAY_UNCHECKED) EndIf TrayCreateItem("About") TrayItemSetOnEvent(-1, "About") TrayCreateItem("") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "ExitScript") TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "About") TraySetState($TRAY_ICONSTATE_SHOW) ; ################## ; ### OTHER CODE ### ; ################## Func About() MsgBox(0,"About","etc") EndFunc Func AutoStart() If _StartupRegistry_Exists() Then _StartupRegistry_Uninstall() TrayItemSetState("AutoStart", $TRAY_UNCHECKED) Else _StartupRegistry_Install() TrayItemSetState("AutoStart", $TRAY_CHECKED) EndIf EndFunc Func ExitScript() Exit EndFuncThanks!
-
Sorry, this is my fourth thread for support today.... Please can you can explain me how to run a function every 3 minutes in the code snippet below? $GUI = GUICreate("GUI",350,350,-1,-1,-1,-1) GUISetState(@SW_SHOW, $GUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thanks in Advance
-
So i have been trying to find a way to auto update my SVN repo whenever someone commit a new file I found this commandline from google and i can get that to work with autoit np CD C:\Program Files\TortoiseSVN\bin\ START TortoiseProc.exe /command:update /path:"C:\www\MyRepo\" /closeonend:0 But what i want is everytime someone commits something and my repo aint the newest version, i want it to run the commandline. I tried googling and can't find anything is this even possible, if it is how? can you get the newest version with a command line to and compare it to your own version maybe ? Thanks
- 1 reply
-
- SVN
- Auto-update
-
(and 2 more)
Tagged with:
-
Could anyone tell me the best way to sort my champion list as soon as i move one from the right list to the left list. At this point i tried to work with the array.au3 without succes. Here is my code. Global $sbselectform, $sbtargetlist, $sbtemplist1, $sbtemplist2 = "", $sbtemplist3, $sbtemplist2r, $sbaddbtn, $sbrembtn, $sbresetbtn, $sbokbtn, $sbmsg, $sbsourcelist, $sbsourcelistr, $sbchamplabel, $sbbanlabel $sbsourcelist = 'Aatrox|Ahri|Akali|Alistar|Amumu|Anivia|Annie|Ashe|Blitzcrank|Brand|Caitlyn|Cassiopeia|Cho''Gath|Corki|Darius|Diana|Dr. Mundo|Draven|Elise|Evelynn|Ezreal|Fiddlesticks|Fiora|Fizz|Galio|Gangplank|Garen|Gragas|Graves|Hecarim|Heimerdinger|Irelia|Janna|Jarvan IV|Jax|Jayce|Jinx|Karma|Karthus|Kassadin|Katarina|Kayle|Kennen|Kha''Zix|Kog''Maw|LeBlanc|Lee Sin|Leona|Lissandra|Lucian|Lulu|Lux|Malphite|Malzahar|Maokai|Master Yi|Miss Fortune|Mordekaiser|Morgana|Nami|Nasus|Nautilus|Nidalee|Nocturne|Nunu|Olaf|Orianna|Pantheon|Poppy|Quinn|Rammus|Renekton|Rengar|Riven|Rumble|Ryze|Sejuani|Shaco|Shen|Shyvana|Singed|Sion|Sivir|Skarner|Sona|Soraka|Swain|Syndra|Talon|Taric|Teemo|Thresh|Tristana|Trundle|Tryndamere|Twisted Fate|Twitch|Udyr|Urgot|Varus|Vayne|Veigar|Vi|Viktor|Vladimir|Volibear|Warwick|Wukong|Xerath|Xin Zhao|Yasuo|Yorick|Zac|Zed|Ziggs|Zilean|Zyra|' $sbtemplist2 = IniRead("banlist.ini", "Settings", "banlist", "") If $sbtemplist2 <> "" Then ;~ dump($sbtemplist2) $sbtemplist3 = StringTrimRight($sbtemplist2, 1) Local $sbremlist = StringSplit($sbtemplist3, '|') For $iCount = 1 To UBound($sbremlist) - 1 $sbsourcelist = StringReplace($sbsourcelist, $sbremlist[$iCount] & "|", "") ;~ dump($sbremlist[$iCount]) Next EndIf $sbsourcelistr = $sbsourcelist $sbtemplist2r = $sbtemplist2 $sbselectform = GUICreate("Ban list for Draft/Ranked mode", 335, 275, 227, 154) $sbchamplabel = GUICtrlCreateLabel("Champion List", 15, 15, 129, 15) $sbtemplist1 = GUICtrlCreateList("", 15, 32, 129, 227, 0x00200001) GUICtrlSetData($sbtemplist1, $sbsourcelist) $sbaddbtn = GUICtrlCreateButton(">>", 152, 40, 25, 25, 0) $sbrembtn = GUICtrlCreateButton("<<", 152, 70, 25, 25, 0) ;~ $sbresetbtn = GUICtrlCreateButton("C", 152, 189, 25, 25, 0) $sbokbtn = GUICtrlCreateButton("Ok", 152, 219, 25, 25, 0) $sbbanlabel = GUICtrlCreateLabel("Ban List", 185, 15, 129, 15) $sbtargetlist = GUICtrlCreateList("", 185, 32, 129, 227, 0x00200001) GUICtrlSetData($sbtargetlist, $sbtemplist2) GUICtrlSetState($sbokbtn, 256) GUISetState(@SW_SHOW) While 1 $sbmsg = GUIGetMsg() Select Case $sbmsg = $sbaddbtn If GUICtrlRead($sbtemplist1) == "" Then MsgBox(0, "", "select from left list before adding...") Else If (UBound(StringSplit($sbtemplist2, '|')) - 1) <= 9 Then $sbtemplist2 &= GUICtrlRead($sbtemplist1) & "|" $sbsourcelist = sbmove($sbtemplist1, $sbtargetlist, $sbsourcelist, GUICtrlRead($sbtemplist1)) Else MsgBox(0, "", "max 9") EndIf EndIf Case $sbmsg = $sbrembtn If GUICtrlRead($sbtargetlist) == "" Then MsgBox(0, "", "select from right list before removing...") Else $sbsourcelist = $sbsourcelist & GUICtrlRead($sbtargetlist) & "|" ;~ Local $sbremlist = StringSplit($sbsourcelist, '|') ;~ _ArraySort($sbremlist) ;~ $sbsourcelist = "" ;~ For $iCount = 1 To UBound($sbremlist) - 1 ;~ $sbsourcelist &= $sbremlist[$iCount] & "|" ;~ Next $sbtemplist2 = sbmove($sbtargetlist, $sbtemplist1, $sbtemplist2, GUICtrlRead($sbtargetlist)) EndIf ;~ Case $sbmsg = $sbresetbtn ;~ GUICtrlDelete($sbtemplist1) ;~ GUICtrlDelete($sbtargetlist) ;~ $sbtemplist1 = GUICtrlCreateList("", 15, 32, 129, 227, 0x00200001) ;~ GUICtrlSetData($sbtemplist1, $sbsourcelistr) ;~ $sbtargetlist = GUICtrlCreateList("", 185, 32, 129, 227, 0x00200001) ;~ GUICtrlSetData($sbtargetlist, $sbtemplist2r) Case $sbmsg = $sbokbtn IniWrite("banlist.ini", "Settings", "banlist", $sbtemplist2) ;~ MsgBox(64, "boob", $sbtargetlist) ExitLoop Case $sbmsg = -3 ExitLoop Case Else EndSelect WEnd Func sbmove($sbmove1, $sbmove2, $sbmove3, $sbmove4) Local $sbmove5 = StringSplit($sbmove3, '|'), $sbmove6 = '' For $iCount = 1 To UBound($sbmove5) - 1 If $sbmove5[$iCount] <> $sbmove4 And $sbmove5[$iCount] <> '' Then $sbmove6 &= $sbmove5[$iCount] & '|' EndIf Next GUICtrlSetData($sbmove1, '') GUICtrlSetData($sbmove1, $sbmove6) GUICtrlSetData($sbmove2, $sbmove4) Return $sbmove6 EndFunc ;==>sbmove Func dump($a) MsgBox(0, "", $a) EndFunc ;==>dump Func _ArraySort(ByRef $avArray, $iDescending = 0, $iStart = 0, $iEnd = 0, $iSubItem = 0) If Not IsArray($avArray) Then Return SetError(1, 0, 0) Local $iUBound = UBound($avArray) - 1 If $iEnd < 1 Or $iEnd > $iUBound Then $iEnd = $iUBound If $iStart < 0 Then $iStart = 0 If $iStart > $iEnd Then Return SetError(2, 0, 0) Switch UBound($avArray, 0) Case 1 __ArrayQuickSort1D($avArray, $iStart, $iEnd) If $iDescending Then _ArrayReverse($avArray, $iStart, $iEnd) Case 2 Local $iSubMax = UBound($avArray, 2) - 1 If $iSubItem > $iSubMax Then Return SetError(3, 0, 0) If $iDescending Then $iDescending = -1 Else $iDescending = 1 EndIf __ArrayQuickSort2D($avArray, $iDescending, $iStart, $iEnd, $iSubItem, $iSubMax) Case Else Return SetError(4, 0, 0) EndSwitch Return 1 EndFunc ;==>_ArraySort Func _ArrayReverse(ByRef $avArray, $iStart = 0, $iEnd = 0) If Not IsArray($avArray) Then Return SetError(1, 0, 0) If UBound($avArray, 0) <> 1 Then Return SetError(3, 0, 0) Local $vTmp, $iUBound = UBound($avArray) - 1 If $iEnd < 1 Or $iEnd > $iUBound Then $iEnd = $iUBound If $iStart < 0 Then $iStart = 0 If $iStart > $iEnd Then Return SetError(2, 0, 0) For $i = $iStart To Int(($iStart + $iEnd - 1) / 2) $vTmp = $avArray[$i] $avArray[$i] = $avArray[$iEnd] $avArray[$iEnd] = $vTmp $iEnd -= 1 Next Return 1 EndFunc ;==>_ArrayReverse Func __ArrayQuickSort1D(ByRef $avArray, ByRef $iStart, ByRef $iEnd) If $iEnd <= $iStart Then Return Local $vTmp If ($iEnd - $iStart) < 15 Then Local $vCur For $i = $iStart + 1 To $iEnd $vTmp = $avArray[$i] If IsNumber($vTmp) Then For $j = $i - 1 To $iStart Step -1 $vCur = $avArray[$j] If ($vTmp >= $vCur And IsNumber($vCur)) Or (Not IsNumber($vCur) And StringCompare($vTmp, $vCur) >= 0) Then ExitLoop $avArray[$j + 1] = $vCur Next Else For $j = $i - 1 To $iStart Step -1 If (StringCompare($vTmp, $avArray[$j]) >= 0) Then ExitLoop $avArray[$j + 1] = $avArray[$j] Next EndIf $avArray[$j + 1] = $vTmp Next Return EndIf Local $L = $iStart, $R = $iEnd, $vPivot = $avArray[Int(($iStart + $iEnd) / 2)], $fNum = IsNumber($vPivot) Do If $fNum Then While ($avArray[$L] < $vPivot And IsNumber($avArray[$L])) Or (Not IsNumber($avArray[$L]) And StringCompare($avArray[$L], $vPivot) < 0) $L += 1 WEnd While ($avArray[$R] > $vPivot And IsNumber($avArray[$R])) Or (Not IsNumber($avArray[$R]) And StringCompare($avArray[$R], $vPivot) > 0) $R -= 1 WEnd Else While (StringCompare($avArray[$L], $vPivot) < 0) $L += 1 WEnd While (StringCompare($avArray[$R], $vPivot) > 0) $R -= 1 WEnd EndIf If $L <= $R Then $vTmp = $avArray[$L] $avArray[$L] = $avArray[$R] $avArray[$R] = $vTmp $L += 1 $R -= 1 EndIf Until $L > $R __ArrayQuickSort1D($avArray, $iStart, $R) __ArrayQuickSort1D($avArray, $L, $iEnd) EndFunc ;==>__ArrayQuickSort1D Func __ArrayQuickSort2D(ByRef $avArray, ByRef $iStep, ByRef $iStart, ByRef $iEnd, ByRef $iSubItem, ByRef $iSubMax) If $iEnd <= $iStart Then Return Local $vTmp, $L = $iStart, $R = $iEnd, $vPivot = $avArray[Int(($iStart + $iEnd) / 2)][$iSubItem], $fNum = IsNumber($vPivot) Do If $fNum Then While ($iStep * ($avArray[$L][$iSubItem] - $vPivot) < 0 And IsNumber($avArray[$L][$iSubItem])) Or (Not IsNumber($avArray[$L][$iSubItem]) And $iStep * StringCompare($avArray[$L][$iSubItem], $vPivot) < 0) $L += 1 WEnd While ($iStep * ($avArray[$R][$iSubItem] - $vPivot) > 0 And IsNumber($avArray[$R][$iSubItem])) Or (Not IsNumber($avArray[$R][$iSubItem]) And $iStep * StringCompare($avArray[$R][$iSubItem], $vPivot) > 0) $R -= 1 WEnd Else While ($iStep * StringCompare($avArray[$L][$iSubItem], $vPivot) < 0) $L += 1 WEnd While ($iStep * StringCompare($avArray[$R][$iSubItem], $vPivot) > 0) $R -= 1 WEnd EndIf If $L <= $R Then For $i = 0 To $iSubMax $vTmp = $avArray[$L][$i] $avArray[$L][$i] = $avArray[$R][$i] $avArray[$R][$i] = $vTmp Next $L += 1 $R -= 1 EndIf Until $L > $R __ArrayQuickSort2D($avArray, $iStep, $iStart, $R, $iSubItem, $iSubMax) __ArrayQuickSort2D($avArray, $iStep, $L, $iEnd, $iSubItem, $iSubMax) EndFunc ;==>__ArrayQuickSort2D