📜 ⬆️ ⬇️

Update one file or combine multiple patches

Most users monitor security updates and update their computers and programs. But what if this is a local network, and not all users have the Internet, but how much would you like to update Adobe products? This article will be considered an update for Adobe Reader 9.x for Microsoft Windows. Based on this example, you can create other update files for any programs.

Initial data: users have installed / or not installed Adobe Reader 9.x. You need to install / update it to the latest version. Visiting the official website of Adobe , we see that the latest version is 9.4. However, updates are available to version 9.4.7 . Downloading incremental patches and applying them one by one will allow us to spend a lot of time for installation on each computer. We will create a single file with the installer, which will also include all updates using AutoIt. .


')
Install the Autoit package and download the Adobe files: AdbeRdr940_ru_RU.exe (latest version available in the 9.4 line) and incremental patches updates: AdbeRdr94 * _ru_RU.exe, where * the number from 1 to 7 will be placed in the folder c: \ AutoItPhotoshop \ .

File acrobat94sci.au3:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Run_Obfuscator=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#NoTrayIcon
;
; c:\temp
;
DirCreate("c:\temp")
$b = True
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdr940_ru_RU.exe", "c:\temp\AdbeRdr940_ru_RU.exe")
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd941_all_incr.msp","c:\temp\AdbeRdrUpd941_all_incr.msp")
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd942_all_incr.msp","c:\temp\AdbeRdrUpd942_all_incr.msp")
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd943_all_incr.msp","c:\temp\AdbeRdrUpd943_all_incr.msp")
if $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd944_all_incr.msp","c:\temp\AdbeRdrUpd944_all_incr.msp")
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd945_all_incr.msp","c:temp\AdbeRdrUpd945_all_incr.msp")
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd946_all_incr.msp","c:\temp\AdbeRdrUpd946_all_incr.msp")
If $b = True Then FileInstall("C:\AutoItPhotoshop\AdbeRdrUpd947_all_incr.msp","c:\temp\AdbeRdrUpd947_all_incr.msp")
If $b = True Then FileInstall("C:\AutoItPhotoshop\acrobat940-947.bat","c:\temp\acrobat940-947.bat")
;
RunAsWait("nameuser","namedomain","passworduser",2,"c:\temp\acrobat940-947.bat","c:\temp",@SW_HIDE)
;.. acrobat940-947.bat
filedelete("c:\temp\acrobat940-947.bat"


It remains to find out the contents of the acrobat940-947.bat file, which should also be saved in the C: \ AutoItPhotoshop folder:

AdbeRdr940_ru_RU.exe /sAll /rps /msi /qn
msiexec /update c:\temp\AdbeRdrUpd941_all_incr.msp /quiet /norestart
msiexec /update c:\temp\AdbeRdrUpd942_all_incr.msp /quiet /norestart
msiexec /update c:\temp\AdbeRdrUpd943_all_incr.msp /quiet /norestart
msiexec /update c:\temp\AdbeRdrUpd944_all_incr.msp /quiet /norestart
msiexec /update c:\temp\AdbeRdrUpd945_all_incr.msp /quiet /norestart
msiexec /update c:\temp\AdbeRdrUpd946_all_incr.msp /quiet /norestart
msiexec /update c:\temp\AdbeRdrUpd947_all_incr.msp /quiet /norestart

del c:\temp\AdbeRdr940_ru_RU.exe
del c:\temp\AdbeRdrUpd941_all_incr.msp
del c:\temp\AdbeRdrUpd942_all_incr.msp
del c:\temp\AdbeRdrUpd943_all_incr.msp
del c:\temp\AdbeRdrUpd944_all_incr.msp
del c:\temp\AdbeRdrUpd945_all_incr.msp
del c:\temp\AdbeRdrUpd946_all_incr.msp
del c:\temp\AdbeRdrUpd947_all_incr.msp
rem del c:\temp\acrobat94sci.exe c:\temp\acrobat94sci.bak
del c:\temp\acrobat940-947.bat
rem del c:\temp\acrobat94sci.bak


Save the project with the name acrobat94sci and select Tools-Compile from the menu and get the compiled file acrobat94sci.exe (about 90 MB in size), after launching which will unpack the Acrobat 9.4 installer and all incremental patches. Then the installation script will be launched, installing the Reader and then all incremental patches sequentially. The result is that users have Acrobat 9.4.7 installed.

It only remains to run our file on each computer (copy to a local folder, or run a task from a server via Group Policy or Task).
Having spent several hours creating this mini-script and testing it, we saved time that we would spend on a routine installation operation on each computer.

Source: https://habr.com/ru/post/135190/


All Articles