Skip to content

Sys_TerminateApplication

The function can be used to stop an application in a user friendly manner before an installation is started. The function shows a message that asks the user to close the application, and checks every 10 seconds if the process is still running. When the process has ended, the function completes.

If the process is still running after the timeout, the function shows a message that the installation timed out and will be retried later, and calls CMS_JobRetryLater. The rest of the installation is then skipped, and the package runs again later.

The function shows the message also if the process isn’t running. To only ask the user when the application is open, call Sys_ExistProcess first.

The texts of the messages come from Capalib.ini in the Lib folder of the CapaInstaller client, in the language of the job (gsLanguage).

Sys_TerminateApplication(sName, sProcess, iTimeOut) As Boolean

Application name. Free text that is inserted into the message the user sees

File name of the process to wait for, for example CapaInstaller.exe

Number of minutes the user has to close the application

The function returns False if the process is still running after the timeout.

If bStatus Then bStatus = Sys_ExistProcess("CapaInstaller.exe", False)
If bStatus And gbValue Then bStatus = Sys_TerminateApplication("CapaInstaller", "CapaInstaller.exe", 1)

Scripting Guidelines

Sys_ExistProcess CMS_JobRetryLater Constants Package Property Variables