From Ketarin
Revision as of 10:44, 10 October 2010 by Floele (talk | contribs) (C# scripts)

Many actions can be defined using Ketarin's user interface. Some advanced behaviours require custom scripts though.

Command types

Pre-update commands

In the “Commands” tab of each application and in the settings of Ketarin you can enter a command which is to be executed before every update. "Before update" means before it is attempted to download, when an update has been found. You can decide to abort the download at this point, by exiting the script with exit code 1 ("exit 1" when using a batch script) or to skip downloading with exit code 2 (since version 1.5).

Post-update commands

In the “Commands” tab of each application and in the settings of Ketarin you can enter a command which is to be executed after every update. This is useful for unzipping ZIP packages, virus scans, installations in background and other purposes.

Post-update all command

In the settings of Ketarin you can define a command that is executed after all applications have been updated, for example to execute cleanup tasks or sync the results to another location.

Execution order

The commands that can be entered are executed in the following order:

  1. Default pre-update command in settings
  2. Application specific pre-update command
  3. Download of update
  4. Default post-update command in settings
  5. Application specific post-update command
  6. Command to execute after updating all applications

Script types

Ketarin supports Batch scripts and C# scripts. Below every text box in which you can enter a script is a button which lets you choose the script type.

Batch scripts

Batch scripts are simple and useful. They allow you to execute any command you would usually execute on command line. Typical possibilities are renaming, copying and deleting files.

By default, Ketarin waits for the script to be finished before proceeding with the next step. If you do not like that, you can put an ”&” at the very end of the script to execute it in background. You can also temporarily disable a line in the script by adding “rem ” at the beginning.

C# scripts

Additional to Batch scripts you can also create C# scripts. C# can be considered much more powerful than Batch, and you can also directly access the internal data structure of Ketarin. If you know C# (numerous tutorials available on the internet), you can write scripts which perform any actions you like. For simplicity, you do not have to define classes or functions, just the code.