; $VER: Installazione Picasso 1.0 © Euro Digital Equipment (15 Febbraio 1994)
; Script per installare il software della Picasso
; utilizzabile con il programma Installer Commodore

(complete 0)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; NAMING SECTION
;

(set #CompanyName     "Euro Digital Equipment") ; name of the company
(set #Picasso         "Picasso-II")             ; name of the board
(set #PicassoSoft     "PicassoII-Software")     ; title of this software
(set #ChangeScreen    "ChangeScreen")           ; screen promotion commodity
(set #ChangeScreenG   "ChangeScreen.Guide")     ; screen promotion help file
(set #PicassoSwitch   "PicassoSwitch")          ; monitor switch commodity
(set #VillageLib      "village.library")        ; library to control the hardware
(set #VilIntuiSupLib  "vilintuisup.library")    ; library for high level use
(set #AmigaGuideLib   "amigaguide.library")
(set #MonitorFile     "Picasso")                ; monitor file -> DEVS:Monitors
(set #Bildschoner     "StyxBlanker")            ; Commodity for blanking
(set #IntuiSpeed      "IntuiSpeed")             ; benchmark program for gfx actions

(set #defaulttarget   "WORK:")                  ; default destination dir

(set #ViewIFF         "ViewIFF")                ; name of iff viewer
(set #ViewGIF         "ViewGIF")                ; name of gif viewer
(set #ViewJPEG        "ViewJPEG")               ; name of jpeg viewer
(set #Play            "Play")                   ; name of anim player
(set #PlayMPEG        "PlayMPEG")               ; name of MPEG anim player
(set #IntuiView       "IntuiView")              ; name of viewer frontend

(set #PPLite          "Personal Paint Lite") ; name for the paint program
(set #Reflections     "PicassoII_rgb")       ; name for the paint program

(set #TempDir         "T:PicInstTemp")

;==========================================================================
; Disk names

(set #PPaintDisk      "Install PPaint Lite"); name of the disk with PPaint
(set #LastDisk        "Install Last")       ; Pics and Sources

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; LANGUAGE SECTION
;
; Questo script supporta solo il linguaggio italiano!
;


(set default_lang 4)

(set #bad-kick
(cat "Devi usare almeno il kickstart 2.0 per usare la scheda Picasso-II !"
))

(set #end-message
(cat "La tua scheda Picasso è ora pronta all'uso. Un reset _non_ è "
     "necessario. Lancia il programma di preference \"ScreenMode\" "
     "e scegli uno dei nuovi modi Picasso.\n\nBuon lavoro!"
))

(set #introduction
(cat "Questo programma installerà il software per la tua scheda grafica "
      #Picasso ".\n\n Verrà effettuato tutto automaticamente tenendo conto "
      "della versione del sistema operativo.\n\n Senza il tuo permesso "
      "l'installazione non effettuerà cambiamenti su files importanti, "
      "come la \"S:Startup-Sequence\"."
))

(set #ask-installdir
(cat "Scegli una directory in cui verrà creato il cassetto contenente "
     "il software per la " #Picasso "."
))

(set #ask-installdir-help
(cat "Oltre ad alcuni file che verranno copiati nella partizione "
     "di sistema del tuo hard-disk in alcune directory standard, "
     "ci sono altri programmi per la " #Picasso " da installare.\n\n"
     "Ti viene chiesto adesso di indicare dove preferisci installarli. "
     "Ricorda che verrà creato dal programma un cassetto apposito partendo "
     "dalla posizione che specificherai. Generalmente è "
     "sufficiente specificare solo una partizione di Hard-Disk."
))

(set #copy-villagelib
(cat "Si deve copiare \"" #VillageLib "\" in \"Sys:Expansion\". "
))

(set #help-villagelib
(cat "Questa libreria è l'interfaccia tra la scheda " #Picasso " ed "
     "il sistema operativo. Senza di essa la scheda non sarà visibile. "
     "Questa libreria viene attivata dal comando \"BindDrivers\"."
))

(set #copy-amigaguidelib
(cat "Si deve copiare \"" #AmigaGuideLib "\" in \"Libs:\". "
))

(set #help-amigaguidelib
(cat "Alcuni programmi richiedono la \"" #AmigaGuideLib "\" per offrire"
     "un aiuto sensibile al contesto."
))

(set #copy-iffparselib
(cat "Si deve copiare la \"iffparse.library\" in \"Libs:\"."
))

(set #help-iffparselib
(cat "Alcuni programmi richiedono la \"iffparse.library\" per visualizzare"
     "le immagini IFF."
))

(set #copy-localelib
(cat "Si deve copiare la  \"locale.library\" in \"Libs:\"."
))

(set #copy-vilintuisuplib
(cat "Si deve copiare la \"vilintuisup.library\" in \"Libs:\"."
))

(set #help-vilintuisuplib
(cat "La \"vilintuisup.library\" è richiesta da tutti i programmi che"
     "utilizzano schermi con più di 256 colori. "
))

(set #copy-monitorfile
(cat "E' necessario copiare il monitor-file. Grazie a questo file è "
     "possibile trovare le nuove risoluzioni nei requester "
     "standard delle risoluzioni grafiche (\"ScreenMode\")."
))

(set #copy-monitorfile-help-2.0
(cat "Per avere le nuove risoluzioni " #Picasso " serve un file "
     "\"monitor\" chiamato \"" #MonitorFile "\". Normalmente questo "
     "file deve risiedere in \"Devs:Monitors\".\n"

     "Visto che stai ancora "
     "usando il sistema operativo 2.0, il monitor file viene messo in "
     "\"Sys:WBStartup\" poiché è un programma che deve venire eseguito "
     "all'attivazione del computer. Nel 2.0 infatti i monitor file standard "
     "solo dei testi.\nTi consigliamo di aggiornare il tuo sistema operativo "
     "al 2.1 o 3.1 al più presto per ovviare a questo problema.\n"

     "In caso volessi disabilitare la " #Picasso ", dovresti "
     "semplicemente rimuovere il monitor file dal cassetto "
     "\"WBSTartup\"."
))

(set #copy-monitorfile-help
(cat "Per avere le nuove risoluzioni " #Picasso " serve un file "
     "\"monitor\" chiamato \"" #MonitorFile "\". Normalmente questo "
     "file deve risiedere in \"Devs:Monitors\" e viene attivato "
     "automaticamente dalla \"Startup-Sequence\".\n"

     "In caso volessi disabilitare la " #Picasso ", dovresti "
     "semplicemente rimuovere il monitor file dal cassetto "
     "\"Devs:Monitors\"."
))

(set #copy-changescreen
(cat "Dovresti copiare entrambe le commodity in \"Sys:WBStartup\"."
))

(set #copy-commodities
(cat "Vengono ora copiate due commodity. Per maggiori informazioni premi "
     "\"Aiuto\". Ti consigliamo di copiarle: le potrai sempre rimuovere "
     "in seguito."
))

(set #copy-commodities-help
(cat "StyxBlank è un programma per conservare i fosfori del tuo monitor. "
     "Dopo non avere usato il computer per un certo numero di secondi "
     "lo schermo diventa nero ed alcune luminose e colorate linee rimbalzano "
     "qua e là, sfruttando le nuove capacità della scheda Picasso-II.\n\n"

     "ChangeScreen assolve ad un compito ben diverso. Permette di "
     "\"promuovere\" i modi grafici di quei programmi che non lo "
     "consentono internamente in modo da sfruttare i nuovi schermi Picasso.\n\n"

     "Installando entrambi questi programmi in \"Sys:WBStartup\" "
     "verranno attivati automaticamente ogni volta che si riavvia il computer."
))

(set #copy-tools
(cat "Some usefull tools may be copied to " "Tools" "."
))

(set #copy-tools-help
(cat "There are tools for creating your own resolutions, reporting errors "
     "to find bugs, check the hardware or make a hardcopy from special screens.\n\n"

     "Please check the files you want to install."
))

(set #copy-guide "copying AmigaGuide files ... ")

(set #copy-guide-help
(cat "Now the AmigaGuide files will be copied to the destination directory. "
     "If you don't want to copy the files, skip this part."
))

(set #append-guidedir-help
(cat "To provide, that all programs with context sensitive help will "
     "find their help text, an additional line has to be appended to the "
     "file \"ENVARC:AmigaGuide/PATH\"."
))

(set #append-guidedir
(cat "Append a line to \"ENVARC:AmigaGuide/PATH\"."
))

(set #ask-guide
(cat "Some programs have AmigaGuide help files to provide an interactive "
     "help. Where should these files be copied?"
))

(set #ask-guide-help
(cat #ChangeScreen " has an interactive, context sensitive help "
     "facility. Move the mouse pointer upon a gadget and press HELP to "
     "get a help text for that gadget. To do so, it needs the special "
     "AmigaGuide help file \"" #ChangeScreenG "\", where the text for "
     "every gadget is located."
))

(set #copy-picassoswitch
(cat "PicassoSwitch è una Commodity che permette di passare manualmente "
     "tra una modalità grafica Picasso e una normale. Lo desideri installare?"
))

(set #copy-picassoswitch-help
(cat "Qualche volta può essere utile passare tra una modalità grafica "
     "Picasso e quella Amiga. PicassoSwitch permette di fare questa "
     "con la presione di alcuni tasti. Ti può essere utile questo "
     "solamente se un programma funziona in modo strano e non reagisce "
     "come aspettato."
))

(set #ask-scanrate
(cat "Scegli la massima frequenza orizzontale di scansione che tuo monitor può gestire. "
     "Se non sai esattamente quale sia il valore massimo, premi il pulsante \"Aiuto\" per "
     "avere maggiori informazioni. ATTENZIONE!! QUESTA OPERAZIONE PUO DANNEGGIARE "
     "IL TUO MONITOR se compiuta con superficialità!!!"
))

(set #ask-scanrate-help
(cat "La velocità di scansione orizzontale rappresenta il numero di linee "
     "che un monitor può mostrare ogni secondo. I monitor da 14\" non "
     "supportano, di regola, più di 38 kHz, mentre monitor più grandi si "
     "spingono anche a 57 o 64 kHz.\n\n"
     "Inserire un valore più elevato di quello supportato può causare "
     "seri danni al monitor! Percui si deve leggere con estrema attenzione "
     "il manuale tecnico del monitor.\n"
     "Se proprio non si riescono a trovare queste informazioni, si può "
     "procedere per tentativi, partendo da 31 kHz, restando pronti a spegnere "
     "il monitor immediatamente in caso di stranezze o fischi. Si consiglia "
     "di leggere con estrema attenzione le pagine 17-19 e 24-25 del manuale della Picasso. Se restano "
     "ancora dei dubbi, non esitate a contattare il vostro rivenditore o noi direttamente "
     "(trovate i nostri recapiti a pagina 86 del manuale).\n\n"
     "La frequenza di 15kHz può essere usata solo da monitor di classe Commodore 1084 se siete dotati dello speciale cavetto. Oppure va usata se volete usare il Video Encoder con monitor in grado di usare frequenze così basse (1940, 1942, 1960=.\n\n"
     "I monitor Commodore 1940/1942 vanno settati a 31kHz, mentre il 1960 va bene fino a 38kHz."
     ))

(set #change-villagetooltype
(cat "Scegli \"Procedi\" per cambiare il valore dello scan rate orizzontale "
     "al valore che hai scelto. Il nuovo valore sarà inserito come tooltype "
     "nell'icona \"village.library.info\".\n\n"
))

(set #change-villagetooltype-help
(cat "Se selezioni \"Procedi\" la frequenza che hai scelto prima sarà attivata "
     "al prossimo reset del computer. E' sempre possibile modificare questo "
     "valore manualmente agendo sui tooltype dell'icona \"village.library\" "
     "posizionata nel cassetto \"Expansion\" della partizione di sistema "
     "del tuo hard-disk."

     "E' una buona idea quella di leggersi con attenzione le pagine del "
     "manuale dedicate a questo argomento. Sia la Euro Digital Equipment che "
     "la Village Tronic declinano espressamente ogni responsabilità da danni "
     "causati al proprio monitor per un'errata impostdelle frequenze."
))

(set #ask-driversoftware
(cat "Seleziona tutti i programmi per i quali desideri installare "
     "il driver specifico per la Picasso."
))

(set #ask-driversoftware-help
(cat "Molti programmi permettono di usare direttamente modalità "
     "TrueColor e HiColor della Picasso. Per permettere questo, "
     "però, si deve collocare al posto giusto il rispettivo "
     "\"driver\". Quindi noi forniamo questi driver per i più "
     "famosi e conosciuti programmi. Per sapere esattamente dove "
     "installarli e come usarli, si rimanda alla consultazione dei "
     "manuali dei rispettivi programmi."
))

(set #copy-localefiles
(cat "Copying LOCALE files ..."
))

(set #copy-locale-help
(cat "Some programs we deliver support the locale feature of the "
     "operation system. This is available since OS 2.1. Now special "
     "files for each supported language should be copied to the "
     "directory \"Sys:Locale\". Please confirm, if you want to copy "
     "the files now."
))

(set #copy-adprosaver
(cat "Copio il saver di AdPro ..."
))

(set #ask-adprodir
(cat "Scegli la directory per il saver di AdPro:"
))

(set #ask-adprodir-help
(cat "ADPro è strutturato su molte directroy per operatori speciali "
     "e moduli. Questi includono \"savers\" per diversi formati di "
     "immagini. ADPro è supportato con un saver speciale che \"salva\" "
     "nella memoria grafica della scheda Picasso e non sul disco. Il "
     "saver verrà copiato in \"ADPro:Savers2\"\n."
     "Per visualizzare un'immagine, scegli il saver PICASSO e seleziona "
     "\"save\"."
))

(set #copy-imagefxrender
(cat "Copio il modulo di render per ImageFX ..."
))

(set #ask-imagefxdir
(cat "Scegli una directory per il modulo di ImageFX:"
))

(set #ask-imagefxdir-help
(cat "ImageFX è in grado di mostrare immagini in TrueColor e HiColor. "
     "per questo il programma richiede un driver di rendering speciale. "
     "Questo dovrebbe essere copiato in una directory \"Modules/Render\". "
     "Dopo avere copiato devi selezionare il modulo da usare. Consulta "
     "la documentazione per questo."
))

(set #copy-real3dlib
(cat "Copio la libreria per Real3D ..."
))

(set #copy-imagemaster
(cat "Copio il modulo di ImageMaster ..."
))

(set #ask-imagemasterdir
(cat "Scegli una directory per il modulo di rendering di ImageMaster:"
))

(set #ask-imagemasterrexxdir
(cat "Scegli una directory per lo script ARexx di ImageMaster:"
))

(set #ask-imagemasterdir-help
(cat "ImageMaster ha la possibilità di mostrare immagini direttamente "
     "su uno schermo della Picasso con un modulo di render ed uno "
     "script ARexx, entrambi forniti. Per questo è necessario copiare "
     "il modulo di rendering in \"CMPI:\" e lo script ARexx in \"RXPI:\".\n\n"
     "Per configurare ImageMaster, leggi il manuale."
))

(set #copy-reflections
(cat "Copio il modulo di Reflections ..."
))

(set #ask-reflectionsdir
(cat "Scegli una directory per il modulo di Reflections:"
))

(set #ask-reflectionsdir-help
(cat "Reflection ha la possibilità di effettuare rendering "
     "direttamente nella memoria grafica della Picasso. Per "
     "fare questo è necessario lanciare un modulo mentre Reflections "
     "è attivo. Il modulo deve essere copiato nella directory in cui "
     "tutti gli altri moduli sono locati."
))

(set #IFF-Desc "an IFF picture viewer")
(set #GIF-Desc "a GIF picture viewer")
(set #JPEG-Desc "a JPEG picture viewer")
(set #Play-Desc "a film like player program")
(set #PlayMPEG-Desc "a MPEG player program")
(set #IntuiView-Desc "a Workbench frontend")

(set #ask-viewer
(cat "Do you want to copy the following programs which can display "
     "images saved in special file formats? Please mark the programs "
     "you want to copy."
))

(set #ask-viewer-help
(cat "Images may be saved in different ways (compressed or not compressed, "
     "colored or black and white etc.). To handle this variety there are "
     "different file formats like IFF or GIF. If you like to show images "
     "saved in the listed file formats please mark the suitable viewer.\n\n"
     "If you proceed you will be asked for a directory, where the viewer "
     "should be copied.\n\n"
     "\"" #IntuiView "\" is a workbench program with a window and a listview."
     " It acts like a "
     "frontend for the other viewers. It has a analyse scheme to determine "
     "the correct format of a file. You can easily adapt this scheme for new "
     "file formats.\n\n"
     "The two player programs " #Play " and " #PlayMPEG " are able to display "
     "animation files. Those files consist of many pictures, which can be "
     "displayed like a film. MPEG is a file format, which highly compress "
     "animations (upto compression factors like 1:15). You can use " #Play
     " only, if you also install " #PlayMPEG "."
))

(set #ask-development
(cat "In caso tu voglia sviluppare programmi che traggano vantaggio della "
     "Picasso, è necessario che tu installi autodoc, include-file, "
     "librerie e programmi di esempio in una directory di tua scelta. "
     "Vuoi farlo ora?"
))

(set #ask-development-help
(cat "La Picasso può gestire schermi con più di 256 colori, ma per farlo "
     "devi ricorrere alla librerie \"vilintuisup.library\" per accedere "
     "a tutte le possibilità offerte dalla Picasso. Questa documentazione "
     "serve proprio a questo scopo."
))

(set #yes     "Sì")
(set #no      "No")
(set #proceed "Procedi")
(set #skip    "Salta")

(set #copy-development
(cat "Copio tutti i files necessari..."
))

(set #ask-develdir
(cat "Scegli una directory per i files di sviluppo:"
))

(set #ask-develdir-help
(cat "Scegli una directory in cui copiare i files di sviluppo (autodoc, "
     "include, esempi). Questa directory deve essere esistente.\n\n"
     "Il programma di installazione creerà alcune sotto-directory aggiuntive."
))

(set #ask-disk-last
(cat "Inserisci il disco\n\n"
     "Inastall Last\n\n"
     "in un drive!"
))

(set #ask-disk-last-help
(cat "Tu vuoi installare la documentazione per programmatori "
     "e/o le immagini di esempio. Questi dati risiedono "
     "sul secondo disco di installazione, chiamato \"Install Last\". "
     "Cerca questo disco ed inseriscilo in un drive."
))

(set #ask-pictures
(cat "Ci sono alcune immagini in differenti formati grafici "
     "nell'ultimo disco. Vuoi copiarli ora nel tuo harddisk?"
))

(set #ask-pictures-help
(cat "Probabilmente tu non hai pronte alcune immagini con 16 milioni "
     "di colori, quindi noi alleghiamo alcuni piccoli file di esempi. "
     "Tutte queste immagini sono nel secondo disco di installazione."
))

(set #copy-pictures "Copio le immagini di esempio ...")

(set #ask-picdir
(cat "Seleziona una directory in cui le immagini saranno copiate." ))

(set #ask-picdir-help
(cat "Le immagini e le animazioni saranno posizionate in sotto-directory, "
     "una per ogni formato di file. "
     "Devi scegliere adesso una directory che conterrà queste sotto"
     "-directory ed il loro contenuto."
))

(set #no-binddrivers
(cat "!ATTENZIONE!\n"
     "La chiamata al programma \"BindDrivers\" non è stata trovata nella "
     "\"S:Startup-Sequence\". E' indispensabile che \"BindDrivers\" sia "
     "chiamato lì per utilizzare la " #Picasso ". Per favore, assicurati "
     "di rimuovere il problema (ad esempio reinstallando la "
     "\"Startup-Sequence\" dalla directory \"S\" di un Workbench originale) "
     "e poi riattiva questa procedura di installazione. La procedura viene "
     "ora interrotta."
))

(set #change-startup-sequence
(cat "Per avviare il computer direttamente con uno schermo Picasso "
     "attivo per il Workbench, utilizzando il S.O. 2.0, è necessario "
     "manipolare la \"S:Strtup-Sequence\". Posso farlo ora?"
))

(set #change-startup-sequence-help
(cat "Normalmente i \"monitor file\" vengono attivati prima del "
     "comando \"IPrefs\". I monitor file standard S.O. 2.0 sono "
     "però semplici testi, mentre quello della scheda Picasso "
     "è invece un file eseguibile, stile S.O. 2.1, 3.0 e 3.1.\n"
     "Questo è il motivo percui dobbiamo eseguire il monitor "
     "file della Picasso in un modo diverso; ma questo deve essere "
     "fatto prima che il comando \"IPrefs\" venga lanciato. Non c'è "
     "altro modo se non l'inserimento di una linea addizionale "
     "subito dopo il comando \"BindDrivers\" nella "
     "\"Startup-Sequence\".\n\n"

     "Il nuovo comando sarà:\n"
     "    run >NIL: sys:WBStartup/Picasso\n\n"
))

(set #decompress-message
(cat "decompressing source files to " #TempDir ". Please wait. "
))

(set #not-enough-memory-on-t
(cat "There is not enough memory in " #TempDir " to dekompress all files. "
     "Please make sure, that there is enough room or assign T: to a place, "
     "where the installer can decompress all data."
))


;=============================================================================
; Assicurati che stai girando sotto V37

(if (< (/ (getversion) 65536) 37)
(
    (abort #bad-kick)
))

;=============================================================================
; se succede qualcosa, fai questo...

(onerror (run (cat "delete " #TempDir " QUIET FORCE ALL")))

;******************************************************************
;******************* FULL INSTALL *********************************
;******************************************************************

;=============================================================================
; say hi!

(welcome)

;=============================================================================
; Introduzione....

(message #introduction)

;=============================================================================
; first we will get the dirs we need

;=============================================================================
; first we must decompress the stuff we want to install
;
;(working #decompress-message)
;
;(set sourcedir (pathonly @icon))
;
;(set runstring (cat (tackon sourcedir "lhx ")
;		    "-w=" #TempDir " x "
;		    (tackon sourcedir "all.lha")
;	       )
;)
;
;=============================================================================
; if something unexpected happens, do this at least
;
;(onerror (run (cat "delete " #TempDir " QUIET FORCE ALL")))
;
;(if (> (run runstring) 0)
;(
;  abort #not-enough-memory-on-t
;))
;
;(set sourcedir #TempDir)

(set target (askdir (prompt #ask-installdir)
		    (help   #ask-installdir-help)
		    (default @default-dest)
		    (disk)
	    )
)
(set @default-dest target)

; Se non esiste, creiamola... non si sa mai!

(if (< (exists target) 2)
   (makedir target (infos))
)

; Aggiungiamo il cassetto

(makedir (tackon target #Picasso) (infos))

(set target (tackon target #Picasso ))

; Copia dei files di sistema al loro posto...

(set sourcedir (pathonly @icon))

(copylib   (prompt #copy-villagelib)
	   (help   #help-villagelib)
	   (source (tackon sourcedir "Expansion/village.library"))
	   (dest   "Sys:Expansion")
	   (infos)
	   (confirm "expert")
)

(complete 2)

(copylib   (prompt #copy-amigaguidelib)
	   (help   #help-amigaguidelib)
	   (source (tackon sourcedir "Libs/amigaguide.library"))
	   (dest   "LIBS:")
	   (infos)
	   (confirm "expert")
)

(complete 3)

(copylib   (prompt #copy-iffparselib)
	   (help   #help-iffparselib)
	   (source (tackon sourcedir "Libs/iffparse.library"))
	   (dest   "LIBS:")
	   (infos)
	   (confirm "expert")
)

(complete 4)

; not necessary, but will produce many prblems 2. June 1993
;
;(copylib   (prompt #copy-localelib)
;           (help   @copylib-help)
;           (source (tackon sourcedir "Libs/locale.library"))
;           (dest   "LIBS:")
;           (infos)
;           (confirm "expert")
;)
;
;(complete 5)

(copylib   (prompt #copy-vilintuisuplib)
	   (help   #help-vilintuisuplib)
	   (source (tackon sourcedir "Libs/vilintuisup.library"))
	   (dest   "LIBS:")
	   (infos)
	   (confirm "expert")
)

(complete 6)

;=============================================================================
; E' ora di inserire il monitor...
;
; ...ma prima controlliamo che BindDrivers sia nella Startup-Sequence!
;

(set runstring (cat "Sys:C/search" " Sys:S/Startup-sequence Binddrivers"
	       )
)

(if (= (run runstring) 5)
( ; then Binddrivers was deleted -- inform the user
  ; and abort the installation

  abort #no-binddrivers
))


(if (= (run "version libs:version.library 38") 5)
(  ; ##THEN##: Argh! Siamo sotto 2.0!!
   (copyfiles (prompt #copy-monitorfile)
	      (help   #copy-monitorfile-help-2.0)
	      (source (tackon sourcedir "devs/monitors/Picasso"))
	      (dest   "Sys:WBStartup")
	      (infos)
	      (confirm "average")
   )

   ; additional problem: when the system is booting with the
   ; Picasso monitor file in Sys:WBStartup, the monitor "PICASSO"
   ; is not known the time iprefs comes up. So it is not possible
   ; to really save a Picasso ScreenMode. To avoid this problem we
   ; manipulate the "S:Startup-sequence", but we ask the user before.

   (if (= (askbool (prompt  #change-startup-sequence)
		   (help    #change-startup-sequence-help)
		   (default 1)
		   (choices #proceed #skip)
	  )
	  1
       )
   (  (set runstring (cat (tackon sourcedir "c/edit")
			  " S:Startup-Sequence WITH="
			  (tackon sourcedir "s/edit_input")
		     )
      )
      (run runstring)
   ))


)
(  ; ##ELSE##: Staimo usando un S.O. 2.1 o superiore.... Fiuuu!
   (copyfiles (prompt #copy-monitorfile)
	      (help   #copy-monitorfile-help)
	      (source (tackon sourcedir "devs/monitors/Picasso"))
	      (dest   "DEVS:Monitors")
	      (infos)
	      (confirm "average")
   )
))

(complete 10)

;=============================================================================
; Qualche utile commodity...

(copyfiles (prompt #copy-commodities)
	   (help   #copy-commodities-help)
	   (source (tackon sourcedir "Commodities"))
	   (dest   "Sys:WBStartup")
	   (pattern "(Styx#?|#?Screen#?)")
	   (infos)
	   (confirm "average")
)

(complete 13)

;(makedir   (tackon target "Guide") (infos))
;(set destguidedir (askdir (prompt #ask-guide)
;			  (help   #ask-guide-help)
;			  (default (tackon target "Guide"))
;		  )
;)
;
;(copyfiles (prompt #copy-guide)
;	   (help   #copy-guide-help)
;	   (source (tackon sourcedir "Guide"))
;	   (dest   destguidedir)
;	   (pattern "#?.guide")
;	   (confirm "exopert")
;	   (infos)
;)
;
;(if (= (askbool (prompt  #append-guidedir)
;		(help    #append-guidedir-help)
;		(default 1)
;		(choices #proceed #skip)
;	)
;	1)
;(  (if (exists "ENVARC:AmigaGuide/PATH")
;     (set runstring ("echo >>ENVARC:AmigaGuide/PATH \"*n%s\"" destguidedir))
;     (set runstring ("echo >ENVARC:AmigaGuide/PATH \"%s\"" destguidedir))
;   )
;   (run runstring)
;))

(complete 15)

(if (= (run "version libs:version.library 38") 0)
(  ; 2.1 or higher, locale OK
   (set QualeLocale (askoptions (prompt "Quale localizzazione vuoi installare?")
                                (help   "Scegli quali cataloghi vuoi che vengano resi disponible nella directory \"LOCALE:\".")
                                (choices "Italiano" "Inglese" "Tedesco")
                                (default 1)
                    )
   )

   (if (< (exists "locale:catalogs" (noreq)) 2)
       (makedir "LOCALE:catalogs")
   )

   (if (IN QualeLocale  0)
   (
       (if (< (exists "locale:catalogs/Italiano" (noreq)) 2)
           (makedir "LOCALE:catalogs/Italiano")
       )
       (set runstring (cat (tackon sourcedir "c/LHX ")
                           "-fw=Locale:Catalogs/Italiano x " 
                           (tackon sourcedir "locale/catalogs/Italiano.lha")
                      )
       )
       (if (> (run runstring) 0)
           (message "Ci sono problemi con la scompressione dei dati. Devo saltare questa parte dell'installazione.")
       )
   ))
   
   (if (IN QualeLocale 1)
   (
       (if (< (exists "locale:catalogs/English" (noreq)) 2)
           (makedir "LOCALE:catalogs/English")
       )
       (set runstring (cat (tackon sourcedir "c/LHX ")
                           "-fw=Locale:Catalogs/English x " 
                           (tackon sourcedir "locale/catalogs/English.lha")
                      )
       )
   
       (if (> (run runstring) 0)
           (message "Ci sono problemi con la scompressione dei dati. Devo saltare questa parte dell'installazione.")
       )
   ))
   
   
   (if (IN QualeLocale 2)
   (
       (if (< (exists "locale:catalogs/Deutsch" (noreq)) 2)
           (makedir "LOCALE:catalogs/Deutsch")
       )
       (set runstring (cat (tackon sourcedir "c/LHX ")
                           "-fw=Locale:Catalogs/Deutsch x "
                           (tackon sourcedir "locale/catalogs/Deutsch.lha")
                      )
       )
   
       (if (> (run runstring) 0)
           (message "Ci sono problemi con la scompressione dei dati. Devo saltare questa parte dell'installazione.")
       )
   
   ))
))

(complete 17)

;=============================================================================
; Installiamo i tools ...

(if (askbool (prompt "Vuoi installare i tools aggiuntivi della Picasso?")
             (help (cat "Questi programmi sono:\n\n"
                        "PicassoMode  (editor di frequenze);\n"
                        "PicassoPhoto (screen grabber);\n"
                        "IntuiSpeed   (test velocità);\n"
                        "VilReport    (generatore bug-report).\n\n"
                        "Verranno copiati in un cassetto dedicato."
                    )
              )
              (default 1)
     )
(
    (makedir (tackon target "Tools") (infos))
    (set runstring (cat (tackon sourcedir "c/LHX ")
                        "\"-fw=" (tackon target "Tools\"" ) " x "
                        (tackon sourcedir "tools/tools.lha")
                   )
    )
    (run runstring)
))

(complete 20)

(if (< (exists (tackon target "Commodities")) 2)
   (makedir (tackon target "Commodities") (infos))
)

(copyfiles (prompt #copy-picassoswitch)
	   (help   #copy-picassoswitch-help)
	   (source (tackon sourcedir "Commodities/PicassoSwitch"))
	   (dest   (tackon target "Commodities"))
	   (infos)
	   (confirm "expert")
)

(complete 25)

;=============================================================================
; Copia i driver 

(if (>= @user-level 1)
(set drivermask (askoptions (choices "AdPro Driver"
				     "ImageFX Driver"
				     "Real3D Library"
				     "ImageMaster"
				     "Reflections"
				     "MaxxonCinema"
			    )
			    (prompt #ask-driversoftware)
			    (help   #ask-driversoftware-help)
			    (default 0)
		)
)
(set drivermask 0)
)

(if (IN drivermask 0) ; ADPRO
( (copyfiles (prompt #copy-adprosaver)
	     (source (tackon sourcedir "drivers/AdPro/PICASSO"))
	     (dest   (askdir (prompt #ask-adprodir)
			     (help   #ask-adprodir-help)
			     (default "ADPro:Savers2")
		     )
	      )
	      (optional) ; don't break if an error occurs
  )
))

(complete 28)

(if (IN drivermask 1) ; ImageFX
( (copyfiles (prompt #copy-imagefxrender)
	     (source (tackon sourcedir "drivers/ImageFX/Picasso"))
	     (infos)
	     (dest   (askdir (prompt #ask-imagefxdir)
			     (help   #ask-imagefxdir-help)
			     (default (cat @default-disk "ImageFX/modules/render"))
		     )
	      )
	      (optional) ; don't break if an error occurs
  )
))

(complete 31)

(if (IN drivermask 2) ; Real3D
( (copylib (prompt #copy-real3dlib)
	     (source (tackon sourcedir "drivers/Real3d/Picasso_r3d.library"))
	     (infos)
	     (dest   "LIBS:")
	     (optional) ; don't break if an error occurs
  )
  (message "La libreria \"Picasso_r3d.library\" è stata copiata in \"LIBS:\".")
))

(complete 34)

(if (IN drivermask 3) ; Imagemaster
( (copyfiles (prompt #copy-imagemaster)
	     (source (tackon sourcedir "drivers/ImageMaster/PicassoIM"))
	     (infos)
	     (dest   (askdir (prompt #ask-imagemasterdir)
			     (help   #ask-imagemasterdir-help)
			     (default "CMPI:")
		     )
	     )
	     (optional) ; don't break if an error occurs
  )
  (copyfiles (prompt #copy-imagemaster)
	     (source (tackon sourcedir "drivers/ImageMaster/PicassoView.rexx"))
	     (infos)
	     (dest   (askdir (prompt #ask-imagemasterrexxdir)
			     (help   #ask-imagemasterdir-help)
			     (default "RXPI:")
		     )
	     )
	     (optional) ; don't break if an error occurs
  )
))

(complete 37)

(if (IN drivermask 4) ; Reflections
( (copyfiles (prompt #copy-reflections)
	     (source (tackon sourcedir (cat "drivers/Reflections/" #Reflections)))
	     (infos)
	     (dest   (askdir (prompt #ask-reflectionsdir)
			     (help   #ask-reflectionsdir-help)
			     (default (cat @default-disk "reflections"))
		     )
	     )
	     (optional) ; don't break if an error occurs
  )
))

(complete 39)

(if (IN drivermask 5) ; MaxxonCinema
( (copyfiles (prompt #copy-reflections)
	     (source (tackon sourcedir "drivers/Cinema"))
	     (pattern "#?.library")
	     (infos)
	     (dest   "LIBS:")
	     (optional) ; don't break if an error occurs
  )
  (message "La libreria \"CinemaAusgabe.library\" è stata copiata in \"LIBS:\".")
))

(complete 41)

;=============================================================================
; copia i viewer

(if (askbool (prompt "Vuoi installare i viewer Picasso ver visualizzare le immagini?")
             (help (cat "Questi programmi sono:\n\n"
                        "ViewIFF   (Immagini IFF);\n"
                        "ViewJPEG  (Immagini JPEG);\n"
                        "ViewGIF   (Immagini GIF);\n"
                        "PlayMPEG  (Animazioni MPEG);\n"
                        "Play      (Animazioni MPEG);\n"
                        "IntuiView (Gestione viewer).\n\n"
                        "Verranno copiati in un cassetto dedicato."
                    )
              )
              (default 1)
   )
(
   (makedir (tackon target "Viewers") (infos))
   (set destviewerdir (tackon target "Viewers"))
    (set runstring (cat (tackon sourcedir "c/LHX ")
                        "\"-fw=" (tackon target "Viewers\"" ) " x "
                        (tackon sourcedir "viewers/viewers.lha")
                   )
    )
    (run runstring)
)

(complete 47)

   (textfile (prompt "Installo configurazione IntuiView")
	     (include (tackon sourcedir (cat "Viewer/IntuiView.prefs")))
	     (dest   (cat "ENVARC:IntuiView.prefs"))
	     (append "IFF:\n")
	     (append
	       (cat "#?,FORM????ILBM#?,"
		  (tackon destviewerdir #ViewIFF) " %s C\n"))
	     (append "\n")
	     (append "GIF:\n")
	     (append
	       (cat "#?,GIF8?a#?,"
		  (tackon destviewerdir #ViewGIF) " %s C\n"))
	     (append "\n")
	     (append "JPEG:\n")
	     (append
	       (cat "#?,??????JFIF#?,"
		  (tackon destviewerdir #ViewJPEG) " %s SCROLL \n"))
	     (append "\n")
	     (append "All the rest:\n")
	     (append
	       (cat "#?,#?,"
		  "run sys:Utilities/more %s\n"))
   )
)



(complete 75)

;=============================================================================
; copia i files di sviluppo 

(if (askbool (prompt #ask-development)
	     (help   #ask-development-help)
	     (choices #yes #no)
	     (default 0)    ; default is NO
    )
(
  (askdisk   (prompt #ask-disk-last)
	     (help   #ask-disk-last-help)
	     (dest   #LastDisk)
  )
  (makedir   (tackon target "Development") (infos))
  (copyfiles   (prompt #copy-development)
	       (source (cat #LastDisk ":Development"))
	       (all) (infos) (optional)
	       (dest   (askdir (prompt #ask-develdir)
			       (help   #ask-develdir-help)
			       (default (tackon target "Development"))
		       )
		)
  )
))

(complete 85)

;=============================================================================
; copia alcune immagini di esempio

(if (askbool (prompt #ask-pictures)
	     (help   #ask-pictures-help)
	     (choices #yes #no)
	     (default 1)    ; default is NO
    )
(
  (askdisk   (prompt #ask-disk-last)
	     (help   #ask-disk-last-help)
	     (dest   #LastDisk)
  )
  (makedir   (tackon target "Pictures") (infos))
  (copyfiles   (prompt #copy-pictures)
	       (source (cat #LastDisk ":Pictures"))
	       (all) (infos) (optional)
	       (dest   (askdir (prompt #ask-picdir)
			       (help   #ask-picdir-help)
			       (default (tackon target "Pictures"))
		       )
		)
  )
))

(complete 95)

;=============================================================================
; Selezione del tipo di monitor

(set frequenz (askchoice (choices "15 kHz"
				  "31 kHz"
				  "35 kHz"
				  "38 kHz"
				  "48 kHz"
				  "57 kHz"
				  "64 kHz"
			 )
			 (prompt #ask-scanrate)
			 (help   #ask-scanrate-help)
			 (default 1)
	       )
)


(if (= frequenz 1)
( (set frequenz "31kHz")
)
( if (= frequenz 2)
  ( (set frequenz "35kHz")
  )
  ( if (= frequenz 3)
    ( (set frequenz "38kHz")
    )
    ( if (= frequenz 4)
      ( (set frequenz "48kHz")
      )
      ( if (= frequenz 5)
	( (set frequenz "57kHz")
	)
	( if (= frequenz 6)
	  ( (set frequenz "64kHz")
	  )
	  ( if (= frequenz 0)
	    ( (set frequenz "15kHz")
	    )
	  )
	)
      )
    )
  )
))

(tooltype (prompt #change-villagetooltype)
	  (help   #change-villagetooltype-help)
	  (settooltype "MONITOR" frequenz)
	  (noposition)
	  (dest   (tackon "Sys:Expansion/" #VillageLib))
	  (confirm "expert")
)

(complete 100)

(working)

; "Say goodnight Gracy."

(user 1)
(if (= (run "Binddrivers") 5)
( ; then Binddrivers was deleted -- inform the user
  ; and abort the installation

  abort #no-binddrivers
)
(
   (if (= (run "version libs:version.library 38") 5)
   (  ; we are running a 2.0 system
      (run "Sys:WBStartup/Picasso")
   )
   (  ; we are running a 2.1 system or above
      (run "Sys:Devs/Monitors/Picasso")
   ))
))

(message #end-message)
(run (cat "delete " #TempDir " QUIET FORCE ALL"))


