home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-02-24 | 36.8 KB | 1,148 lines |
- ;###################################################################################################
- ;###################################################################################################
- ;###
- ;### Multi purpose installer script
- ;### ==============================
- ;###
- ;### $VER: elCID_Install 0.7 (24.02.98)
- ;###
- ;### ©1998 by Carsten 'michelangelo' Scholling
- ;###
- ;###
- ;###
- ;### No changed outside of strings- and main-part!
- ;###
- ;###
- ;###################################################################################################
- ;###################################################################################################
-
-
- ;###################################################################################################
- ;### Debugging stuff
- ;###################################################################################################
-
-
- ;###################################################################################################
- ;### Error handling stuff
- ;###################################################################################################
- (onerror (P_Cleanup))
-
-
- ;###################################################################################################
- ;### Configuration defaults
- ;###################################################################################################
- (set #prgname "elCID") ;### Simply the program name.
- (set #dirname "elCID") ;### Directory name to be created at first install.
- (set #dest "elCID:") ;### Default installation path. Primary needed for update check.
- (set #backupext "_Backup") ;### Directory backup extension.
- (set #checkfile "elCIDWatch") ;### File to check version of old and new installation.
- (set #minosver 37) ;### Minimum OS version
- (set #mincpu 0) ;### Minimum CPU.
- (set #minmuiver 14) ;### Minimum MUI version
- (set #setassign 1) ;### Set elCID: assign
-
- ;###################################################################################################
- ;### Strings
- ;###################################################################################################
-
- ;### German strings
- (if (= @language "deutsch")
- (
- (set #wronginstaller (cat "Achtung! Es ist eine alte Version des Programmes 'Installer' auf "
- "Ihrem Amiga!\n\nDie Installation benötigt mindestens Installer "
- "42.9.\n\nBitte überprüfen Sie Ihre Konfiguration!"))
-
- (set #msgwelcome1 (cat "\nWillkommen zur \n\n" #prgname))
- (set #msgwelcome2 " Installation.\n\n")
-
- (set #msgcopyright (cat "Copyright ©1997-1998 by\n"
- "Carsten 'michelangelo' Scholling\n\n"
- "<cscholling@t-online.de>\n"
- "elcid@galaxy5.com\n"
- "http://home.t-online.de/home/cscholling/\n"))
-
- (set #msgstartup1 (cat "\n" #prgname " ist eine multifunktionelle Software\n"
- "zur Überwachung der gesamten Kommunikation in und um\n"
- "den Computer.\n"
- "Bitte beachten Sie, daß während der Installation nichts\n"
- "zerstört oder gelöscht wird, ohne daß Sie danach gefragt\n"
- "werden. Alle Dateien werden ins gleiche Zielverzeichnis\n"
- "kopiert, es sei denn, Sie ändern diese Voreinstellungen.\n"))
-
- (set #msgstartup2 (cat "\nBevor Sie die Installation fortsetzen, beenden Sie bitte\n"
- "alle ISDN- und andere Online-Verbindungen, beenden Sie Ihre\n"
- "Kommunikationssoftware und fahren Sie dann fort.\n"))
-
- (set #msgstartup3 (cat "\nBitte beachten Sie: Diese Software arbeitet optimal mit den\n"
- "VMC Treibern (vmcisdnX.device, ...) zusammen. Bitte lesen Sie\n"
- "in der Dokumentation unbedingt die Abschnitte `About VMC',\n"
- "`About BSC' und 'About ITH' bevor Sie Fragen dazu an mich stellen.\n"))
-
- (set #msgnomui (cat "\n" #prgname " benötigt zum Arbeiten das \"Magic User Interface\""
- "(MUI) in der Version 3.3 oder höher. Das Copyright für MUI liegt\n"
- "bei Stefan Stuntz.\n\n"
- "Ich habe kein installiertes MUI System auf Ihrem Rechner gefunden\n"
- "Bitte installieren Sie MUI bevor Sie " #prgname " starten.\n"
- "Am besten installieren Sie MUI direkt im Anschluß an " #prgname ".\n"
- "Sie finden MUI im Verzeichnis Aminet/util/libs/muiXXusr.lha."))
-
- (set #msgmuiversion (cat "\nSie haben eine veraltete MUI Version auf ihrem System\n"
- "installiert. " #prgname " benötigt zur einwandfreien Funktion\n"
- "mindestens Version 3.3. Bitte installieren Sie das MUI Update\n"
- "BEVOR Sie " #prgname " starten.\n\n"
- "Die derzeit bei Ihnen installierte Version ist "))
-
- (set #msgoldinst (cat "Ich habe eine alte " #prgname " Version auf Ihrem System gefunden.\n"
- "Bitte wählen Sie, wie die Installation fortgesetzt werden soll.\n"))
-
- (set #msgoldinstupdate "Update der alten Version")
- (set #msgoldinstnew "Neuinstallation")
-
- (set #msgwhichdest (cat "Wo soll " #prgname " installiert werden?\nEin Verzeichnis mit dem "
- "Namen " #dirname " wird dort erstellt."))
-
- (set #msgdirexists1 "Ich habe warscheinlich eine alte Installation in\n\"")
- (set #msgdirexists2 "\"\ngefunden. Wie soll ich fortfahren?")
-
- (set #msgdirexistsselect "Neues Ziel wählen")
- (set #msgdirexistsoverwrite "Alte Installation überschreiben")
- (set #msgdirexistsdelete "Alte Installation löschen")
- (set #msgdirexistsbackup "Sicherheitskopie anlegen: ")
-
- (set #msgdelete "Folgende(s) Datei/Verzeichnis wird nun gelöscht:\n")
-
- (set #msgrename1 "Benenne\n")
- (set #msgrename2 " um in ")
-
- (set #msgmakedir "Folgendes Verzeichnis wird nun erstellt:\n")
-
- (set #msgwherelib "Wo sollen die Bibliotheken installiert werden?")
- (set #msgwherelibprog "PROGDIR:Libs")
- (set #msgwhereliblibs "Libs:")
-
- (set #msgwherecat "Wo sollen die Katalogdateien installiert werden?")
- (set #msgwherecatprog "PROGDIR:catalogs")
- (set #msgwherecatlocale "Locale:catalogs")
-
- (set #msgwheredoc "An welche Stelle soll die Dokumentation kopiert werden?")
- (set #msgwheredocprog "PROGDIR:Docs")
- (set #msgwheredochelp "Locale:Docs")
-
- (set #msgwherehelp "An welche Stelle soll die Online-Hilfe kopiert werden?")
- (set #msgwherehelpprog "PROGDIR:Help")
- (set #msgwherehelphelp "Locale:Help")
-
- (set #msgconfirm (cat "Die folgenden Daten werden zur Installation herangezogen:\n"))
- (set #msgconfirmcpu "\nProzessor: ")
- (set #msgconfirmfpu "\nFPU: ")
- (set #msgconfirmos "\nBetriebssystem: ")
- (set #msgconfirmmui "\nMUI Version: ")
- (set #msgconfirmdest "\nInstallationsverzeichnis: ")
- (set #msgconfirmlibdest "\nLibrary Zielverzeichnis: ")
- (set #msgconfirmcatdest "\nCatalogs Zielverzeichnis: ")
- (set #msgconfirmdocdest "\nDokumentationsverzeichnis: ")
- (set #msgconfirmhelpdest "\nOnline-Hilfe Verzeichnis: ")
- (set #msgconfirmback "\nSicherungsverzeichnis: ")
- (set #msgconfirmask "\n\nSoll ich mit diesen Einstellungen fortfahren?\n")
-
- (set #msgprepareinstall "\nDie Installation wird nun vorbereitet.\nBitte wählen Sie \"Ja\" zum fortfahren.")
-
- (set #msgcollectfiles1 "\nErstelle Dateiliste..")
- (set #msgcollectfiles2 "\nErstelle Dateiliste....")
- (set #msgcollectfiles3 "\nErstelle Dateiliste......")
- (set #msgcollectfiles4 "\nErstelle Dateiliste........")
- (set #msgcollectfiles5 "\nErstelle Dateiliste..........")
-
- (set #msgaskcopyfile "\nBitte wählen Sie die zu kopierenden Dateien.")
- (set #msgaskcopylib "\nBitte wählen Sie die zu kopierenden Bibliotheken.")
- (set #msgaskcopycat "\nBitte wählen Sie die zu kopierenden Katalogdateien.")
- (set #msgaskcopydoc "\nBitte wählen Sie die zu kopierende Dokumentation.")
- (set #msgaskcopyhelp "\nBitte wählen Sie die zu kopierende Online-Hilfe.")
-
- (set #msgmodifystartup1 "\nIch werde nun die Zeile\n")
- (set #msgmodifystartup2 "\nin die Datei \"User-Startup\" einfügen.\n")
-
- (set #msgend (cat "\n" #prgname " Installation beendet!\n\n"))
- )
-
- ;### English strings
- (
- (set #wronginstaller (cat "You have an old version of the program 'Installer' on your Amiga!\n\n"
- "The installation procedure needs at least Installer 42.9.\n\n"
- "Please check your configuration and update1!\n"))
-
- (set #msgwelcome1 (cat "\nWelcome to\n\n" #prgname))
- (set #msgwelcome2 " installation.\n\n")
-
- (set #msgcopyright (cat "Copyright ©1997-1998 by\n"
- "Carsten 'michelangelo' Scholling\n\n"
- "<cscholling@t-online.de>\n"
- "elcid@galaxy5.com\n"
- "http://home.t-online.de/home/cscholling/\n"))
-
- (set #msgstartup1 (cat "\n" #prgname " is a multifunctional piece of software\n"
- "for watching every communication in and around your\n"
- "computer.\n"
- "Nothing will be destroyed during installation without\n"
- "asking you. All files are stored in the same\n"
- "place exept you change these defaults.\n"
- "However, you have to take care.\n"))
-
- (set #msgstartup2 (cat "\nBefore you go on, please stop all\n"
- "ISDN- and other connections, quit all\n"
- "communication software, then continue.\n"))
-
- (set #msgstartup3 (cat "\nNotice: This software works fine with VMC software\n"
- "(vmcisdnX.device and so on). Please read the included\n"
- "information `About VMC', 'About BSC' and 'About ITH'\n"
- "before bothering me with questions why not direct\n"
- "supporting other ISDN device driver...\n"))
-
- (set #msgnomui (cat "\n" #prgname " needs Magic User Interface (MUI)\nversion 3.3 or "
- "higher.\nMUI is copyright by Stefan Stuntz.\n\n"
- "I have not found MUI in your system.\nPlease install it before "
- "running " #prgname ".\nBest is, right after this installation.\n\n"
- "You can find MUI on Aminet/util/libs/muiXXusr.lha."))
-
- (set #msgmuiversion (cat "\nYou have installed an outdated version of MUI.\n\n" #prgname " needs "
- "at least version 3.3 or higher.\nPlease make sure to install the "
- "right version\nbefore starting " #prgname ".\n\nYour currently installed "
- "version is "))
-
- (set #msgoldinst (cat "I have found an old installation of " #prgname
- "\nPlease tell me how to go on."))
-
- (set #msgoldinstupdate "Update old installation")
- (set #msgoldinstnew "Install new")
-
- (set #msgwhichdest (cat "Where do you wish to install " #prgname "?\nA directory called `"
- #dirname"' will be created there."))
-
- (set #msgdirexists1 "I have probably found an old installation in\n\"")
- (set #msgdirexists2 "\"\nWhat should i do?")
-
- (set #msgdirexistsselect "Select new destination")
- (set #msgdirexistsoverwrite "Overwrite old files in this directory")
- (set #msgdirexistsdelete "Delete directory contents (including subdirectories)")
- (set #msgdirexistsbackup "Backup this directory to ")
-
- (set #msgdelete "The following file/directory will be deleted:\n")
-
- (set #msgrename1 "Is it OK to rename\n")
- (set #msgrename2 " to ")
-
- (set #msgmakedir "The following directory will be created:\n")
-
- (set #msgwherelib "Where do you want the support library to be installed?")
- (set #msgwherelibprog "PROGDIR:Libs")
- (set #msgwhereliblibs "Libs:")
-
- (set #msgwherecat "Where do you want the catalog files to be installed?")
- (set #msgwherecatprog "PROGDIR:catalogs")
- (set #msgwherecatlocale "Locale:catalogs")
-
- (set #msgwheredoc "Where do you want the documentation to be installed?")
- (set #msgwheredocprog "PROGDIR:Docs")
- (set #msgwheredochelp "Locale:Docs")
-
- (set #msgwherehelp "Where do you want the online help to be installed?")
- (set #msgwherehelpprog "PROGDIR:Help")
- (set #msgwherehelphelp "Locale:Help")
-
- (set #msgconfirm (cat "The following data will be used to install " #prgname ":\n"))
- (set #msgconfirmcpu "\nCentral Processing Unit: ")
- (set #msgconfirmfpu "\nFloating Point Unit: ")
- (set #msgconfirmos "\nOperating System: ")
- (set #msgconfirmmui "\nMUI version: ")
- (set #msgconfirmdest "\nInstallation directory: ")
- (set #msgconfirmlibdest "\nLibrary directory: ")
- (set #msgconfirmcatdest "\nCatalog files directory: ")
- (set #msgconfirmdocdest "\nDocumentation directory: ")
- (set #msgconfirmhelpdest "\nOnline-Help directory: ")
- (set #msgconfirmback "\nBackup directory: ")
- (set #msgconfirmask "\n\nIs it O.K. to use this information to go on?\n")
-
- (set #msgprepareinstall "\nNow preparing and setting up installation.\nThis may take a moment.")
-
- (set #msgcollectfiles1 "\nCollecting installation filelist..")
- (set #msgcollectfiles2 "\nCollecting installation filelist....")
- (set #msgcollectfiles3 "\nCollecting installation filelist......")
- (set #msgcollectfiles4 "\nCollecting installation filelist........")
- (set #msgcollectfiles5 "\nCollecting installation filelist..........")
-
- (set #msgaskcopyfile "\nPlease select which files you want to copy.")
- (set #msgaskcopylib "\nPlease select which libraries you want to copy.")
- (set #msgaskcopycat "\nPlease select which catalog files you want to copy.")
- (set #msgaskcopydoc "\nPlease select which documentation you want to copy.")
- (set #msgaskcopyhelp "\nPlease select which online-help you want to copy.")
-
- (set #msgmodifystartup1 (cat "\nNow, the file \"User-Startup\" will be updated with the "
- "following line:\n"))
- (set #msgmodifystartup2 "\n")
-
- (set #msgend (cat "\n" #prgname " installation complete!\n\n"))
- ))
-
-
-
- ;###################################################################################################
- ;###################################################################################################
- ;###
- ;### Standard functions
- ;###
- ;###################################################################################################
- ;###################################################################################################
-
- ;###################################################################################################
- ;### Procedure CheckOS
- ;###################################################################################################
- (procedure P_CheckOS
- (set os (/ (getversion "libs:version.library") 65536))
-
- (if (= os 37) (set osname "2.0"))
- (if (= os 38) (set osname "2.1"))
- (if (= os 39) (set osname "3.0"))
- (if (= os 40) (set osname "3.1"))
- (if (= os 41) (set osname "3.5"))
- (if (> os 41) (set osname "3.5+ (not known)"))
-
- (if (>= os minosver)
- (set ret 1)
- (set ret 0)
- )
- )
-
-
- ;###################################################################################################
- ;### Procedure CheckCPU
- ;###################################################################################################
- (procedure P_CheckCPU
- (set cpuname (database "cpu"))
- (set fpuname (database "fpu"))
-
- (if (= cpuname "68000") (set cpu 0))
- (if (= cpuname "68010") (set cpu 1))
- (if (= cpuname "68020") (set cpu 2))
- (if (= cpuname "68030") (set cpu 3))
- (if (= cpuname "68040") (set cpu 4))
- (if (> (exists ("sys:libs/68060.library")) 0) (
- (set cpuname "68060")
- (set cpu 6)
- ))
-
- (if (= fpuname "NOFPU") (set fpu 0))
- (if (= fpuname "68881") (set fpu 1))
- (if (= fpuname "68882") (set fpu 2))
- (if (= fpuname "FPU40") (set fpu 4))
- (if (> (exists ("sys:libs/68060.library")) 0) (
- (set fpuname "FPU60")
- ))
-
- (if (>= cpu mincpu)
- (set ret 1)
- (set ret 0)
- )
- )
-
-
- ;###################################################################################################
- ;### Procedure GetVersion
- ;###################################################################################################
- (procedure P_GetVersion p_file
- (set ver (/ (getversion p_file) 65536))
- )
-
-
- ;###################################################################################################
- ;### Procedure GetRevision
- ;###################################################################################################
- (procedure P_GetRevision p_file
- (set vers (getversion p_file))
- (set ver (/ vers 65536))
-
- (set rev (- vers (* ver 65536)))
- )
-
-
- ;###################################################################################################
- ;### Procedure GetFullVersion
- ;###################################################################################################
- (procedure P_GetFullVersion p_file
- (set vers (getversion p_file))
- (set ver (/ vers 65536))
- (set rev (- vers (* ver 65536)))
- (set version (cat ver "." rev))
-
- (set version version)
- )
-
-
- ;###################################################################################################
- ;### Procedure CatPath
- ;###################################################################################################
- (procedure P_CatPath p_p1 p_p2
-
- (set len (- (strlen p_p1) 1))
-
- (if (> len 0)
- (if (= (substr p_p1 len 1) ":")
- (set p (cat p_p1 p_p2))
- (set p (cat p_p1 "/" p_p2))
- )
- (set p p_p2)
- )
- )
-
-
- ;###################################################################################################
- ;### Procedure StripFile
- ;###################################################################################################
- (procedure P_StripFile p_p
-
- (set len (- (strlen p_p) 1))
-
- (while (> len 0) (
- (if (= (substr p_p len 1) "/")
- (
- (set newlen len)
- (set len 0)
- )
- (
- (if (= (substr p_p len 1) ":")
- (
- (set newlen len)
- (set len 0)
- )
- )
- )
- )
- (set len (- len 1))
- ))
-
- (set newlen (+ newlen 1))
- (set retp (substr p_p 0 newlen))
- )
-
-
- ;###################################################################################################
- ;### Procedure CheckExists
- ;###################################################################################################
- (procedure P_CheckExists p_file
- (set ret (exists p_file (noreq)))
- )
-
-
- ;###################################################################################################
- ;### Procedure Rename
- ;###################################################################################################
- (procedure P_Rename p_file p_new
- (if (= 2 @user-level)
- (rename p_file p_new
- (confirm)
- (prompt (cat #msgrename1 p_file #msgrename2 p_new))
- (help (cat #msgrename1 p_file #msgrename2 p_new))
- )
-
- (rename p_file p_new)
- )
- )
-
-
- ;###################################################################################################
- ;### Procedure MakeDir
- ;###################################################################################################
- (procedure P_MakeDir p_dir p_confirm p_icon
- (if (> p_confirm 0)
- (if (> p_icon 0)
- (makedir p_dir
- (confirm)
- (prompt (cat #msgmakedir p_dir))
- (help (cat #msgmakedir p_dir))
- (infos)
- )
- (makedir p_dir
- (confirm)
- (prompt (cat #msgmakedir p_dir))
- (help (cat #msgmakedir p_dir))
- )
- )
-
- (if (> p_icon 0)
- (makedir p_dir (infos))
- (makedir p_dir)
- )
- )
- )
-
-
- ;###################################################################################################
- ;### Procedure Delete
- ;###################################################################################################
- (procedure P_Delete p_file p_confirm
- (if (> p_confirm 0)
- (delete p_file
- (confirm)
- (all)
- (prompt (cat #msgdelete p_file))
- (help (cat #msgdelete p_file))
- (optional "force" "askuser")
- )
- (delete p_file
- (all)
- (optional "force")
- )
- )
- )
-
-
- ;###################################################################################################
- ;### Procedure SelectDir
- ;###################################################################################################
- (procedure P_SelectDir p_text p_help p_dest
-
- ;### Ask the user for any directory.
- (set p_dest
- (askdir
- (prompt p_text)
- (help (cat p_help "\n\n" @askdir-help))
- (default p_dest)
- )
- )
-
- (set p_dest p_dest)
- )
-
-
- ;###################################################################################################
- ;### Procedure PreInstall
- ;###################################################################################################
- (procedure P_PreInstall
- (set libdest "")
- (set catdest "")
- (set docdest "")
- (set helpdest "")
- (set filecount 1)
- )
-
-
- ;###################################################################################################
- ;### Procedure CheckOldInst
- ;###################################################################################################
- (procedure P_CheckOldInst
- ;### Old installation?
- (if (P_CheckExists #dest)
- (
- ;### Let the user select what to do (update, install new).
- (set choice
- (askchoice
- (prompt #msgoldinst)
- (help (cat #msgoldinst "\n\n" askchoice-help))
- (choices #msgoldinstupdate #msgoldinstnew)
- (default 0)
- )
- )
-
- (if (= 0 choice)
- (
- (set @default-dest #dest)
- (set libdest (P_CatPath #dest "Libs"))
- (set catdest (P_CatPath #dest "catalogs"))
- (set docdest (P_CatPath #dest "Docs"))
- (set helpdest (P_CatPath #dest "Help"))
- (set update 1)
- ))
- (if (= 1 choice) (
- (set #dest (P_CatPath @default-dest #dirname))
- (set libdest (P_CatPath #dest "Libs"))
- (set catdest (P_CatPath #dest "catalogs"))
- (set docdest (P_CatPath #dest "Docs"))
- (set helpdest (P_CatPath #dest "Help"))
- (set update 0)
- ))
- )
- (
- (set #dest @default-dest)
- (set libdest (P_CatPath #dest "Libs"))
- (set catdest (P_CatPath #dest "catalogs"))
- (set docdest (P_CatPath #dest "Docs"))
- (set helpdest (P_CatPath #dest "Help"))
- (set update 0)
- ))
- )
-
-
- ;###################################################################################################
- ;### Procedure Welcome
- ;###################################################################################################
- (procedure P_About p_update
- (message (cat #msgwelcome1 " " (P_GetFullVersion #checkfile) #msgwelcome2 #msgcopyright))
-
- (if (= 0 update) (
- (message #msgstartup1)
- (message #msgstartup2)
- (message #msgstartup3)
- ))
- )
-
-
- ;###################################################################################################
- ;### Procedure CheckMUI
- ;###################################################################################################
- (procedure P_CheckMUI p_minver
- (set muifound 0)
-
- (if (P_CheckExists "mui:")
- (set muifound 1)
- (if (P_CheckExists "libs:muimaster.library")
- (set muifound 2)
- )
- )
-
- (if (= 0 muifound)
- (message #msgnomui)
- (
- (if (= 1 muifound) (set ver (P_GetVersion "mui:mui")))
- (if (= 2 muifound) (set ver (P_GetVersion "libs:muimaster.library")))
-
- (if (= ver 7) (set muiver "2.0"))
- (if (= ver 8) (set muiver "2.1"))
- (if (= ver 9) (set muiver "2.2"))
- (if (= ver 10) (set muiver "2.3"))
- (if (= ver 11) (set muiver "3.0"))
- (if (= ver 12) (set muiver "3.1"))
- (if (= ver 13) (set muiver "3.2"))
- (if (= ver 14) (set muiver "3.3"))
- (if (= ver 15) (set muiver "3.4"))
- (if (= ver 16) (set muiver "3.5"))
- (if (= ver 17) (set muiver "3.6"))
- (if (= ver 18) (set muiver "3.7"))
- (if (= ver 19) (set muiver "3.8"))
- (if (> ver 19) (set muiver "3.9+ (not known)"))
-
- (if (<= ver p_minver)
- (message (cat #msgmuiversion muiver))
- )
- )
- )
-
- (set ver ver)
- )
-
-
- ;###################################################################################################
- ;### Procedure CheckInstPath
- ;###################################################################################################
- (procedure P_CheckInstPath p_path p_newdirname
- (set choice 4)
- (set path (P_CatPath p_path p_newdirname))
- (set backdir "")
- (set mdeb (cat #msgdirexistsbackup (cat p_newdirname #backupext)))
-
- (if (= 0 update) (
-
- ;### New directory allready there?
- (if (= 2 (P_CheckExists path))
- (
- ;### Let the user select what to do with this dir.
- (set choice
- (askchoice
- (prompt (cat #msgdirexists1 (expandpath path) #msgdirexists2))
- (help (cat #msgdirexists1 (expandpath path) #msgdirexists2 "\n\n" askchoice-help))
- (choices #msgdirexistsselect #msgdirexistsoverwrite #msgdirexistsdelete mdeb)
- (default 1)
- )
- )
-
- (set #dest path)
- (set libdest (P_CatPath path "Libs"))
- (set catdest (P_CatPath path "catalogs"))
- (set docdest (P_CatPath path "Docs"))
- (set helpdest (P_CatPath path "Help"))
- (set backdir "")
-
- (if (= 1 choice) (
- (set whatwithold 1)
- ))
-
- (if (= 2 choice) (
- (set whatwithold 2)
- ))
-
- (if (= 3 choice) (
- (set backdir (cat path #backupext))
- (set whatwithold 3)
- ))
- ))
-
- (if (= 0 choice)
- (set ret 0)
- (set #dest path)
- )
- ))
- )
-
-
- ;###################################################################################################
- ;### Procedure SetupInstall
- ;###################################################################################################
- (procedure P_SetupInstall
-
- (if (= 0 update)
- (
- ;### Select installation path
- (while (= 0 (P_CheckInstPath (P_SelectDir #msgwhichdest #msgwhichdest #dest) #dirname)))
-
- ;### Let the user select where to put the libraries.
- (set choice
- (askchoice
- (prompt #msgwherelib)
- (help (cat #msgwherelib "\n\n" askchoice-help))
- (choices #msgwherelibprog #msgwhereliblibs)
- (default 0)
- )
- )
-
- (if (= 0 choice) (set libdest (P_CatPath #dest "Libs")))
- (if (= 1 choice) (set libdest "Libs:"))
-
- ;### Let the user select where to put the catalogs.
- (set choice
- (askchoice
- (prompt #msgwherecat)
- (help (cat #msgwherecat "\n\n" askchoice-help))
- (choices #msgwherecatprog #msgwherecatlocale)
- (default 0)
- )
- )
-
- (if (= 0 choice) (set catdest (P_CatPath #dest "catalogs")))
- (if (= 1 choice) (set catdest "Locale:catalogs"))
-
- ;### Let the user select where to put the docs.
- (set choice
- (askchoice
- (prompt #msgwheredoc)
- (help (cat #msgwheredoc "\n\n" askchoice-help))
- (choices #msgwheredocprog #msgwheredochelp)
- (default 0)
- )
- )
-
- (if (= 0 choice) (set docdest (P_CatPath #dest "Docs")))
- (if (= 1 choice) (set docdest "Locale:Docs"))
-
- ;### Let the user select where to put the online help.
- (set choice
- (askchoice
- (prompt #msgwherehelp)
- (help (cat #msgwherehelp "\n\n" askchoice-help))
- (choices #msgwherehelpprog #msgwherehelphelp)
- (default 0)
- )
- )
-
- (if (= 0 choice) (set helpdest (P_CatPath #dest "Help")))
- (if (= 1 choice) (set helpdest "Locale:Help"))
-
- )
-
- ;### Only update old installation
- (
- (P_CheckInstPath #dest "")
- (if (P_CheckExists libdest)
- (if (P_CheckExists (P_CatPath libdest "elcid.library"))
- (set libdest libdest)
- (
- (if (P_CheckExists "libs:elcid.library")
- (set libdest "Libs:")
- )
- )
- )
- )
-
- (if (P_CheckExists catdest)
- (if (P_CheckExists (P_CatPath #dest "catalogs"))
- (set catdest (P_CatPath #dest "catalogs"))
- (set catdest "Locale:catalogs")
- )
- )
-
- (if (P_CheckExists docdest)
- (if (P_CheckExists (P_CatPath #dest "Docs"))
- (set docdest (P_CatPath #dest "Docs"))
- (set docdest "Locale:Docs")
- )
- )
-
- (if (P_CheckExists helpdest)
- (if (P_CheckExists (P_CatPath #dest "Help"))
- (set helpdest (P_CatPath #dest "Help"))
- (set helpdest "Locale:Help")
- )
- )
- ))
- )
-
- ;###################################################################################################
- ;### Procedure AskConfirmation
- ;###################################################################################################
- (procedure P_AskConfirmation
-
- (set msgconfirm1 (cat #msgconfirm
- #msgconfirmcpu cpuname
- #msgconfirmfpu fpuname
- #msgconfirmos osname))
-
- (if (muiver)
- (set msgconfirm2 (cat #msgconfirmmui muiver))
- )
-
- (set msgconfirm3 (cat #msgconfirmdest #dest
- #msgconfirmlibdest libdest
- #msgconfirmcatdest catdest
- #msgconfirmdocdest docdest
- #msgconfirmhelpdest helpdest))
-
- (if (backdir)
- (set msgconfirm4 (cat #msgconfirmback (expandpath backdir)))
- )
-
- (set msgconfirm (cat msgconfirm1 msgconfirm2 msgconfirm3 msgconfirm4 #msgconfirmask))
-
- ;### All right?
- (set choice
- (askbool
- (prompt msgconfirm)
- (help msgconfirm)
- (default 1)
- )
- )
-
- (set choice choice)
- )
-
-
- ;###################################################################################################
- ;### Procedure PrepareInstall
- ;###################################################################################################
- (procedure P_PrepareInstall
-
- (askbool
- (prompt #msgprepareinstall)
- (help (cat #msgprepareinstall @askbool-help))
- (default 1)
- )
-
- (if (= 1 whatwithold) (
- (set dummy "dummy")
- ))
-
- (if (= 2 whatwithold) (
- (P_Delete (P_CatPath #dest "#?") 1)
- ))
-
- (if (= 3 whatwithold) (
- (P_Rename #dest backdir)
- (P_MakeDir #dest 1 1)
- ))
- )
-
-
- ;###################################################################################################
- ;### Procedure CreateFileList
- ;###################################################################################################
- (procedure P_CreateFileList p_path p_pat p_dir
-
- (if (= 2 (P_CheckExists p_path)) (
-
- (set path (P_CatPath p_path p_pat))
-
- (if (= 0 (P_CheckExists "ENV:eçtem¶tic1")) (
- (run "setenv eçtem¶tic1 0")
- ))
-
- (set oldexecutedir @execute-dir)
-
- (run (cat "echo >env:eçtem¶tfe \"setenv eçtem¶tic2 0\""))
-
- (if (= 0 p_dir)
- (
- (set runstring (cat "list >>env:eçtem¶tfe " path " lformat \"echo >env:eçtem¶tf*$eçtem¶tic1.*$eçtem¶tic2 *\"%p%n*\" noline*necho >env:eçtem¶ts*$eçtem¶tic1.*$eçtem¶tic2 *\"%c*\" noline*neval *$eçtem¶tic2 + 1 to env:eçtem¶tic2\" files"))
- )
- (
- (set @execute-dir (expandpath p_path))
- (set runstring (cat "list >>env:eçtem¶tfe " p_pat " lformat \"echo >env:eçtem¶tf*$eçtem¶tic1.*$eçtem¶tic2 *\"%p%n*\" noline*necho >env:eçtem¶ts*$eçtem¶tic1.*$eçtem¶tic2 *\"%c*\" noline*necho >env:eçtem¶td*$eçtem¶tic1.*$eçtem¶tic2 *\"" p_path "*\" noline*neval *$eçtem¶tic2 + 1 to env:eçtem¶tic2\" files all"))
- )
- )
-
- (run runstring)
- (run (cat "echo >>env:eçtem¶tfe \"if exists env:eçtem¶tf*$eçtem¶tic1.0*neval *$eçtem¶tic1 + 1 to env:eçtem¶tic1*nendif\""))
-
- (execute "env:eçtem¶tfe")
-
- (set @execute-dir oldexecutedir)
-
- (set filecount (+ filecount (getenv "ENV:eçtem¶tic2")))
- ))
- )
-
-
- ;###################################################################################################
- ;### Procedure CopyFiles
- ;###################################################################################################
- (procedure P_CopyFiles p_dir p_file
-
- (set src (P_CatPath p_dir p_file))
-
- (if (patmatch "#?libs#?" p_dir)
- (
- (set dst (P_StripFile (P_CatPath libdest p_file)))
- (if (= 0 (P_CheckExists dst)) (P_MakeDir dst 1 0))
- (copylib
- (source src)
- (dest dst)
- )
- )
-
- (if (patmatch "#?catalogs#?" p_dir)
- (
- (set dst (P_StripFile (P_CatPath catdest p_file)))
- (if (= 0 (P_CheckExists dst)) (P_MakeDir dst 1 1))
- (copyfiles
- (source src)
- (dest dst)
- (files)
- )
- )
-
- (if (patmatch "#?docs#?" p_dir)
- (
- (set dst (P_StripFile (P_CatPath docdest p_file)))
- (if (= 0 (P_CheckExists dst)) (P_MakeDir dst 1 1))
- (copyfiles
- (source src)
- (dest dst)
- (files)
- )
- )
-
- (if (patmatch "#?help#?" p_dir)
- (
- (set dst (P_StripFile (P_CatPath helpdest p_file)))
- (if (= 0 (P_CheckExists dst)) (P_MakeDir dst 1 1))
- (copyfiles
- (source src)
- (dest dst)
- (files)
- )
- )
- (
- (set dst (P_CatPath #dest p_dir))
- (if (= 0 (P_CheckExists dst)) (P_MakeDir dst 1 0))
- (copyfiles
- (source src)
- (dest dst)
- (files)
- )
- )
- )
- )
- )
- )
-
- (set filecount (+ filecount fc))
- (complete filecount)
- )
-
-
- ;###################################################################################################
- ;### Ask for copying files
- ;###################################################################################################
- (procedure p_AskCopyFiles p_d0 p_f0 p_s0 p_d1 p_f1 p_s1 p_d2 p_f2 p_s2 p_d3 p_f3 p_s3 p_d4 p_f4 p_s4 p_d5 p_f5 p_s5 p_d6 p_f6 p_s6 p_d7 p_f7 p_s7 p_defopt
-
- (set ask #msgaskcopyfile)
- (if (patmatch "#?libs#?" p_d0) (set ask #msgaskcopylib))
- (if (patmatch "#?catalogs#?" p_d0) (set ask #msgaskcopycat))
- (if (patmatch "#?docs#?" p_d0) (set ask #msgaskcopydoc))
- (if (patmatch "#?help#?" p_d0) (set ask #msgaskcopyhelp))
-
- (if (p_f0) (set a0 (cat (fileonly p_f0) " (" (+ (/ (getsize (P_CatPath p_d0 p_f0)) 1024) 1) "k) - " p_s0)) (set a0 ""))
- (if (p_f1) (set a1 (cat (fileonly p_f1) " (" (+ (/ (getsize (P_CatPath p_d1 p_f1)) 1024) 1) "k) - " p_s1)) (set a1 ""))
- (if (p_f2) (set a2 (cat (fileonly p_f2) " (" (+ (/ (getsize (P_CatPath p_d2 p_f2)) 1024) 1) "k) - " p_s2)) (set a2 ""))
- (if (p_f3) (set a3 (cat (fileonly p_f3) " (" (+ (/ (getsize (P_CatPath p_d3 p_f3)) 1024) 1) "k) - " p_s3)) (set a3 ""))
- (if (p_f4) (set a4 (cat (fileonly p_f4) " (" (+ (/ (getsize (P_CatPath p_d4 p_f4)) 1024) 1) "k) - " p_s4)) (set a4 ""))
- (if (p_f5) (set a5 (cat (fileonly p_f5) " (" (+ (/ (getsize (P_CatPath p_d5 p_f5)) 1024) 1) "k) - " p_s5)) (set a5 ""))
- (if (p_f6) (set a6 (cat (fileonly p_f6) " (" (+ (/ (getsize (P_CatPath p_d6 p_f6)) 1024) 1) "k) - " p_s6)) (set a6 ""))
- (if (p_f7) (set a7 (cat (fileonly p_f7) " (" (+ (/ (getsize (P_CatPath p_d7 p_f7)) 1024) 1) "k) - " p_s7)) (set a7 ""))
-
- ;### All right?
- (set choice (
- (askoptions (
- (prompt ask)
- (help ask @askoptions-help)
- (choices a0 a1 a2 a3 a4 a5 a6 a7)
- (default p_defopt)
- ))
- ))
-
- (if (p_f0) ((if (IN choice 0) (P_CopyFiles p_d0 p_f0))))
- (if (p_f1) ((if (IN choice 1) (P_CopyFiles p_d1 p_f1))))
- (if (p_f2) ((if (IN choice 2) (P_CopyFiles p_d2 p_f2))))
- (if (p_f3) ((if (IN choice 3) (P_CopyFiles p_d3 p_f3))))
- (if (p_f4) ((if (IN choice 4) (P_CopyFiles p_d4 p_f4))))
- (if (p_f5) ((if (IN choice 5) (P_CopyFiles p_d5 p_f5))))
- (if (p_f6) ((if (IN choice 6) (P_CopyFiles p_d6 p_f6))))
- (if (p_f7) ((if (IN choice 7) (P_CopyFiles p_d7 p_f7))))
- )
-
-
-
- ;###################################################################################################
- ;### Procedure DoInstall
- ;###################################################################################################
- (procedure P_DoInstall
-
- (set c1 0)
- (set c2 0)
- (set check 0)
-
- (while (> (P_CheckExists (cat "ENV:eçtem¶tf" c1 ".0")) 0) (
-
- (set f0 "" f1 "" f2 "" f3 "" f4 "" f5 "" f6 "" f7 "" defopt 0)
- (set d0 "" d1 "" d2 "" d3 "" d4 "" d5 "" d6 "" d7 "")
- (set s0 "" s1 "" s2 "" s3 "" s4 "" s5 "" s6 "" s7 "")
-
- (while (> (P_CheckExists (cat "ENV:eçtem¶tf" c1 "." c2)) 0) (
- (set file (getenv (cat "ENV:eçtem¶tf" c1 "." c2)))
- (set dir (getenv (cat "ENV:eçtem¶td" c1 "." c2)))
- (set comment (getenv (cat "ENV:eçtem¶ts" c1 "." c2)))
-
- (if (file) (
- (symbolset (cat "f" check) file)
- (symbolset (cat "d" check) dir)
- (symbolset (cat "s" check) comment)
- (set defopt (BITOR defopt (shiftleft 1 check)))
- (set c2 (+ 1 c2))
- (set check (+ 1 check))
- ))
-
- (if (= 8 check) (
- (set check 0)
- (p_AskCopyFiles d0 f0 s0 d1 f1 s1 d2 f2 s2 d3 f3 s3 d4 f4 s4 d5 f5 s5 d6 f6 s6 d7 f7 s7 defopt)
- (set f0 "" f1 "" f2 "" f3 "" f4 "" f5 "" f6 "" f7 "" defopt 0)
- (set d0 "" d1 "" d2 "" d3 "" d4 "" d5 "" d6 "" d7 "")
- (set s0 "" s1 "" s2 "" s3 "" s4 "" s5 "" s6 "" s7 "")
- ))
- ))
-
- (if (f0) (p_AskCopyFiles d0 f0 s0 d1 f1 s1 d2 f2 s2 d3 f3 s3 d4 f4 s4 d5 f5 s5 d6 f6 s6 d7 f7 s7 defopt))
- (set c1 (+ 1 c1))
- (set c2 0)
- (set check 0)
- ))
-
- (if (= 1 #setassign) (
- (if (= 0 update) (
- (startup (@app-name)
- (prompt (cat #msgmodifystartup1 "Assign >nil: " #prgname ": " #dest #msgmodifystartup2))
- (help (cat #msgmodifystartup1 "Assign >nil: " #prgname ": " #dest #msgmodifystartup2 @startup-help))
- (confirm)
- (command (cat "Assign >nil: " #prgname ": " (expandpath #dest)))
- )
-
- (makeassign #dirname #dest)
- ))
- ))
- )
-
-
-
- ;###################################################################################################
- ;### Procedure Cleanup
- ;###################################################################################################
- (procedure P_Cleanup
- (if (> (P_CheckExists #dest) 0) (
- (run (cat "list >env:eçtem¶te " #dest " pat .info all lformat \"delete %p%n\""))
- (execute "env:eçtem¶te")
- (delete "ENV:eçtem¶t#?")
- ))
- )
-
-
- ;###################################################################################################
- ;### Entry point
- ;###################################################################################################
- ;### We can't handle this script without Installer 42.9 or better!
- (if (< @installer-version 2752521) (
- (message #wronginstaller)
- (exit (quiet))
- ))
-
- (complete 0)
- (P_PreInstall)
-
- (welcome)
-
- (P_About (P_CheckOldInst))
-
- (complete 2)
- (P_CheckOS)
-
- (complete 4)
- (P_CheckCPU)
-
- (complete 6)
- (P_CheckMUI #minmuiver)
-
- (complete 8)
- (P_SetupInstall)
-
- ;### Ask for confirmation
- (complete 10)
- (if (P_AskConfirmation) (
- (P_PrepareInstall)
-
- ;### Create filelist for all elCID* files and icons
- (complete 15)
- (working #msgcollectfiles1)
- (P_CreateFileList "" "elCID#?" 0)
-
- ;### Create filelist for all NOT elCID* files and icons
- (complete 20)
- (working #msgcollectfiles2)
- (P_CreateFileList "" "~(elCID#?|Install_elCID#?)" 0)
-
- ;### Create libs directory filelist.
- (complete 25)
- (working #msgcollectfiles2)
- (P_CreateFileList "libs" "#?" 1)
-
- ;### Create catalogs directory filelist.
- (complete 30)
- (working #msgcollectfiles3)
- (P_CreateFileList "catalogs" "#?" 1)
-
- ;### Create docs directory filelist.
- (working #msgcollectfiles3)
- (P_CreateFileList "docs" "#?" 1)
-
- ;### Create help directory filelist.
- (working #msgcollectfiles4)
- (P_CreateFileList "help" "#?" 1)
-
- ;### Create images directory filelist.
- (working #msgcollectfiles5)
- (P_CreateFileList "images" "#?" 1)
-
- (complete 35)
- (set fc (/ 60 filecount))
- (set filecount 35)
- (P_DoInstall)
- ))
-
- (complete 100)
- (P_Cleanup)
- (exit #msgend)
-
-
-