; script per l'installazione di IFR
; Should be run from WorkBench by double-clicking on the icon
; Requires a stack of 16000 bytes or more

(complete 0)

(set @default-dest "Work:")

(set version (/ (getversion) 65536))
(set version2 36)

; install on hard disk
(set dest2 (askdir  (prompt "Select a disk or drawer for IFR")
                    (default @default-dest)
                    (help "Choose a destination disk or drawer that will contain"
                           " IFR. The installation program will create the IFR drawer"
                           " inside it."
                    )
           )
)

(set dest1 (tackon dest2 "IFR"))

(set @default-dest dest1)
(message "\n\nThe program will be installed in\n" 
          dest1
)

(makedir dest1 (safe) (infos))

(set error (trap 4
	(copyfiles (source "")
	      (pattern "ifr#?")
              (dest dest1)
	)
           )
)

(if (> error 0) (message ("Dos error %ld " @ioerr)))

(complete 50)

(set fontdir (askdir  (prompt "Select a drawer for IFR font")
                    (default "fonts:")
                    (help "Choose a destination drawer that will contain"
                          " the font used by IFR."
                    )
             )
)

(set error (trap 4
	(copyfiles (source "fonts")
              (dest fontdir)
              (all)
	)
           )
)

(if (> error 0) (message ("Dos error %ld " @ioerr)))

(complete 75)

(set rexxdir (askdir  (prompt "Select a rexx drawer for supplied script")
                    (default "rexx:")
                    (help "Choose a destination drawer that will contain"
                          " the supplied ARexx script for Spot. Create for"
			  " it a menu entry in Spot."
                    )
             )
)

(set error (trap 4
	(copyfiles (source "arexx")
              (dest rexxdir)
              (all)
	)
           )
)

(if (> error 0) (message ("Dos error %ld " @ioerr)))

(complete 80)

(set comando (cat "assign IFR: \"" dest1 "\"") )

(startup "IFR"
	(prompt "This assign will be added to your user-startup :\n\n"
	        comando
	)
	(help "No help available.")
	(command comando)
)

(makeassign "IFR" dest1)

(complete 100)

(exit	"Read ifr.guide for shareware instructions.\n\n"
	"Feedback to\n\n"
	"Internet : mario.cannistra@pmn.it\n\n"
	"Fidonet  : 2:334/21.16\n\n"
	"AmigaNet : 39:101/402.16"
)
