;
; Installer Script for CIM V3
; $VER: CIMInstallerScript 3.1.82 (01.12.99) Written by Jan-Erik Tervo 1997-1999
; Installer version 42.12 or better recommended
;

(ONERROR
      (EXIT)
        )


(COMPLETE 0)

(RUN "run multiview is/cim_v3.iff")

(SET @default-dest "SYS:Expansion")

(IF  (exists "CIM:" (noreq))
     (
     (SET cim_vernum (getversion "CIM:bin/cim"))
     (SET cim_ver (/ cim_vernum 65536))
     (SET cim_rev (- cim_vernum (* cim_ver 65536)))
     
     (SET @default-dest (pathonly(expandpath "CIM:")))
     )
)

(SET CIMdir @default-dest)

; ENGLISH STRINGS

(SET #alku_str
     (cat "\n\n\nWelcome to the CIM V3 Installer script.\n\n \CIM - (the Caller Id Manager)\ Copyright Jan-Erik Tervo 1996, 1997, 1998, 1999.\n\nCharity- & Shareware.\n\n\n")
    )

(SET #where_to_str
     (cat "Select where to install CIM (A sub directory called 'CIM' WILL BE created there if not already present.")
    )

(SET #str-installingf
     (cat "\n\nInstalling thinpazB.font")
    )

(SET #str-installing2-exe
     (cat "\n\nInstalling. . . ")
    )

(SET #str-installingodu
     (cat "\n\nInstalling OwnDevUnit.library")
    )
    
(SET #str-installingrxh
     (cat "\n\nInstalling rexxhost.library")
    )
    
(SET #str-alreadyi
     (cat "\n\nYou have CIM already installed!\n\nExecutable version: " cim_ver '.' cim_rev )
    )

(SET #str-iccc
     (cat "\n\nInstallation completed.\n\n\nCIM's Official Home Page located at: http://www.netti.fi/~jet/cim\n")
    )

(SET #lecut
     (cat "\nOn Low Storage Space situation cut logs to:")
    )

(SET #tyok "ibrowse")
(SET _stakki 15000)

(MESSAGE #alku_str)




(IF cim_vernum
     
               (IF (ASKBOOL(
                         (help "No help for this function")
                         (prompt #str-alreadyi)
                         (choices "Cancel" "Proeed")
                         
                       )
                         
               )
                
               (EXIT)) 
               
                    
                    
)
     





(SET CIMdir
     (ASKDIR (prompt #where_to_str)
                                   (HELP "No help for this function")
                                   (DEFAULT @default-dest)

           )
)


(SET Finddir (TACKON CIMdir "CIM"))

(COMPLETE 5)

(STARTUP "CIM - http://www.netti.fi/~jet/cim/"
          (prompt "Modify s:startup-sequece. Some instructions need to be added to the \"s:user-startup\" so that your system will be properly configured to use CIM.")
          (help "No help for this function")
          (command "ASSIGN CIM: " Finddir)
)


(COMPLETE 7)

(SET _man (ASKBOOL(
                         (prompt "Install HTML Manual?\n")
                         (help "No help for this function")
                         
                  )
          )
)



(IF _man
     (SET #tyok
          (askfile 

                    (prompt "\nGive a HTML-browser you want to use.")
                    (help "No help")
                    (default "SYS:Internet")
                    )
     
     )
)

(COMPLETE 8)

(set #ok 0)
(set #instchoice 0)

(while (not #ok)
   (
       (set #instchoice
           (askchoice
               (prompt #lecut)
               (help "")
               (choices "100k" "500k" "3000k")
               (default 2)
           )
       )

      (if (= #instchoice 0)
      (set #ok 1)
      )
      
      (if (= #instchoice 1)
      (set #ok 1)
      )
      
      (if (= #instchoice 2)
      (set #ok 1)
      )
   )
)









(COMPLETE 10)



(MAKEDIR Finddir
          (help "No help for this function")
          (infos)
          (prompt "CIM dir will be created next")         

)

(SET @default-dest Finddir)
(MAKEASSIGN "CIM" Finddir)

(COMPLETE 15)

;  Install Stuff


(COPYFILES
        (help "No help for this function")
        (source "fonts/")
        (pattern "#?")
        (fonts)
        (dest "FONTS:")
        (prompt #str-installingf)
        (confirm)
         )

(COMPLETE 20)

(COPYLIB
        (help "No help for this function")
        (source "3rdpartylibs/owndevunit.library")
        
        (dest "LIBS:")
        (prompt #str-installingodu)
        (confirm)
         )

(COMPLETE 35)

(COPYLIB
        (help "No help for this function")
        (source "3rdpartylibs/rexxhost.library")
        
        (dest "LIBS:")
        (prompt #str-installingrxh)
        (confirm)
         )


(COMPLETE 40)


(COPYFILES
        (help "No help for this function")
        (source "stuff/")
        (pattern "#?")
        (dest Finddir)
        (prompt #str-installing-exe)
         )

(COMPLETE 50)






(IF _man
        (
          (COPYFILES
               (help "No help for this function")
               (source "stuff2/")
               (pattern "#?")
               (dest "CIM:DOCS/")
               (prompt "Installing")
          )
         
          (ICONINFO
               (dest #tyok)
               (prompt "")
               (getstack "_stakki")
          )
         
          (TOOLTYPE 
                    (dest "CIM:DOCS/MANUAL/index.html")
                    (setdefaulttool #tyok)
                    (setstack _stakki)
          )
         )
                              

)
  


                                                                                                                                                                                                                           (COMPLETE 77)

                                                                                                                                                                                                                                (IF (exists "cim_v3.key")
                                                                                                                                                                                                                                      (COPYFILES
                                                                                                                                                                                                                                           (source "cim_v3.key")
                                                                                                                                                                                                                                           (dest "s:")
                                                                                                                                                                                                                                                  )
                                                                                                                                                                                                                                       )

(COMPLETE 80)

(IF (= #instchoice 0)

    (COPYFILES
               (help "No help for this function")
               (source "stuff3/logsizer.cfg_0")
               
               
               (dest "CIM:SCRIPTS/AREXX/LOGSIZER/")
               (newname "logsizer.cfg")
               
               (prompt "Installing")
    )
   
)



(IF (= #instchoice 1)

    (COPYFILES
               (help "No help for this function")
               (source "stuff3/logsizer.cfg_1")
               
               
               (dest "CIM:SCRIPTS/AREXX/LOGSIZER/")
               (newname "logsizer.cfg")
               
               (prompt "Installing")
    )
   
)



(IF (= #instchoice 2)

    (COPYFILES
               (help "No help for this function")
               (source "stuff3/logsizer.cfg_2")
               
               
               (dest "CIM:SCRIPTS/AREXX/LOGSIZER/")
               (newname "logsizer.cfg")
               
               (prompt "Installing")
    )
   
)

(COMPLETE 85)
        
(MESSAGE #str-iccc)



(PROTECT "CIM:bin/cim" "rwed")

(COMPLETE 90)

(RUN "run multiview is/cim_wb.iff")

(RUN "wait 3")

(RUN "multiview /cim_v3.readme")

(RUN "multiview README_FIRST")

(RUN "multiview IMPORTANT")

(COMPLETE 100)

; end of installation

(EXIT)


