-
Notifications
You must be signed in to change notification settings - Fork 0
Database How To
App definitions are described in INI format. File paths and URLs to .ini files are passed to Pint via the PINT_DB environment variable as a comma-separated list. Databases, registered by default:
- https://d.vensko.net/pint/db/packages.ini - maintained by Pint's author in this repository. Also includes third-party databases.
- packages.user.ini - missing by default, can be used for custom app definitions.
Feel free to override PINT_DB with your own app sources.
Alternatively, create a directory named 'packages' and add packages in separate files (one app per file, example).
Default database includes a few automatically generated or imported databases:
Source code for their generation can be found here.
Be aware, that some sources may contain version-specific, duplicate or broken packages and may be slightly outdated until manual update. Primary database is focused on automatic link extraction from web pages and overrides third-party IDs.
Each app is described in a separate section:
[app-id]
dist = http://example.com/dist.zip
[another-app-id]
dist = http://example.com/
link = x86, .zip
link64 = x64, .zip
keep = *.xml
Use lowercase strings without spaces as application identifiers. They must be unique, otherwise they may be overridden by an app with the same id.
By default, new app definitions can be added to local file packages.user.ini.
Append 64 to a key to prefer it in a 64-bit system.
dist = http://example.com/archive.zip
dist64 = http://example.com/archive64.zip
If a key has no a 64-bit counterpart, base name will be used as a fallback.
If link
is not defined, data
is treated as a direct download URL to a file. If link
is defined, the URL must point to a web page. The only mandatory key.
Must be either a full XPath expression, starting with // and searching for <a> elements, or a comma-separated list of words, expected to be found in a download URL.
XPath example: //a[contains(@href, '.zip') and contains(@href, 'x86')]
Simplified syntax: .zip, x86
To scan link texts, wrap words in quotes: .zip, "portable"
Simplified queries are case-insensitive.
There are some meta-values:
.arch
means any of the most popular archive formats (at the moment, it includes .7z, .zip, .rar, and .paf.exe),
.any
is the same as .arch
plus .exe.
Thanks to Xidel, JSON is supported. Consult Xidel's documentation (11. Reading JSON) on how to use the $json function. A few usage examples can also be found in default database.
When a download requires following through one or more web pages, set follow
value to a list of consequent queries (same way as link
), separated by |, leading to a page with a download link. link
is still needed, when follow
is set.
Example: "click here" | "go to download page"
Possible values:
-
standalone
- downloaded file will be considered an executable and will be copied as is with filename equal to app id. -
inno
- force installer type to Inno Setup. -
zip
,cab
, etc. - any format, supported by 7-zip.
Usually, type enforcement is not needed, use it only when autodetection fails.
If installer is too tricky for simple unpacking, but supports installation arguments, place them here. Use $dir
as a placeholder for destination path.
A base path inside an archive. To better explain this, I better tell, how this works. Once the archive is unpacked into a temporary directory, the script switches to that directory and retrieves a list of files. Then it goes line by line, until the base
substring is found (it doesn't have to be a valid file or directory path, can be just a fragment). Once this substring is encountered, the working path changes to the directory, containing the file, where the search stopped. Parent directory of that file/dir will become the base path.
Default base
value is .exe
, which means, that the first encountered directory with an .exe file will be used.
Pint replaces contents of target directories, keeping files, listed in this parameter, intact. Typically, is used for configuration files. Must be a comma separated list of filenames/masks.
Default value: *.ini, *.db
.
Comma-separated list of specific files/masks, which should be copied.
Comma-separated lists of directores and files (respectively), which should be left behind. These files will be neither removed from a target directory, nor copied from a temporary one. Pint uses Robocopy to copy files. These parameters are used as values for its /XD and /XF parameters. If only
is set, these parameters are ignored.
If set to false
, Pint only copies new files to a target directory instead of full replacement (the /PURGE parameter for robocopy).
Pint automatically detects console applications and creates shim files for them. Files, listed in noshim
, will be skipped.
Sometimes console app detector misses them. Add file names/masks to shim
to force shim creation for them.
To enable portable mode, some applications require particular files to be created. These files can be listed in create
. To create a directory, item name should end with backslash \
.
Set HTTP method for link request (GET by default).
If method
is changed to POST, use this key to set custom payload in the x-www-form-urlencoded format.
Show a post-installation note to user (for instance, with instruction how to enable portable mode).