home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1994-08-16 | 25.5 KB | 1,167 lines
; $VER: DFA 2.0 (05.02.94) ; Script to install DFA V 2.0 (transcript "Installing the DFA - Address utility...") ; ************************* ; Try to uninstall DFA V1.x ; ************************* ; ; Notice that even parts of DFA V2.0 may be ; deinstalled:-) ; ; Is an old DFA (V1.x) present? ; (if (OR (OR (exists "ENV:DFA/DFA.prefs") (exists "SYS:WBStartup/DFA")) (OR (exists "Locale:Catalogs/deutsch/dfa.catalog") (exists "Locale:Catalogs/dansk/dfa.catalog"))) ( (if (askbool (prompt "There is an old version of DFA on " "your harddisk!\n\n" "Do you want to uninstall it?\n" ) (help "If you select 'YES', the old DFA " "and all related files, i.e. locale " "catalogs, preferences etc. are deleted. " "The address files are not touched, " "so you won't loose any addresses! " ) ) ( ; ; Uninstall DFA 1.x ; (if (NOT (= (getassign "Locale") "")) ( ; ; Delete locale catalogs ; (working "Deleting catalog files of DFA V1.x...") (run "delete Locale:Catalogs/dansk/dfa.catalog") (run "delete Locale:Catalogs/deutsch/dfa.catalog") (run "delete Locale:Catalogs/italiano/dfa.catalog") (run "delete Locale:Catalogs/nederlands/dfa.catalog") (run "delete Locale:Catalogs/suomi/dfa.catalog") (run "delete Locale:Catalogs/svenska/dfa.catalog") ) ) (if (exists "ENV:DFA/DFA.prefs") ( ; ; Delete prefs ; (working "Deleting preferences file of DFA V1.x...") (run "delete ENV:DFA/DFA.prefs") (run "delete ENVARC:DFA/DFA.prefs") ) ) (if (exists "SYS:WBStartup/DFA") ( ; ; Delete DFA executable ; (working "Deleting DFA V1.x executable...") (run "delete SYS:WBStartup/DFA") (run "delete SYS:WBStartup/DFA.info") ) ) ) ) ) ( (message ( "No old version of DFA found!\nYou either don't have an old version installed, or it is on a place on your harddisk where it wasn't found.\n\nIf you have installed an old version of DFA anywhere on your system, please delete it manually or make sure that both versions don't run at the same time, as they are not compatible in some ways." ) ) ) ) (message ( "*** DFA is SHAREWARE ***\n \nIf you use it regularly, please remember that you have to register!\n\nPlease notice that the amount of time the author is able to invest into DFA depends directly on the number of people who register.\nFor details about the registration, please read the documentation!\n\nEnjoy using DFA.\n\nDirk Federlein" ) ) (set @default-dest "SYS:") (complete 0) ; ; Set the dir and archive name for the binaries ; (set bindir "DFA/") (set binarchive "DFA/DFA-20.lha") ; ************************ ; Install the DFA - Server ; ************************ ; ; Select destination drawer ; (set serverdest (askdir (prompt "Please select a place for the DFA-Server executable") (default "SYS:WBStartup") (help "Choose a destination partition or directory " "to contain the DFA-Server executable. The install " "program copies the DFA-Server executable 'DFA' " "to the location you choose. " "No extra drawer will be created! " ) ) ) ; ; Extract executable from archive ; (working "Extracting DFA-Server executable from archive...") (if (AND (NOT (= (substr serverdest (- (strlen serverdest) 1 ) 1 ) ":" )) (NOT (= (substr serverdest (- (strlen serverdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set serverdest (cat serverdest "/")) ) ) ; ; Generate command string... ; (set cmdstring "c/lhx e ") (set cmdstring (cat cmdstring binarchive)) (set cmdstring (cat cmdstring " DFA ")) (set cmdstring (cat cmdstring serverdest)) ; ; ...and execute it ; (run cmdstring) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing DFA-Server Icon...") (source (tackon bindir "DFA.info")) (dest serverdest) ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) (complete 10) ; ************************ ; Install the DFA - Editor ; ************************ ; ; Select destination drawer ; (set editordest (askdir (prompt "Please select a place for the DFA-Editor executable") (default "C:") (help "Choose a destination partition or directory " "to contain the DFA-Editor executable. The install " "program copies the DFA-Editor executable 'DFAEditor' " "to the location you choose. " "No extra drawer will be created! " ) ) ) ; ; Extract executable from archive ; (working "Extracting DFA-Editor executable from archive...") (if (AND (NOT (= (substr editordest (- (strlen editordest) 1 ) 1 ) ":" )) (NOT (= (substr editordest (- (strlen editordest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set editordest (cat editordest "/")) ) ) (set cmdstring (cat "c/lhx e " binarchive)) (set cmdstring (cat cmdstring " DFAEditor ")) (set cmdstring (cat cmdstring editordest)) (run cmdstring) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing DFA-Editor Icon...") (source (tackon bindir "DFAEditor.info")) (dest editordest) ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) (complete 20) ; *************************************** ; Install the DFA - Preferences - Program ; *************************************** ; ; Select destination drawer ; (set prefsdest (askdir (prompt "Please select a place for the DFA-Prefs executable") (default "SYS:Prefs") (help "Choose a destination partition or directory " "to contain the DFA-Prefs executable. The install " "program copies the DFA-Prefs executable 'DFAPrefs' " "to the location you choose. " "No extra drawer will be created! " ) ) ) ; ; Extract executable from archive ; (working "Extracting DFA-Prefs executable from archive...") (if (AND (NOT (= (substr prefsdest (- (strlen prefsdest) 1 ) 1 ) ":" )) (NOT (= (substr prefsdest (- (strlen prefsdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set prefsdest (cat prefsdest "/")) ) ) (set cmdstring (cat "c/lhx e " binarchive)) (set cmdstring (cat cmdstring " DFAPrefs %s")) (run cmdstring prefsdest) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing DFA-Editor Icon...") (source (tackon bindir "DFAPrefs.info")) (dest prefsdest) ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) (complete 30) ; ************************* ; Install the DFA - Library ; ************************* ; ; Select destination drawer ; (set libdest (askdir (prompt "Please select a place for the DFA-Library") (default "LIBS:") (help "Choose a destination partition or directory " "to contain the DFA-Library. The install " "program copies the DFA-Library 'dfa.library' " "to the location you choose. " "No extra drawer will be created! " ) ) ) ; ; Extract executable from archive ; (working "Extracting the DFA-Library from archive...") (if (AND (NOT (= (substr libdest (- (strlen libdest) 1 ) 1 ) ":" )) (NOT (= (substr libdest (- (strlen libdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set libdest (cat libdest "/")) ) ) (set cmdstring (cat "c/lhx e " binarchive)) (set cmdstring (cat cmdstring " dfa.library %s")) (run cmdstring libdest) (complete 35) ; ******************** ; Install Locale files ; ******************** ; ; Locale: drawer present ? ; (if (AND (NOT (= (getassign "Locale") "")) (exists "libs:locale.library")) ( ; ; Select language(s) ; (set language (askoptions (prompt "Which language(s) do you want to get installed?") (choices "German" ) (help "You may choose none, one or more languages. " "If you don't have an operation system that " "supports locale, please select no language " "at all. " "Locale support is given in Workbench 2.1 " "and above. " "Please note that English is the builtin " "language and does not need extra catalog " " files! " ) ) ) ; ; Copy catalogs ; (if (IN language 0) ( ; ; German catalogs ; (copyfiles (source "Locale/Catalogs/Deutsch/DFA.catalog") (dest "Locale:catalogs/deutsch") (prompt "Installing catalog for the DFA-Server...") ) (copyfiles (source "Locale/Catalogs/Deutsch/DFAEditor.catalog") (dest "Locale:catalogs/deutsch") (prompt "Installing catalog for the DFA-Editor...") ) (copyfiles (source "Locale/Catalogs/Deutsch/DFAPrefs.catalog") (dest "Locale:catalogs/deutsch") (prompt "Installing catalog for the DFA-Preferences...") ) (copyfiles (source "Locale/Catalogs/Deutsch/DFALib.catalog") (dest "Locale:catalogs/deutsch") (prompt "Installing catalog for the DFA-Library...") ) ) ) ) ) (complete 40) ; ********************************* ; Install the example arexx scripts ; ********************************* (set installrexx (askbool (prompt "Do you want to install the example AREXX scripts?\n\n" "Please notice that Arexx scripts that you may " "have got together with DFA V1.x are NOT " "compatible to the new ones in some ways!\n\n" "For details about these Arexx scripts please " "read the documentation and look up the " "information given in the particular scripts. " ) (help "The sample ARexx scripts can give you an idea " "how to use DFA in connection to ARexx and e.g. " "the Cygnus Ed (by ADSG)." ) (default 0) ) ) (if (= installrexx 1) ( (set rexxdest (askdir (prompt "Select the directory where to install the ARexx scripts") (default "Rexx:") (help "If you want to *use* the Arexx scripts at once, " "select an directory that is already within your " "Arexx search path." ) ) ) (set error (trap 4 (copyfiles (source "rexx") (dest rexxdest) (all) (prompt "Installing the example AREXX scripts...") ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) ) ) (complete 45) ; **************************************************** ; Copy Keyfile, if available (registered version only) ; **************************************************** (if (exists "s/DFA.key") ( (set keydest (askdir (prompt "Select the directory where to install the DFA keyfile") (default "S:") (help "The DFA keyfile can be copied to any drawer. " "The default directory where the keyfile is " "copied to is 's:'." "If you select another drawer, the environment " "variable 'KEYPATH' is set accordingly." ) ) ) (set error (trap 4 (copyfiles (source "S/DFA.key") (dest keydest) (prompt "Installing the DFA keyfile...") ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) ) (if (NOT (= keydest "s:")) || (NOT (= keydest "S:")) ( (working "Setting environment variable 'KEYPATH'...") (run setenv "KEYPATH" keydest) (run copy "Env:KEYPATH" "EnvArc:") ) ) ) (complete 50) ; ******************************** ; Install the default address file ; ******************************** (set installadrfile (askbool (prompt "Do you want to install the default address file (into s:) ?") (help "The default address file is named 'adr.file' and " "will be copied into the 's:' drawer. " "It contains the author's address which could be " "useful in some cases (Bug reports, Registration etc.) " "However, if you do already have such a file within " "your 's:' drawer you may not want to overwrite it. " ) ) ) (if (= installadrfile 1) ( (if (exists "s:adr.file") ( (if (askbool (prompt "Be careful!\n " "There already exists a file called 'adr.file' in the s: directory.\n " "Do you really want to overwrite this file? \n" ) (help "" ) ) ( (set error (trap 4 (copyfiles (source "s/adr.file") (dest "s:") (infos) ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) ) ) ) ( (set error (trap 4 (copyfiles (source "s/adr.file") (dest "s:") (infos) ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) ) ) ) ) (complete 55) ; ************************* ; Install the documentation ; ************************* ; ; Get doc language ; (set doclanguage (askchoice (prompt "Choose which documentation you want to get installed") (choices "English documentation" "German documentation" ) (help "You may either select the English or the German " "documentation. " ) (default 0) ) ) ; ; Set documentation source directory ; (if (= doclanguage 0) ( ; ; English documentation ; (set docsource "Documentation/english/") ) ( ; ; German documentation ; (set docsource "Documentation/deutsch/") ) ) ; ; Part(s) of the documentation to be installed ; (set docparts (askoptions (prompt "Choose the kind of documentation you would " "like to get installed" ) (choices "AmigaGuide documentation " "TeX documentation (.DVI file) " ) (help "The AmigaGuide documentation will only " "be usefull, if you have an amigaguide " "reader like 'Amigaguide' or 'Multiview' " "It _can_ be used for ONLINE help as well " "but you can used separate ONLINE help " "files for that purpose. " "They will be installed later on. " "" "The DVI file makes only sense if you have " "a TeX package or at least parts of it installed. " ) ) ) ; ; AmigaGuide documentation ; (if (IN docparts 0) ( (set guidedocdest (askdir (prompt "Select the location to install the Amigaguide documentation") (help "Choose a destination partition or directory " "to contain the Amigaguide documentation. " "The install program will copy the Amigaguide documentation " "to this directory." ) (default "Help:") ) ) (working "Extracting Amigaguide documentation from archive") (if (AND (NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) ":" )) (NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set guidedocdest (cat guidedocdest "/")) ) ) (set cmdstring (cat "c/lhx e " (tackon docsource "Documentation.lha" ))) (set cmdstring (cat cmdstring " DFA.guide %s")) (run cmdstring guidedocdest) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing Icon...") (source (tackon docsource "DFA.guide.info") (dest guidedocdest)) ) ) ) (if (> error 0) ( (message ("Dos Error %ld detected" @ioerr)) ) ( (tooltype (dest (tackon guidedocdest "DFA.guide")) (noposition)) ) ) ) ) (complete 65) ; ; TeX documentation - DVI file ; (if (IN docparts 1) ( (set texdocdest (askdir (prompt "Select the location to install the TeX documentation") (help "Choose a destination partition or directory " "to contain the TeX documentation. " "The install program will copy the TeX documentation " "to this directory." ) (default "Work:") ) ) (working "Extracting TeX documentation from archive") (if (AND (NOT (= (substr texdocdest (- (strlen texdocdest) 1 ) 1 ) ":" )) (NOT (= (substr texdocdest (- (strlen texdocdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set texdocdest (cat texdocdest "/")) ) ) (set cmdstring (cat "c/lhx e " (tackon docsource "Documentation.lha" ))) (set cmdstring (cat cmdstring " DFA.dvi %s")) (run cmdstring texdocdest) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing Icon...") (source (tackon docsource "DFA.dvi.info") (dest texdocdest)) ) ) ) (if (> error 0) ( (message ("Dos Error %ld detected" @ioerr)) ) ( (tooltype (dest (tackon texdocdest "DFA.dvi")) (noposition)) ) ) ) ) (complete 75) ; *********************** ; Install the online help ; *********************** (set onlineparts (askchoice (prompt "You may choose the online help files you like " "to get installed. (select <HELP> for details!)" ) (choices "Big AmigaGuide documentation (160 KB) " "Small ONLINE help files (recommended!) " "No ONLINE help at all " ) (help "BIG Amigaguide documentation:\n" "This is the 'ordinary' AmigaGuide documentation " "If you've already installed it you may save some " "harddisk space if you select it. However, please " "don't forget that the complete file must be loaded " "into RAM, if the ONLINE help is envoced! " "" "Seperate ONLINE help files:\n" "These files are much smaller than the BIG " "documentation file. They need less RAM and " "are loaded much faster." "However they need some KB on your harddisk. " "" "No online help: \n" "If you don't need/like the ONLINE help feature, " "you may choose to select no ONLINE help file " "at all. But don't complain, if there doesn't " "pop up a help requester if you push <HELP>! " ) (default 1) ) ) (if (= onlineparts 0) ( ; ; BIG AmigaGuide file ; ; ; ...already installed ? ; (if (IN docparts 0) ( ; ; Set both help vars to the main guide file ; (set editorhelp (tackon guidedocdest "DFA.guide")) (set prefshelp (tackon guidedocdest "DFA.guide")) ) ( ; ; Not installed -- do it now ; (set guidedocdest (askdir (prompt "Select the location to install the Amigaguide documentation") (help "Choose a destination partition or directory " "to contain the Amigaguide documentation. " "The install program will copy the Amigaguide documentation " "to this directory." ) (default "Help:") ) ) (working "Extracting Amigaguide documentation from archive") (if (AND (NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) ":" )) (NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set guidedocdest (cat guidedocdest "/")) ) ) (set cmdstring (cat "c/lhx e " (tackon docsource "Documentation.lha" ))) (set cmdstring (cat cmdstring " DFA.guide %s")) (run cmdstring guidedocdest) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing Icon...") (source (tackon docsource "DFA.guide.info") (dest guidedocdest)) ) ) ) (if (> error 0) ( (message ("Dos Error %ld detected" @ioerr)) ) ( (tooltype (dest (tackon guidedocdest "DFA.guide")) (noposition)) ) ) ; ; Set both help vars to the main guide file ; (set editorhelp (tackon guidedocdest "DFA.guide")) (set prefshelp (tackon guidedocdest "DFA.guide")) ) ) ) ( (if (= onlineparts 1) ( ; ; Special ONLINE help files ; (if (= doclanguage 0) ( ; ; english ; (set onlinehelpdefdest "Help:English/") ) ) (if (= doclanguage 1) ( ; ; german ; (set onlinehelpdefdest "Help:Deutsch/") ) ) (set onlinehelpdest (askdir (prompt "Select the location to install the ONLINE help") (help "Choose a destination partition or directory " "to contain the online help. " "The install program will copy the online help files " "to this directory." ) (default onlinehelpdefdest) ) ) (working "Extracting ONLINE help from archive") (if (AND (NOT (= (substr onlinehelpdest (- (strlen onlinehelpdest) 1 ) 1 ) ":" )) (NOT (= (substr onlinehelpdest (- (strlen onlinehelpdest) 1 ) 1 ) "/" ))) ( ; ; Destination ends not in ":" or "/", append "/" ; (set onlinehelpdest (cat onlinehelpdest "/")) ) ) (set cmdstring (cat "c/lhx e " (tackon docsource "Documentation.lha" ))) (set cmdstring (cat cmdstring " DFAEditor.guide %s")) (run cmdstring onlinehelpdest) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing Icon...") (source (tackon docsource "DFAEditor.guide.info") (dest onlinehelpdest)) ) ) ) (if (> error 0) ( (message ("Dos Error %ld detected" @ioerr)) ) ( (tooltype (dest (tackon onlinehelpdest "DFAEditor.guide")) (noposition)) ) ) (set cmdstring (cat "c/lhx e " (tackon docsource "Documentation.lha" ))) (set cmdstring (cat cmdstring " DFAPrefs.guide %s")) (run cmdstring onlinehelpdest) ; ; Copy .info file ; (set error (trap 4 (copyfiles (prompt "Installing Icon...") (source (tackon docsource "DFAPrefs.guide.info") (dest onlinehelpdest)) ) ) ) (if (> error 0) ( (message ("Dos Error %ld detected" @ioerr)) ) ( (tooltype (dest (tackon onlinehelpdest "DFAPrefs.guide")) (noposition)) ) ) ; ; Set both help vars to the main guide file ; (set editorhelp (tackon onlinehelpdest "DFAEditor.guide")) (set prefshelp (tackon onlinehelpdest "DFAPrefs.guide")) ) ( (if (= onlineparts 2) ( ; ; NO ONLINE help ; (message "You choosed not to install any online help " "at all. If you want to install it later, " "look in the Documentation.lha archive for " "the files 'DFAEditor.guide' and " "'DFAPrefs.guide'. Use the 'lhx'-utility " "from the 'c' directory to extract these " "files and read the documentation to learn " "how to set the corresponding tooltypes " "for the 'DFA-Editor' and the 'DFA_Prefs' " "program." ) (set editorhelp "") (set prefshelp "") ) ) ) ) ) ) (complete 85) ; ************************** ; Install 3rd party software ; ************************** ; ; Install OwndevUnit ; (set installodu (askbool (prompt "Do you want to install the OwnDevUnit.library\n" "(Version 3.3)?") (help "This library is only needed, if you want to " "dial using DFA. Even then it is only needed, " "if you are using programms like 'getty' that " "sits on the serial device all the time.\n" "In such a case the OwnDevUnit.library allows " "DFA to signal the 'foreign' application that " "it wants to use the serial device.\n " "If it is not currently used, i.e. no data is " "transferred, DFA gets the serial port for " "dialing and returns it as soon as the dialing " "job is completed." ) (default 0) ) ) (if (= installodu 1) ( (set odudest (askdir (prompt "Select the directory where to install the OwnDevUnit.library") (default "Libs:") (help "This library is only needed, if you want to " "dial using DFA. Even then it is only needed, " "if you are using programms like 'getty' that " "sit on the serial device all the time.\n" "In such a case the OwnDevUnit.library allows " "DFA to signal the 'foreign' application that " "it wants to use the serial device.\n" "If it is not currently used, i.e. no data is " "transferred, DFA gets the serial port for " "dialing.\n" ) ) ) (set error (trap 4 (copylib (source "libs/OwnDevUnit.library") (dest odudest) (confirm) (optional) (prompt "Installing the OwnDevUnit.Library...") (help "This library is only needed, if you want to " "dial using DFA. Even then it is only needed, " "if you are using programms like 'getty' that " "sit on the serial device all the time.\n" "In such a case the OwnDevUnit.library allows " "DFA to signal the 'foreign' application that " "it wants to use the serial device.\n" "If it is not currently used, i.e. no data is " "transferred, DFA gets the serial port for " "dialing.\n" ) ) ) ) (if (> error 0) (message ("Dos Error %ld detected" @ioerr)) ) ) ) (complete 90) ; ****************** ; Set some tooltypes ; ****************** ; ; Tooltypes for the executables... ; (message "Now several tooltypes are set:\n\n" "* To DFA: - The path of the DFA-Editor program \n\n" "* To DFAEditor: - The path of the DFA-Prefs program \n" " - The path of the ONLINE help file \n\n" "* To DFAPrefs: - The path of the ONLINE help file \n" ) (tooltype (dest (tackon serverdest "DFA")) (settooltype ("DFAEDITOR") (tackon editordest "DFAEditor"))) (tooltype (dest (tackon editordest "DFAEditor")) (settooltype ("DFAPREFS") (tackon prefsdest "DFAPrefs"))) (tooltype (dest (tackon editordest "DFAEditor")) (settooltype ("GUIDEFILE") (editorhelp))) (tooltype (dest (tackon prefsdest "DFAPrefs")) (settooltype ("GUIDEFILE") (prefshelp))) ; ; No reset all the icon positions... ; (tooltype (dest (tackon serverdest "DFA")) (noposition)) (tooltype (dest (tackon editordest "DFAEditor")) (noposition)) (tooltype (dest (tackon prefsdest "DFAPrefs")) (noposition)) (complete 100) (set EndMsg1 ("The DFA-Server program (DFA) can be found in\n%s\n" serverdest)) (set EndMsg3 ("The DFA-Editor is located in\n%s\n" editordest)) (set EndMsg2 ("and the DFA-Prefs program was copied to\n%s\n" prefsdest)) (exit EndMsg1 EndMsg2 EndMsg3 "\nHave fun using DFA\n (and don't forget that it's SHAREWARE)")