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

(ONERROR
      (EXIT)
        )



(SET @default-dest "")
(SET _stakki 15000)


(SET i_ver (/ @installer-version 65536))
(SET i_rev (- @installer-version (* i_ver 65536)))


(IF  (exists "CIM:" (noreq))


     (

     
     (IF  (exists "CIM:DOCS/MANUAL/mversio" (noreq))
     
     (
     (SET cimm_vernum (getversion "CIM:DOCS/MANUAL/mversio"))
     (SET cimm_ver (/ cimm_vernum 65536))
     (SET cimm_rev (- cimm_vernum (* cimm_ver 65536)))
     
     )
     
     (
     
     (SET cimm_vernum (getversion "CIM:DOCS/MANUAL/mversion.html"))
     (SET cimm_ver (/ cimm_vernum 65536))
     (SET cimm_rev (- cimm_vernum (* cimm_ver 65536)))
     
     
     ))

     (SET ncimm_vernum (getversion "stuff2/manual/mversion.html"))
     (SET ncimm_ver (/ ncimm_vernum 65536))
     (SET ncimm_rev (- ncimm_vernum (* ncimm_ver 65536)))

     
     
     ; ENGLISH STRINGS

     (SET #alku
          (cat "\n\CIM - (the Caller Id Manager)\ and the HTML-Manual are Copyrighted by Jan-Erik Tervo 1996, 1997, 1998, 1999, 2000.\n\nCharity- & Shareware.\n\n\n")
     )

     (SET #where_to_str
          (cat "Select where to install CIM HTML Manual (A sub directory will be created there.")
     )

     (SET #str-alreadyi
          (cat "\n\nYou have CIM HTML Manual already installed!\n\nVersion: " cimm_ver '.' cimm_rev "\n\Version to be installed: " ncimm_ver '.' ncimm_rev )
     )


     (SET #str-installingm
          (cat "\n\nIstalling CIM HTML Manual files\n")
     )

     (SET #str-installingii
          (cat "\n\nIcon info will be read\n")
     )

     (SET #str-chooseb
          (cat "\nChoose a HTML-browser you want to use.")
     )


  


     (SET #tyok "SYS:Internet")

     (COMPLETE 0)

     (MESSAGE #alku)

     (IF cimm_vernum
     
               (IF (ASKBOOL(
                         (help "No help for this function")
                         (prompt #str-alreadyi)
                         (choices "Cancel" "Proeed")
                         
                       )
               
               
               (IF (> i_ver 42)
               
                         (ICONINFO
                              (dest "CIM:DOCS/MANUAL/index.html")
                              (prompt #str-installingii)
                              (getdefaulttool "#tyok")
                              
                         )
                
                        
                         
                         )
               )
                
               (EXIT (quiet))) 
                         
                    
     )


     
     (SET @default-dest "CIM:DOCS")

     (SET CIMmdir "CIM:DOCS")


     (SET #tyok
          (askfile 

                    (prompt #str-chooseb)
                    (help "No help")
                    (default #tyok)
                    )
     
     )
     
     
     (ICONINFO
          (dest #tyok)
          (prompt #str-installingii)
          (getstack "_stakki")
     )
     
     
     
     
     (COMPLETE 65)

     ;  Install Stuff


     (COPYFILES
        (help "No help for this function")
        (source "stuff2/")
        (pattern "#?")
        (dest CIMmdir)
        (prompt #str-installingm)
        )
        
        

     (COMPLETE 80)
     
     (DELETE "CIM:DOCS/MANUAL/mversio")
     
     (DELETE "CIM:DOCS/MANUAL/mversio.asc")
     
     (COMPLETE 90)


     (TOOLTYPE
         (dest "CIM:DOCS/MANUAL/index.html")
         
         (setdefaulttool #tyok)
         (setstack _stakki)
         
        )
     



     (MESSAGE "\n\nInstallation of CIM's HTML-Manual completed.\nIt was installed to CIM:DOCS/MANUAL/\n\n\nCIM's Official Home Page located at: http://www.netti.fi/~jet/cim/ and http://www.saunalahti.fi/~jet3/cim/ \n")

     )
     (MESSAGE "CIM is not installed correctly! (No CIM: assign.) Can't update.")
)


(COMPLETE 100)

; end of installation

(EXIT)

