;******************************************************************************** 
;
;CyberGraphics Install By Robert Reiswig ©1995
;For Frank Mariak 
;Thanks to ScottE for the EGS help! 
;
;********************************************************************************


;******************************************************************************** 
;
; Read All System information 
;
;********************************************************************************


(set cpu (database "cpu"))
(set vblank (database "vblank"))
(set graphmem (database "graphics-mem"))
(set totmem (database "total-mem"))
(set osver (/ (getversion "LIBS:version.library") 65536))
(if (= vblank "60") ((set blank "NTSC")) ((set blank "PAL")))
(set fastmem (- totmem graphmem))

( if (= osver 37) ( (set workbench "2.0")) ( if (= osver 38) ( (set workbench "2.1"))
( if (= osver 39) ( (set workbench "3.0")) ( if (= osver 40) ( (set workbench "3.1"))
( if (= osver 41) ( (set workbench "4.0")) )))))

(run "type >RAM:Cyber SYS:Expansion/village.library.info opt h")
(set runstring (cat "search" " RAM:Cyber "))

(set runstring1 (cat runstring "\"R=64\""))   (if (= (run runstring1) 0) (set MonitorIS 64))	  
(set runstring1 (cat runstring "\"R=57\""))   (if (= (run runstring1) 0) (set MonitorIS 57))
(set runstring1 (cat runstring "\"R=48\""))   (if (= (run runstring1) 0) (set MonitorIS 48))
(set runstring1 (cat runstring "\"R=38\""))   (if (= (run runstring1) 0) (set MonitorIS 38))
(set runstring1 (cat runstring "\"R=35\""))   (if (= (run runstring1) 0) (set MonitorIS 35))
(set runstring1 (cat runstring "\"R=15\""))   (if (= (run runstring1) 0) (set MonitorIS 15))
(set runstring1 (cat runstring "\"CUSTOM\"")) (if (= (run runstring1) 0) (set MonitorIS 99))	


(run "type >RAM:lan EnvArc:sys/locale.prefs opt h")
(set runstring (cat "search" " RAM:lan "))

(set english "")  (set german  "")

(set runstring1 (cat runstring "\"deutschland\""))   (if (= (run runstring1) 0) (set german1 "Deutsch"))
(set runstring1 (cat runstring "\"english\""))   (if (= (run runstring1) 0) (set english1 "English"))	  

;******************************************************************************** 
;
;ASK DEFAULT LANG
;
;********************************************************************************


(set #langQuestion (cat "The following were found in Locale:\n\n" english1 "\n"german1"\n\nSelect one of the installers supported Languages."))

(set LAN  (askchoice (choices "German (Deutsch)" "English"
			 (prompt #langQuestion)
	                 (help "Select a Language")
          		 (default lang)
	             )
          )
)




;******************************************************************************** 
;
;English Information
;
;********************************************************************************


(set #By (cat "Cybergraphics Software by:\n\nFrank Mariak\nfmariak@chaosengine.ping.de"
              "\n\n&\n\nThomas G.Sontowski\nmarvin@sub.ph-cip.uni-koeln.de"
              "\n\n\nInstaller By:\n Robert Reiswig - rcr@netcom.com"
         )
)





(set #MinReqOS (cat "The following are the MINIMUM REQUIREMENTS!\n"
                    "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
                    "Kickstart 3.x, **You only have " workbench "**\n\n" 
                    "PicassoII in linear mode *not segmented*\n\n"
                    "68020 or higher\n\n"
                    "2 MB of fast memory"                       
               ) 
)


(set #MinReqCp (cat "The following are the MINIMUM REQUIREMENTS!\n"
                    "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
                    "68020 or higher, **You only have " cpu "**\n\n"
                    "PicassoII in linear mode *not segmented*\n\n"
                    "Kickstart 3.x\n\n"                     
                    "2 MB of fast memory" 
               )
)  


(set #SysInfo (cat "Basic System Check, This Machine Has\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                   " \"" workbench "\" Version of OS\n\n"
                   " \"" cpu "\" Processor\n\n "
                   " \"" blank "\" Machine\n\n"
                   " \"" graphmem  "\" Total Free Chip Memory\n\n"
                   " \"" fastmem  "\" Total Free Fast Memory\n\n  \"" totmem "\" Total Free Memory\n\n"
              )
)


(set #WillInstall "\n\n\n\nThis installer will Move OR Delete the Current Graphic Boards's Drivers.  Please read the Docs if you have any question!\n")


(set #NeedChangeTool (cat "Currently your 'village.library'\n-The monitor file-\nis set to: "
                          MonitorIS "kHz\n\nIt must be set to 'Custom'!\nYou must first use the PicassoMode program\n"
                          "that came with your Picasso II to create a custom monitorfile. Then you need to change " 
                          "the tooltype to CUSTOM. Please read the Docs for PicassoMode to do this!!!\n\n"
                          "YOU MUST DO THIS NOW!"
                     )
)


(set #BackUpFiles "BackUp the Files")
(set #DeleteFiles "Delete the Files")
(set #ask-BackOrDelete "The Installer will Back up the Village Tronic Picasso II files to SYS:Storage/Village or SYS:Storage/EGS for EGS boards. What do you want it to do?")


(set #YES-ADPRO "Yes - Install ADPro Saver")
(set #NO-ADPRO "No - Don't Install ADPro Saver")
(set #ask-ADPRO "Do you wish to install the CyBERgraphics ADPro saver?")
(set #where-ADPRO "Where do you wish to Install the ADPro Saver?\n(The default is \"ADPRO:Savers2\")")


(set #wishtoinstall "Do you wish to install any of the following?")
(set #order "Order Form")
(set #guide "AmigaGuide File")
(set #devdocs  "Developer Documentation")
(set #versions "Versions - Shows Vers of Cybergraphics") 
(set #WhereStuffDir "Please select where you wish to put them.\n(A directory called \"CyberGraphics\" will be created there!)")

(set #Comming (cat "\nCOMING! (Planned Features)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                   "15/16/24 bit extension of the "normal" graphics.library, that means that "
                   "you can open 24bit screens as standard intuition screens and that you "
                   "can use all graphics.library functions on them as before. (with some "
                   "limitations of course because of the missing color lookup table)\n\n"
                   "Application to adjust the monitor parameters"
              )  
)
   

(set #Restrictions (cat "RESTRICTIONS\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                        "* In the Shareware release there are no custom modes available. "
                        "In the registered version there are no limitations of this kind "
                        "of course. You may define higher colordepth and refresh frequencies.\n"
                        "* There is only an AdPro driver in the shareware package. "
                        "There also exist drivers for Maxon Cinema 4D, Real3D, Photogenics, "
                        "PhotoWorx, AmaxIV ... more to come.\n"
                        "* If you are registered we grant support if you have any problems "
                        "or questions by email and/or smail. We can't do this for any person who "
                        "has problems with the unregistered release !\n"
                   )
)



(set #Updates (cat "Updates\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                   "When you become a registered user, you will get the latest registered "
                   "release of cybergraphics including a personalized graphics board driver.\n\n"
                   "The first update of the graphics board driver is for free, any forthcoming "
                   "update will cost DM 5 (US$ 5 outside EU) just to pay our posting&packaging "
                   "costs. email updates will be charge free. This offer is valid for registered users only of course."
              )
)



(set #REG (cat "REGISTRATION\n~~~~~~~~~~~~~\n"
               "The registration fee is DM50 or $30. You have to pay it to one of the"
               " following to get a full working version:\n\n"
               "          Frank Mariak       Thomas Sontowski        \n"
               "        Klosterstr. 7      Bensberger Marktweg 15\n"
               "        44135 Dortmund     51069 Köln            \n\n\n"
               "Feel free to contact us by email or smail if you have any questions."
          )
)





;******************************************************************************** 
;
;German Information
;
;********************************************************************************

(if (= LAN 0)
(


(set #By (cat "Cybergraphics Software von:\n\nFrank Mariak\nfmariak@chaosengine.ping.de"
              "\n\n&\n\nThomas G.Sontowski\nmarvin@sub.ph-cip.uni-koeln.de"
              "\n\n\nInstallerskript von:\n Robert Reiswig - rcr@netcom.com"
         )
)

(set #MinReqOS (cat "Folgendes sind die Minimalanforderungen !\n"
	          "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
                  "Kickstart 3.x, **Sie haben nur " Workbench "**\n\n"
                  "PicassoII im linear Modus *nicht segmentiert*\n\n"
                  "68020 oder höher\n\n"
                  "2 MB FAST Ram"
             )
)

(set #MinReqCP  (cat "Folgendes sind die Minimalanforderungen!\n"
                   "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
                   "68020 oder höher, **Sie haben nur eine " cpu "**\n\n"
                   "PicassoII im linear Modus *nicht segmentiert*\n\n"
                   "Kickstart 3.x\n\n"
                   "2 MB FAST Ram"
              )
)


(set #SysInfo (cat "Minimaler System Check, Dieser Rechner hat\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                   " Version \"" Workbench "\" des OS\n\n"
                   " \"" cpu "\" Prozessor\n\n "
                   " \"" blank "\" Gerät\n\n"
                   " \"" graphmem  "\" freier Chip Speicher\n\n"
                   " \"" fastmem  "\" freies Fast RAM\n\n  \"" totmem "\" freies RAM gesamt\n\n"
              )
)


(set #WillInstall "\n\n\n\nDieses Installerskript sichert oder löscht die aktuellen Grafikkarten Treiber.  Bitte lesen sie die Guidedatei bei Fragen!\n")


(set #NeedChangeTool (cat "Currently your 'village.library'\n-The monitor file-\nis set to: "
                          MonitorIS "kHz\n\nIt must be set to 'Custom'!\nYou must first use the PicassoMode program\n"
                          "that came with your Picasso II to create a custom monitorfile. Then you need to change " 
                          "the tooltype to CUSTOM. Please read the Docs for PicassoMode to do this!!!\n\n"
                          "YOU MUST DO THIS NOW!"
                     )
)


(set #BackUpFiles "Sichern der alten Dateien")
(set #DeleteFiles "Löschen der alten Dateien")
(set #ask-BackOrDelete "Der Installer sichert die Village Tronic Picasso II Dateien in SYS:Storage/Village oder SYS:Storage/EGS für EGS Karten. Was wollen sie tun?")


(set #YES-ADPRO "Ja - Installiere ADPro Saver")
(set #NO-ADPRO "Nein - Installiere ADPro Saver nicht")
(set #ask-ADPRO "Wollen Sie den CyBERgraphics ADPro saver installieren ?")
(set #where-ADPRO "Wohin wollen Sie den ADPro Saver installieren ?\n(The default is \"ADPRO:Savers2\")")


(set #wishtoinstall "Wollen Sie etwas von den folgenden Dateien installieren ?")
(set #order "Bestellformular")
(set #guide "AmigaGuide Datei")
(set #devdocs  "Entwickler Dokumentation")
(set #versions "Versions - Zeigt die Versionen von Cybergraphics") 
(set #WhereStuffDir "Bitte wählen sie einen Zielpfad.\n(Ein Verzeichnis \"CyberGraphics\" wird automatisch erstellt!)")

(set #Comming (cat "\nCOMING! (Geplante Features)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                   "15/16/24 bit Erweiterung der "normalen" graphics.library, das bedeutet, daß "
                   "man 24bit Bildschirme als Standard Intuition Bildschirme öffnen kann und "
                   "das alle graphics.library Funktionen wir zuvor darauf benutzt werden können "
                   "(mit Einschränkungen wegen der fehlenden Farbtabelle)\n\n"
                   "Ein Monitor Edit Tool"
              )  
)
   

(set #Restrictions (cat "RESTRICTIONS\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
                        "* In the Shareware release there are no custom modes available. "
                        "In the registered version there are no limitations of this kind "
                        "of course. You may define higher colordepth and refresh frequencies.\n"
			"* Es wird nur der AdPro Treiber in der Shareware Distribution "
			"mitgeliefert. Es existieren noch weitere Treiber für Maxon Cinema 4D,"
			"Real3D, Photogenics, PhotoWorx, AmaxIV ... Weitere werden wahrscheinlich "
			"in Kürze folgen.\n"
			"Falls Sie registriert sind, gewährleisten wir Support bei "
			"Problemen und Fragen über email & smail. Wir sind gerne bereit, Anregungen "
			"von nicht registrierten Usern entgegenzunehmen, sehen es aber nicht ein, "
			"auf jede EMail/Mail bzgl. Problemen/Bugs mit cybergraphics von nicht "
			"registrierten Usern einzugehen.\n"
                   )
)



(set #Updates (cat "Updates\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
			"Als registrierter Anwender erhalten Sie die neueste Version von "
			"cybergraphics mit einem auf sie persönlich registrierten Grafikkarten "
			"Treiber. Neu erscheinende Versionen der cybergraphics libraries "
			"und tools werden weiterhin über elektronische Netze veröffentlicht "
			"und können dann auch direkt von Ihnen ohne Einschränkungen genutzt "
			"werden. Neue Versionen des Grafikkarten Treibers werden Ihnen "
			"persönlich zugestellt (per smail bzw. email)\n"
			"Das erste Update des Grafikkarten Treibers bekommen Sie kostenlos "
			"zugestellt, alle weiteren werden Ihnen gegen einen Unkostenbeitrag von "
			"DM 5 (US$ 5 außerhalb der EU) umgehend zugestellt, falls sie den Postweg "
			"wünschen (email-Zusendung bleibt kostenfrei) "
			"Dieses Angebot gilt selbstverständlich nur für registrierte Benutzer.\n"
              )
)


(set #REG        (cat"REGISTRIERUNG\n~~~~~~~~~~~~~\n"
                     "Die Registrierungsgebühr beträgt DM50 or $30. Bei Interesse an einer Vollversion"
                     " einsenden an:\n\n"
                     "     Frank Mariak       Thomas Sontowski        \n"
                     "	  Klosterstr. 7      Bensberger Marktweg 15\n"
                     "	  44135 Dortmund     51069 Köln            \n\n\n"
                     "Bei eventuellen Fragen können Sie uns gerne per Post oder email kontaktieren."
                 )

)


))



;******************************************************************************** 
;
; Main Part of the Installer (Main Loop) 
;
;********************************************************************************

(message #by)

;******************************************************************************** 
; Check CPU & OS for Right versions 
;********************************************************************************
(if (< osver 39)  (abort #MinReqOS) )
(if (< cpu 68020) (abort #MinReqCP) )

;******************************************************************************** 
;
;ASK DEFAULT GFX board
;
;********************************************************************************


(set #board (cat "\nPlease Select the Graphics Board you wish to install Cybergraphics for:\n"))

(set board (askchoice (choices "Picasso II" "Spectrum" "Piccolo"
			 (prompt #board)
	                 (help "Select a Gfx Board")
          		 (default 0)
	             )
          )
)
;******************************************************************************** 
; Warning Messages 
;********************************************************************************
(message #SysInfo) 
(message #WillInstall)

;******************************************************************************** 
; Maksure the Monitor type is set to Custom 
;********************************************************************************
(if (< MonitorIS 99)
 (
  (if (= board 0) 
    (message #NeedChangeTool) 
  )
 )
)
;******************************************************************************** 
; Ask if to backup the Current OLDER libraries 
;********************************************************************************
(set keep (askchoice (choices #BackUpFiles #DeleteFiles)
			 (prompt #ask-BackOrDelete)
	                 (help   #ask-BackOrDelete)
          		 (default 0)
	  )
)

;******************************************************************************** 
; If backup TRUE then move all old files to
;         "SYS:Storage/Village" or "SYS:Storage/EGS"
;********************************************************************************
(if (= keep 0)
 (




 (if (= board 0)

  (
   (if (< (exists ("SYS:Storage/Village")) 2)
       (makedir ("SYS:Storage/Village") (infos)))  

   
   (complete 10)
   (if (> (exists ("libs:vilintuisup.library")) 0)
     (copylib (source "libs:vilintuisup.library") (dest "SYS:Storage/Village"))
   )
   
   (complete 20)
   (if (> (exists ("sys:Expansion/village.library")) 0)
       (copyfiles (source "SYS:Expansion/village.library") (dest "SYS:Storage/Village") (infos))
   )       
   
   (complete 30) 
   (if (> (exists ("Devs:Monitors/Picasso")) 0)
       (copyfiles (source "Devs:Monitors/Picasso") (dest "SYS:Storage/Village") (infos))
   ) 

  )
 )

 
 (if (> board 0)

  (
   (if (< (exists ("SYS:Storage/EGS")) 2)
       (makedir ("SYS:Storage/EGS") (infos)))  
 
  (complete 10)
   (if (> (exists ("SYS:WBStartup/E.S.P.")) 0)
       (copylib (source "SYS:WBStartup/E.S.P.") (dest "SYS:Storage/EGS") (infos) ))
   (complete 20)
   (if (> (exists ("SYS:WBStartup/EGSAmigaDriver")) 0)
       (copyfiles (source "SYS:WBStartup/EGSAmigaDriver") (dest "SYS:Storage/EGS") (infos))
   )       
    
   (complete 30) 
   (if (> (exists ("Devs:Monitors/EGS")) 0)
       (copyfiles (source "Devs:Monitors/EGS") (dest "SYS:Storage/EGS") (infos))
   ) 

  )
 )




 )
) 

;******************************************************************************** 
; Delete Old files from system
;********************************************************************************

(if (= board 0)
 (
  (delete "sys:Expansion/village.library")
  (delete "sys:Expansion/village.library.info")
  (delete "Devs:Monitors/Picasso")
 )
)


(if (> board 0)
 (
  (delete "SYS:WBStartup/EGSAmigaDriver")
  (delete "SYS:WBStartup/EGSAmigaDriver.info")
  (delete "SYS:WBStartup/E.S.P.")
  (delete "SYS:WBStartup/E.S.P..info")
  (delete "DEVS:Monitors/EGS")
  (delete "DEVS:Monitors/EGS.info")
 )
)


;******************************************************************************** 
; Copy over new Cyber files to system
;********************************************************************************
(copylib (source "libs/cybergraphics.library")  (dest "libs:"))
(copylib (source "libs/cyberintuition.library")  (dest "libs:"))
(copylib (source "libs/cyberlayers.library")  (dest "libs:"))
(copylib (source "libs/vilintuisup.library")  (dest "libs:")) 


(if (= board 0)
 (copyfiles (source "devs/monitors/Picasso")  (dest "devs:monitors") (infos) )    
)

(if (= board 1)
 (copyfiles (source "devs/monitors/Spectrum")  (dest "devs:monitors") (infos) )    
)

(if (= board 2)
 (copyfiles (source "devs/monitors/Piccolo")  (dest "devs:monitors") (infos) )    
)

;******************************************************************************** 
; Ask to copy the ADPRO driver
;********************************************************************************

(set adpro (askchoice    (choices #YES-ADPRO #NO-ADPRO)
			 (prompt #ask-ADPRO)
	                 (help   #ask-ADPRO)
          		 (default 0)
	   )
)

;******************************************************************************** 
; Ask WHERE to copy the ADPRO driver
;********************************************************************************
(if (= adpro 0)
 (

  (set adproDIR (askdir
                   (prompt #where-ADPRO)
                   (help #where-ADPRO)
                   (default "ADPRO:Savers2")
                   
                )
  )

  (copyfiles (source "drivers/CyBERgraphics") (dest adproDIR) (infos) )
 )
)


;******************************************************************************** 
; Ask to install DEVDOCS, Versions, Order, guide
;********************************************************************************
(set ToDo       (askoptions (choices #order #guide #devdocs #versions)
			    (prompt #wishtoinstall)
			    (help #wishtoinstall)
			    (default 63)
		)
)

;******************************************************************************** 
; Ask WHERE to install DEVDOCS, Versions, Order, guide
;********************************************************************************
(if (<> ToDo 0)
 (

  (set CyberDrawer (askdir (prompt #WhereStuffDir)
			   (help   #WhereStuffDir)
			   (default "Work:CyberGraphics")
		   )  
  )


  (if (< (exists (tackon CyberDrawer "CyberGraphics")) 2)
      (makedir (tackon CyberDrawer "CyberGraphics") (infos))
        
  )
	

  (set where (tackon CyberDrawer "CyberGraphics"))
  (set @default-dest CyberDrawer)

;******************************************************************************** 
; COPY selected stuff!
;********************************************************************************
  (if (IN ToDo 0)
   (
      
    (if (= LAN 0)  
      (copyfiles (source "Bestellformular")  (dest where) (infos) )    
    )
   
    (if (= LAN 1)
      (copyfiles (source "Orderform")  (dest where) (infos) )
    )       
     
   )
  )



  (if (IN ToDo 1) 
   (  

    (if (= LAN 0)  
      (copyfiles (source "CyBERgfx_D.guide")  (dest where) (infos) (newname "CyberGfx.guide"))    
    )
   
    (if (= LAN 1)
      (copyfiles (source "CyBERgfx_E.guide")  (dest where) (infos) (newname "CyberGfx.guide"))    
    )        

   )
  )



  (if (IN ToDo 2) 
   (  
     (if (< (exists (tackon where "DevDocs")) 2)
          (makedir (tackon where "DevDocs") (infos))
     )
     (copyfiles (source "devdocs")  (dest (tackon where "DevDocs")) (all) ) 
   )
  )



  (if (IN ToDo 3) 
   (  
     (copyfiles (source "Versions")  (dest where) (infos) )    
   )
  )


  

 
 )
)


;******************************************************************************** 
; How to get the REAL version and what coming!
;********************************************************************************

(message #Restrictions)
(message #Comming)
(message #Updates)
(message #REG)



