/* InstallApp.cmd
 * install a Suntan Special applicaion
 *
 * Arguments
 *   arg(1) - application name
 *   arg(2) - optional arugment
 *
 * Copyright (C) 2017 Blonde Guy
 * All Rights Reserved
 */

signal on Error
signal on Syntax

parse arg ApplicationName ApplicationParam

if ApplicationName = '' then do
   call LogCdi "usage installApp <application name> [<application parameter>]"
   return 1
end

odir = directory()

/* handy debug statement
call LogCdi "Installing" ApplicationName "from" context "with parameter" ApplicationParam
*/

apprc = ApplicationEd('INSTALL' ApplicationName '(' || context || ')' ApplicationParam)

call LogCdi ApplicationName "installation returned" apprc

call directory odir

return apprc

Syntax:
Error:
call LogCdi "Condition" Condition('c') "was raised"
call LogCdi "installApp error" rc "on line" sigl
call LogCdi "Application" ApplicationName
call LogCdi ErrorText(rc)
return 42
