home » help » udfs
Additional Information
Follow on Twitter
Follow Kix2Exe on Twitter
New Version Notifier

You'll get notified as soon as new releases are out.

Note: Your e-mail address is only used to keep you informed about new releases.


Depending on the packaging parameters you specify, User Defined Functions (UDFs) are added to your script during the packaging process. The following UDFs are available:

On this page you can find information about how to use Kix2Exe UDFs to extend the possibilities of packaged KiXtart scripts.


K2E_GetParam() is included into the KiXtart script during the packaging process. K2E_GetParam() can be used to get values from command line parameters that are passed to the package. The full command line string is available in the variable $K2E_EXEParam.



How to use

$value = K2E_GetParam($parameter)


  • True if the parameter is specified but no value for the parameter is specified, or;
  • False if the parameter was not specified, or;
  • the actual value of the parameter specified


Here's an example of how you can use K2E_GetParam() in your scripts.

c:\temp>mypackage.exe /installsource "c:\install" /autoinstall

You can get the value of the /installsource and /autoinstall parameters in the KiXtart script by using the following KiXtart code:

$InstallSource = K2E_GetParam("installsource")
$AutoInstall = K2E_GetParam("autoinstall")

In this example $InstallSource will contain the value "c:\install" and $AutoInstall will contain the value True.



Allows balloon tip control from within the packaged script


Specify the /balloontips parameter when running Kix2Exe to build the package

How to use

$rc = K2E_SetBalloonTip($MsgTitle,$Message,$StyleID)

K2E_SetBalloonTip() accepts the following parameters:

  • Title of balloon tip (required)
  • Message (required)
  • Balloon tip style identifier (optional)

StyleID is an optional parameter and can be one of the following values:

  • i = information mark
  • w = warning mark
  • e = error mark
  • r = remove balloon tip
  • empty = no mark


  • True if balloon tip functionality is enabled on the client computer (registry check) (see to MS article mentioned below)
  • False if balloon tip functionality is disabled on the client computer


To detect if the required /balloontip parameter was specified, check if the value of the $K2E_BalloonTipsEnabled variable is set to True (this means K2E_SetBalloonTip() is available).

If $K2E_BalloonTipsEnabled = True
  $rc = K2E_SetBalloonTip("Installation Progress","Creating shortcuts","i")

This will popup a balloon tip with the title Installation Progress with the message Creating shortcuts... The icon will be an information mark (see pictures below).

To remove the balloon tip from the tray bar, call K2E_SetBalloonTip() with the "r" balloon tip style identifier:

$rc = K2E_SetBalloonTip("","","r")

Note: You don't have to remove the final balloon tip in your script. This is done automatically to prevent problems with cleaning up tempfiles.


If the UDF returns false, please read Microsoft KB Article 307729.

UDF K2E_RegisterKixforms()


Temporarily registers Kixforms.dll into the HKCU registry hive - this means that the user running the script is not required to have administrative rights on the machine to register the Kixforms (Classic) DLL on the machine.

Since the registration of Kixforms.dll by the UDF is only valid during script execution (registration of the DLL points to a temporary random location only available during script execution), you should unregister the DLL just before the script ends by calling the K2E_UnregisterKixforms() UDF (see below).

Note: if you are using this UDF on Windows Vista or newer operating systems, use Kix2Exe 1.4.2.


Specify /kixforms parameter when packaging the script to add the UDF to the script


$rc = K2E_RegisterKixforms()


  • True if the registration succeeded
  • False if the registration failed


To detect if the script was built with the /kixforms parameter, check the value of $K2E_KixformsEnabled. It is set to True if /kixforms was specified and thus K2E_RegisterKixforms() is available.

Here's an example of how you could use the K2E_RegisterKixforms():

If $K2E_KixformsEnabled = True
  If K2E_RegisterKixforms() = True
    $System = CreateObject("Kixtart.System")
  ; code if K2E_RegisterKixforms() failed

UDF K2E_UnRegisterKixforms()


Unregisters Kixforms.dll from the HKCU registry hive. Call K2E_UnregisterKixforms() before you exit the form.


Specify the /kixforms parameter when packaging the script to add the UDF to the script.


$rc = K2E_UnregisterKixforms()


  • True if the unregistration succeeded
  • False if the unregistration failed


If $K2E_KixformsEnabled = True ; UDF is available
  $rc = K2E_UnregisterKixforms()