;;;;
;;;;
;;;; Install_AP - APrep installation script for Installer
;;;;
;;;; Copyright © 1996 Sergej Kravchenko
;;;;                  All Right reserved.
;;;;                  email dlife@pub.osf.lt
;;;;
;;;;     Installer and Installer project icon
;;;;     (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
;;;;     Reproduced and distributed under license from Commodore.
;;;;
;;;;     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
;;;;     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
;;;;     OR RESPONSIBILITY IS ASSUMED.
;;;;
(complete 0)


(set #welcome           (cat "Welcome to the APrep 1.3 installation\n\nThis program is shareware\nPlease register\n\n\n\n© 1996 Sergej Kravchenko\nemail: dlife@pub.osf.lt"))
(set #dir-choice        (cat "Select the directory where the APrep Directory will be created." ))
(set #copy              (cat "Copying APrep "))
(set #copy-prefs        (cat "Copying Prefs"))
(set #copy-guide        (cat "Copying Guide"))
(set #copy-key          (cat "Copying KeyFile"))
(set #regmes            (cat "\nKey file not found!\nIf you want full program function\nthen print registering form\nand send it with\nUS $10 or DM 15 to Author."))
(set #print             (cat "Printing Registration Form."))
(set #print-mes         (cat "Please switch on your printer and\ninsert paper."))
(set #crdir             (cat "Create directory"))
;=============================================================================
(message #welcome)
(welcome)


;========================================================================
;
; Select the WebMaker directory
;
(procedure
 inst-aprep
(set APdir
   ( askdir
      ( prompt #dir-choice )
      (help "")
      (default "ram:")
      (newpath)
   )
)
(set APdir (tackon APdir "APrep"))

(makedir APdir
 (prompt #crdir APdir)
 (infos)
 ) 

(copyfiles
   (prompt #copy)
   (source "APrep")
   (help   @copyfiles-help)
   (infos)
   (dest APdir)
)


(copyfiles
   (source "APPrefs")
   (help @copyfiles-help)
   (dest    APdir)
   (infos)
   (prompt #copy-prefs)
)

(copyfiles
   (prompt #copy-guide)
   (source "APrep.guide")
   (help   @copyfiles-help)
   (infos)
   (dest APdir)
)
(if (exists "AmPrep.key")
    (
     (copyfiles
     (prompt #copy-key)
     (source "AmPrep.key")
     (help   @copyfiles-help)
     (dest "L:"))
    )
    (
     (message #regmes)
    )
)    
)
;;-------------------------------
(procedure
 print-reg
(message #print-mes)
 
(run "c:copy registr.prt PRT:" 
 (prompt #print)
) 
)
;;--------------------------------- 
(set choice
     (askchoice
      (prompt "Slect one of following:")
      (help "")
      (choices
      "Install program" ; 0
      "Print Registration Form" ; 1)
      (default 0))))
(select choice
        (inst-aprep)
        (print-reg))
        
(complete 100)

(exit)

