ITrack/Auto updater scripting

From ISoft Wiki
Jump to: navigation, search

This page contains the syntax for use in the auto-update script files that master will run on client machines.

These scripts are run as soon as they are downloaded by ITrack, and are not run by the update copier.

Each command must be on a single line. The script parser will strip whitespace from the left side of the line.

If the first non-whitespace character is '#', then the line is considered a comment, and is ignored by the autoupdater.

The first word of the line (which should be the command word) is case-insensitive. If the first word of a line does not match one of these commands or the line is blank (or only whitespace) then the line is ignored.

run

Adds the line to a batch file to run when the script is done being parsed.

Syntax: run <command>

Example: run CD \windows\system

Since often we will have multiple batch statements that rely on previous commands, it is necessary to run these as an entire batch file. The two most reasonable ways to do this are to put ALL run commands from a single update script into a batch file, or to try and group them by their position in the script.

The former is easier to implement and I can't see a disadvantage to it so that's how it will be. The result of this is that the final thing run in an update script is the batch file. All other changes are made first.

run_delayed

Adds the line to update.todo to be run after ITrack.exe completes downloading updates and runs updater.exe.

Syntax: run_delayed <command>

Example: run_delayed CD \windows\system

These commands are each written out to separate .todo file commands (not in a script file). If the user wishes to schedule several commands, they should write them to a batch file and script it.

runsql

Immediately runs a SQL command against the database.

Syntax: runsql <command>

Example: runsql UPDATE `model` SET `model` = 'Pontiac' WHERE `model` = 'Pontic'

Keep in mind that the sql must occupy exactly one line. Also keep in mind that semi-colons at the end are not necessary and are discouraged.

addsetting

Immediately adds a setting to this computer and also to the host.ini file lest ITrack shut down improperly.

Syntax: addsetting <heading> <keyname> <value>

Example: addsetting database logfile C:\Program Files\ISoft Data Systems\mylog.sql

If the setting already exists, then it is changed. Also note that the heading and keyname cannot contain whitespace.

changesetting

Immediately changes an existing setting in memory and also changes the host.ini file lest ITrack shut down improperly.

Syntax: changesetting <heading> <keyname> <value>

Example: changesetting database logfile C:\Program Files\ISoft Data Systems\mylog.sql

If the setting doesn't exist it is added. Also note that the heading and keyname cannot contain whitespace.

removesetting

Removes an existing setting from memory and also changes the host.ini file lest ITrack shut down improperly.

Syntax: removesetting <heading> <keyname>

Example: removesetting database logfile

If the setting doesn't exist it is ignored. Also note that the heading and keyname cannot contain whitespace.