Home

Awesome

English | Español

Universal Tool Updater

This tool is designed to help with the tedious process of keeping the tools that we use to work daily up to date.

This is the inevitable complement to the toolkit of the site.

Installation

You can clone the repo with git or just download it from download.

git clone https://github.com/xchwarze/universal-tool-updater

Setting

To add tools you have to edit the file tools.ini.

By default, it is configured as an example so that the user quickly understands how the tool is used.

[DIE]
folder = Analysis\DIE
url = horsicq/DIE-engine
from = github
re_download = die_win64_portable_(?:\S+).zip

[Portmon]
folder = Monitor\Portmon
url = https://raw.githubusercontent.com/MicrosoftDocs/sysinternals/main/sysinternals/downloads/portmon.md
update_url = https://download.sysinternals.com/files/PortMon.zip
from = web
re_version = # Portmon v(\d+\.\d+)

The values used for configuration are:

NameMandatoryDescription
folderYESFolder where the tool will be saved. If it does not exist, it will be created.
urlYESWeb that will be used to perform the checks with the regex.
fromNOIndicates the strategy used for the update. Currently supported values are: web, github or http.
local_versionNOCurrently downloaded version. This value will be updated with each update.
re_versionNORegex used to check for new versions on the web used in url.
re_downloadNORegex used to get the download link on the web used in url.
update_urlNOUpdate download URL. See "Strategy for download" for more info.
update_file_passNOUse this password to unzip the update.
mergeNOMerge new version with local.
pre_updateNOThe entered script will be executed before the update process.
post_updateNOThe entered script will be executed after the update process.
post_unpackNOThe entered script will be executed after unpack the update file.

Strategy for download

Combining the use of update_url and re_download the following download strategies are achieved:

  1. Using only update_url it downloads directly without any extra processing.
  2. Using only re_download you get the download link on the web from url.
  3. When using both parameters, the result of re_download is concatenated with update_url. This is useful for fixing GitHub or Sourceforge download links.
  4. A new version detection method is also available that instead of regex uses the http headers with which the server responds.

Command-line Parameters

The updater provides a flexible set of parameters to control its behavior:

ParameterDescription
-h, --helpShow this help message and exit.
-v, --versionDisplay the program's version number and exit.
-u [UPDATE ...], --update [UPDATE ...]Specify a list of tools to update. Defaults to updating all tools if not provided.
-dsu, --disable-self-updateDisable automatic self-update of this script.
-dfc, --disable-folder-cleanSkip cleaning the tool's folder during updates.
-dr, --disable-repackPrevent repacking of tools after the update process.
-dic, --disable-install-checkSkip checking if the tools are properly installed.
-dpb, --disable-progress-barDisable the download progress bar for updates.
-sft {full,version,name}, --save-format-type {full,version,name}Specify the save format type for compressed updates: full, version, or name.
-f, --forceForce the download of updates, even if they appear up to date.
-uga USE_GITHUB_API, --use-github-api USE_GITHUB_APIUse the GitHub API for updates, specifying the token to authenticate.
-udp, --update-default-paramsUpdate the default parameters stored in the configuration.
-dmc, --disable-mutex-checkAllow multiple instances of the script to run simultaneously by disabling the mutex check.
-d, --debugEnable detailed debug output for troubleshooting.

Examples

The tool supports various commands and combinations. These are the most used.

updater.exe --update "Process Hacker 3"
updater.exe --force --update DIE
updater.exe --disable-folder-clean --disable-repack

Use with GitHub Api

GitHub download are performed by default scraping data, but for a more robust operation it is recommended to do it using the GitHub api. To do this, follow these steps:

  1. Generate our token from https://github.com/settings/tokens by clicking on Generate new token.
  2. Run the updater with the following commands
updater.exe --update-default-params --use-github-api your_github_token

Use with scheduled tasks

# execute in elevated command prompt
SCHTASKS /CREATE /SC DAILY /TN "ToolkitUpdater" /TR "D:\code\toolkit\Updater\custom-task.bat" /ST 14:00
# execute in elevated command prompt
SCHTASKS /DELETE /TN "ToolkitUpdater"

Compile to exe

pip install pyinstaller
pyinstaller --onefile UpdateManager.py --icon=../assets/appicon.ico