;********************************************************************************
;      ______        __   
;     /_  __/       /_/  
;      / /  ______ __   ______
;     / /  / ____// /  / ____/
;  __/ /_ _\__  // /_ _\__  /   PPC
; /_____//_____//___//_____/  
;
; $VER: Isis 0.86 (January-29-1998) 
; Installer by Robert C. Reiswig ©1997,1998 
; Isis @1997-1998 by phase5 digital products
;
; If you wish to use any part of this installer you must ask. May not be 
; integrated/placed into any other package! You many not make any changes!
; Changes, suggestions or problems: vgr@best.com
;********************************************************************************
(set vernum1 (getversion "IsisPPC"))
(set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
(set isisver (cat ver1 "." rev1))
(set where "ram:")

;********************************************************************************
; Set Defaults Strings (English)
;********************************************************************************
(if (= ver1 0) (set isisver ""))
(set #about (cat "\n\n\nWelcome to IsisPPC " isisver "\n\nMPEG Player for CyberGraphX V3 and PowerPC with Direct CyberVision64/3D Support.\n\n©1997-1998 by phase5 digital products") )
(set #needPPC "\n\nIsisPPC must have a PPC installed. The installer did not find 'libs:ppc.library, this is just a note.\n\nIf you have a PPC please press 'Proceed'.")
(set #todo-prompt "\nWhat would you like to do?\n")
(set #copybin " Install/Update IsisPPC") 
(set #updatelibs " Install/Update Isis Libs")
(set #copydocs " Copy Isis Docs") 
(set #wherePPC "Where would you like to install IsisPPC? A directory called 'IsisPPC' will be created there.")
(set #wheredocs "Where would you like to install the IsisPPC Docs?")

(set #wheregtlibs "Where do you wish to install gtlayout.library used by IsisPPC? The default is 'SYS:Libs'")
(set #byebye (cat "\nIsisPPC Install Complete!\n\n" ))

(set #whatcdrom "What MPEG-Video CD track driver would you like to install?")
(set #whatcdplace "\nWhere do you wish to install the CD track driver for the: ")

;*********************************************************************************
; German Strings
;*********************************************************************************
(if (= @language "deutsch")
(
 (set #about (cat "\n\n\nWillkommen zu IsisPPC " isisver "\n\nMPEG Player für CyberGraphX V3 und PowerPC mit direkter CyberVision64/3D Unterstützung.\n\n©1997-1998 by phase5 digital products") )
 (set #needPPC "\n\nIsisPPC benötigt einen PPC. Der Installer konnte 'libs:ppc.library' nicht finden, dies ist nur eine Warnung.\n\nWenn Sie einen PPC haben, klicken Sie bitte auf 'Weiter'.")
 (set #todo-prompt "\nWas möchten Sie tun?\n")
 (set #copybin " Installieren/Updaten von IsisPPC")
 (set #updatelibs " Installieren/Updaten der Isis Libs")
 (set #copydocs " Kopieren der Isis Docs")
 (set #wherePPC "Wo möchten Sie IsisPPC installieren? Ein Verzeichnis namens 'IsisPPC' wird erstellt.")
 (set #wheredocs "Wo möchten Sie die IsisPPC Docs installieren?")

 (set #wheregtlibs "Wo möchten Sie die von IsisPPC benutzte gtlayout.library installieren? Voreingestellt ist 'SYS:Libs'")
 (set #byebye (cat "\nIsisPPC Installation komplett!\n\n" ))

 (set #whatcdrom "Welchen MPEG-Video CD Treiber möchten Sie installieren?")
 (set #whatcdplace "\nWo möchten Sie den CD Treiber installieren für das Laufwerk: ")
)
)

;*********************************************************************************
; Welcome Message
;*********************************************************************************
(message #about)  (welcome)
(if (= (exists ("libs:ppc.library")) 0) (message #needPPC))

;*********************************************************************************
; Ask what to do
;*********************************************************************************
(set whattodo 15)

(set ToDo (askoptions (choices  #copybin #updatelibs #copydocs) 
                      (prompt #todo-prompt)
                      (help #todo-prompt)
                      (default whattodo)
          )
) 

;********************************************************************
; Copy Isis bin if wanted
;********************************************************************
(if (IN ToDo 0) 
 (  
   (set where   (askdir (prompt #wherePPC)
                        (help   #wherePPC)
                        (default "RAM:")
                )
   )

  (if (< (exists (tackon where "IsisPPC")) 2) (makedir (tackon where "IsisPPC") (infos)) )
  (set whereisis (tackon where "IsisPPC")) 

  (if (exists "IsisPPC")
   (if (= (exists (tackon whereisis "IsisPPC.info")) 0)
    (copylib (source "IsisPPC") (dest whereisis) (newname "IsisPPC") (infos) (optional "nofail"))
    (copylib (source "IsisPPC") (dest whereisis) (newname "IsisPPC") (optional "nofail"))
   )  
  ) 


 )
)

;*********************************************************************************
; Ask where & Copy lib                                                           
;*********************************************************************************
(if (IN ToDo 1) 
 (  
  (if (> (exists "libs/gtlayout.library") 0)
   (
    (set wherelibs   (askdir  (prompt #wheregtlibs)
                              (help   #wheregtlibs)
                              (default "SYS:libs")
                     )
    )
  
    (copylib (source "libs/gtlayout.library") (dest wherelibs) (optional "nofail") ) 
   )
  )

  (set cdrom (askchoice  (choices "None" "JVC" "MMC" "NEC" "Philips" 
                                  "Philips CDD2000" "Philips CDD2600" 
                                  "Pioneer" "Plextor" "Ricoh 1420" "Sony" "Teac" "Toshiba" "Yamaha"  
                                  (prompt #whatcdrom)
                                  (help #whatcdrom)
                                  (default 0)
                         )
             )     
  )
  
  (if (= cdrom 1)  (set cd "JVC"))             (if (= cdrom 2)  (set cd "MMC"))
  (if (= cdrom 3)  (set cd "NEC"))             (if (= cdrom 4)  (set cd "Philips")) 
  (if (= cdrom 5)  (set cd "PhilipsCDD2000"))  (if (= cdrom 6)  (set cd "PhilipsCDD2600"))     
  (if (= cdrom 7)  (set cd "Pioneer"))         (if (= cdrom 8)  (set cd "Plextor"))
  (if (= cdrom 9)  (set cd "Ricoh1420"))       (if (= cdrom 10) (set cd "SONY"))
  (if (= cdrom 11) (set cd "Teac"))            (if (= cdrom 12) (set cd "Toshiba"))
  (if (= cdrom 13) (set cd "Yamaha"))         

  (if (> cdrom 0)
   (
    ;(if (= whereisis 0) (set cddefault 1) (set cddefault 0) )
    (if (= whereisis 0) (set whereisis "RAM:")) 

    (set cdplace (askchoice  (choices (cat whereisis "") (cat wherelibs "")
                                      (prompt (cat #whatcdplace cd "\n"))
                                      (help   (cat #whatcdplace cd "\n"))
                                      (default 0)
                             )
                 )     
    )
  
    (if (= cdplace 0) (set wherecd whereisis))    (if (= cdplace 1) (set wherecd wherelibs))

    (if (< (exists (tackon wherecd "BurnIt_Drivers")) 2) (makedir (tackon wherecd "BurnIt_Drivers")) )
    (if (< (exists (tackon wherecd "BurnIt_Drivers/BurnIt_CDRom")) 2) (makedir (tackon wherecd "BurnIt_Drivers/BurnIt_CDRom")) )

    (copylib (source "libs/BurnIt_Master.driver") (dest wherecd) (optional "nofail") ) 
    (copylib (source (cat "libs/BurnIt_Drivers/BurnIt_CDRom/" cd "_CDRom.driver")) 
             (dest (tackon wherecd "BurnIt_Drivers/BurnIt_CDRom")) 
             (optional "nofail") 
    ) 

   )
  )


 )
)

;********************************************************************
; Copy Docs
;*******************************************************************
(if (IN ToDo 2) 
 (  
  (set wheredocs   (askdir  (prompt #wheredocs)
                            (help   #wheredocs)
                            (default whereisis)
                   )
  ) 

  (set guidelanguage "E")
  (if (= @language "deutsch") (set guidelanguage "D"))

  (copyfiles (source (cat "IsisPPC_" guidelanguage ".guide")) (dest wheredocs) (infos)) 

 )
)

;*********************************************************************************
; Exit                                                           
;*********************************************************************************
(set @default-dest (tackon where "IsisPPC"))
(if (> (exists ("c:multiview")) 0) (set #mpath "c:") )
(if (> (exists ("sys:Utilities/multiview")) 0) (set #mpath "sys:Utilities") )
(run (cat "run " #mpath "/multiview " (cat "IsisPPC_" guidelanguage ".guide") ) )
(exit #byebye)
