-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By cramaboule
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
-
By r2du-soft
I am using Windows 11
on Windows 11 when i use @OSVersion, Autoit return WIN_10
how can detect and return WIN_11 with @OSVersion?
-
By DesireDenied
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?
-
By Simpel
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
-
By Vijaya7890
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...
-
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now