pcf-files
SetupDownloaderConsole gets the information where to find version information of the programs it is supposed to download in *.pcf-files. They are structured like standard ini-files (in fact, SDC uses AutoIt3's IniRead() and IniWrite() - Functions) and quite easy to understand.
There are mandatory and non-mandatory values. Let's have a look at a sample pcf configuration:
[stable]
program_id=libreoffice
versionpage=http://www.libreoffice.org/download
searchstring_before=<h3><img class="left" src="assets/information.png" width="32" height="32" alt="" title=""/>LibreOffice
searchstring_after= Final (
downloadlink=http://download.documentfoundation.org/libreoffice/stable/%version%/win/x86/LibO_%version%_Win_x86_install_multi.exe
targetfilename=LibO_%version%_Win_x86_install_multi.exe
[variable]
currentversion=
currentfilename=
banned=0
autorun=no
params=/S
Stable-Section:
You normally don't want to change anything here unless it is not working any more. Here we find basic information like the identifier for the program (program_id) or the page where the version information can be found. (versionpage).
SDC will take the source code of the versionpage and search for the first occurence of the string in searchstring_before. It will then take the string between searchstring_before and searchstring_after and replace the placeholder "%version%" in downloadlink and targetfilename with the version found. Finally SDC will use ωget to download the setup file to the target directory specified in ./ini/SetupDownloaderConsole.ini.
Variable-Section:
When SDC finished downloading the setup, it writes the current version and the filename of the file it just downloaded into currentversion and currentfilename.
The next three options are optional and to be set by you:
- banned (default: "0"): if set to 1, program is skipped by SDC. Use this if you temporarily don't need new versions of a specific software or if it's not working any more and you don't want to fix it right now.
- autorun (default: "no"): SDC can launch the setup it just downloaded. To do so, set this to "yes" (Must be done separately for every program)
- params (default: blank): has only effect if autorun is set to "yes". You can define a parameter the setup is started with (like a "silent" switch for example)
Optional values:
There are values that are not mandatory but can help you if you are having trouble with the page providing version information. They are as follows:
searchstring_unique and linesafter
Sometimes SDC may not be able to extract version information out of a specific web page because searchstring_before appears earlier in the source code. In this case, you can specify a unique searchstring and indicate the number of lines below via linesafter where the version information can be found.
Non-download-software
Some programs don't have download links with the version information in it. If the url always stays the same, that is not really a problem, but you should consider changing the default filename to something containing the version via the targetfilename-value.
If the download link changes dynamically like the urls for jre-download for example, you can configure the program as a non-download-software by changing the downloadlink value to "0". Clicking on "openDir" or "Run" will then launch the versionpage in the system's default web browser.