The service program MOD_APP
===========================

Formating:	Tabulator width 5

Andreas Kromke
3.5.98
English translation: Peter West, April 99


What is it for?
---------------

When installing a program, usually by means of an installation-program, 
this should not only copy all the associated program files to the hard 
disk, but also "introduce" the new program to the system. Under GEM/TOS 
this process is traditionally called "Install application" and had to 
be performed manually up till now.
MOD_APP.TTP is a small program that takes on this task. It modifies the 
MagiC system files that contain the application information, inclusive of 
the icon assignments. The changes become active automatically at the next 
start of the AES.


Procedure
---------

An installation program should first copy all required files to the hard 
disk. Then it has to ascertain the partition that contains MagiC (i.e.
generally the boot drive). Finally "<Boot-dr>:\GEMSYS\GEMDESK\MOD_APP.TTP" 
is called, if necessary several times, with a normal Pexec() call to 
make the required changes to the system files; during this the return 
values should be evaluated.

MOD_APP modifies the system files in such a way that at the next start 
of the AES the new settings are taken into consideration by MAGXDESK. 
Theoretically it would be possible also to activate the settings 
immediately; for this one would simply have to call APPLICAT. However, 
as APPLICAT only runs under MagiC, one would lose the advantage of 
MOD_APP running under any TOS system.


Install application
-------------------

Call:

	mod_app -Xia prgname rscname iconnr path|- 1

The abbreviations mean:

	X		The drive letter for the MagiC-containing drive
	prgname	e.g. jinnee.prg
	rscname	e.g. MAGICICN.RSC
	iconnr	Number of the icon (object number - 1)
	path		e.g. C:\JINNEE\JINNEE.PRG, or "-" if no path is to
			be entered. A path will always be required when  
			filetypes are to be assigned.
	1		Here there should always be a 1 for "GEM-program"


Assign icon
-----------

Call:

	mod_app -Xid prgname ftyp rscname iconnr

The abbreviations mean:

	prgname	e.g. jinnee.prg
	ftyp		e.g. *.JIC or *.JINC or ICONS.INF
	rscname	See above
	iconnr	See above


Return values
-------------

	0				OK
	< 0				System error
	1				Syntax error during callf
	2				Format error in APPLICAT.INF
	3				ID already assigned
	4				Application not installed (-Xid)
	5				Path for application missing (-Xid)


Remarks
-------

- If one wants to install filetypes, then MOD_APP must be called 
  several times. At each call one can determine from the return value
  whether the filetype has already been assigned elsewhere. 
- Some errors can not be recognised by MOD_APP. At the next start 
  of the AES, however, these errors will be corrected automatically 
  (I hope...).
- All changes that MOD_APP can perform are exclusively constructive.
  No applications can be de-installed or filetypes de- or re-installed.
  So if a filetype is already in use, an error message should be output 
  so that the user may change the type manually if desired.
