Last update: November 7, 2004

Kurmi Programming Manual



Callbacks

Kurmi calls the following callbacks during the installation process:

A callbacks file defines functions like:

function kurmi.CALLBACKS.PRE_LICENSE( )
    ...some Lua code...
end
or
function kurmi.CALLBACKS.POST_DIRECTORY( )
    ...some Lua code...
    if some-condition then
        return true
    else
        return false
    end
end


Functions

kurmi.dofile(filename)
Same as Lua dofile but filename refers to an installer file system member.

kurmi.extractto(filename[,osdir])
Extracts filename to the optional target OS directory, or to the temporary installer run directory.
(Any file inside the temporary installer directory is removed after finishing.)

kurmi.getkbfree(path)
Gets the free space (in kb) into the volume containing path.

kurmi.loadfile(filename)
Same as Lua loadfile but filename refers to an installer file system member.

kurmi.loadlib(libname,funcname)
Same as Lua loadlib but libname refers to an installer file system member.

kurmi.log(text)
Writes text to the install log window.
(Use it in PRE_INSTALL and POST_INSTALL callbacks only.)

kurmi.platform( )
Returns two strings related to the running OS platform.
First string is: for Windows platform, or sysname (from uname) on posix platforms.
Second string has the form major.minor

kurmi.progress(value[,text])
Sets the actual value (0-100) of the progress bar in the install page, and optional the associated text.
(Use it in PRE_INSTALL and POST_INSTALL callbacks only.)

kurmi.readfile(filename)
Reads the content of an installer file system member.

kurmi.rmdir(dir)
Removes recursively the dir directory.

kurmi.showmsg(message)
Writes message to default output.

kurmi.sleep(time)
Suspends execution of the installer for time seconds (time is a float).

kurmi.tempto(filename)
Same as kurmi.extractto(filename).

kurmi.yesorno(title,prompt)
Asks user for "yes" or "no", and returns the corresponding string.

kurmi.zipdir([path])
Gets an installer file system directory with an optional path root.
The function returns a table containing the directory, and the total uncompressed size.
The table has a subtable for each directory entry with the followings members: date, size, attr and name.


Standard variables

kurmi.VARS.INSTDIR : Path to the installation directory.

kurmi.VARS.PRODUCT : Name of the product to install.

kurmi.VARS.UI_LIB_NAME : Name of the User Interface lib to use.

© 2004 - Daniel Quintela