cURL
is used to:
- Get update information (latest version, setup location, checksum) in the form of an HTTP response header or body.
- To download the requested resource, provided that the setup location is retrieved from the HTTP request.
The response body is in either JSON, HTML, or XML formats. Then Jq
, Pup
and XMLStarlet
are used to parse the body in the previous data formats taken respectively and retrieve the requested update information as tokens.
They are equivalent to grep
in Linux and help parse HTTP response headers that are not in the previously listed formats.
It is used to unzip compressed setups in zip archives files and self-extracting files like chromium setups.
The profile.init.bat
file contains the installation folders of the apps to update and the path to the batchfile autorun script that is run at cmd
startup. If the app id is not this script, then it is installed in the default folder or the autorun folder in case it is a console app.
@Echo OFF
If %~1==autorun_parent Echo Path\To\Autorun\Profile\Folder
If %~1==app_id Set program_data=Path\To\Installation\Folder
The usage :
Update-App [CopyToDirectory]
CopyToDirectory The directory where to backup the installer
App GoogleChrome, AvastSecure, Chocolatey, 7zip, Hugo, GitHubCLI,
Jq, Yq, Pup, XML, WmiExplorer, Rufus, Rainmeter, FirefoxDev,
MJML, VLC, YoutubeDL, etc.
Update curl and save the setup to C:\Backup\Curl.
> Update-Curl.bat C:\Backup\Curl
> curl --version
7.83.1_3
Update chrome and save the setup to C:\Backup\Chrome.
> Type assets\profile.init.bat
If %~1==autorun_parent Echo %ProgramData%\Autorun
If %~1==app_id Set program_data=%ProgramData%\Chrome
> Update-GoogleChrome.bat C:\Backup\Chrome
> chrome --version
102.0.5005.63