'$INCLUDE 'mstest.inc'          'Include MS test file.
'$INCLUDE 'ntapps.inc'          'Include Hermes applications include file.

DECLARE SUB AcmeSetup( AppRegName$, StfFile$ )
' AppRegName$   is the name of the primary registry key for an ACME Setup, i.e., the
'               individual program items may be named something like 'msoffice+winword',
'               where the primary registry key is 'msoffice'.
'
' StfFile$      is the filename of the STF file, which is usually 'setup.stf'

SUB AcmeSetup( AppRegName$, StfFile$ )

DIM hTask%, sleepFor%

' Preprocess STF file and run ACME Setup program
hTask% = WK_SETUP( AppRegName$, StfFile$ )
if hTask% = 0 THEN
    GOTO DONE
ENDIF

' Sleep for intervals of 'sleepFor'
sleepFor% = 5

WHILE IsTask( hTask% )
  ' Sleep while ACME Setup works
  SLEEP sleepFor%
WEND

' Post process STF file and write registry keys and values.
hTask% = WK_SETUP( AppRegName$, StfFile$ )

DONE:

END SUB
