home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / biz / dfa-2.0.lha / DFA / Install-DFA < prev    next >
Text File  |  1994-04-10  |  26KB  |  1,167 lines

  1. ; $VER: DFA 2.0 (05.02.94)
  2. ; Script to install DFA V 2.0
  3.  
  4. (transcript "Installing the DFA - Address utility...")
  5.  
  6.     ; *************************
  7.     ; Try to uninstall DFA V1.x
  8.     ; *************************
  9.     ;
  10.     ; Notice that even parts of DFA V2.0 may be 
  11.     ; deinstalled:-)
  12.  
  13.  
  14.     ;
  15.     ; Is an old DFA (V1.x) present?
  16.     ;
  17.  
  18. (if (OR (OR (exists "ENV:DFA/DFA.prefs")
  19.             (exists "SYS:WBStartup/DFA"))
  20.         (OR (exists "Locale:Catalogs/deutsch/dfa.catalog")
  21.             (exists "Locale:Catalogs/dansk/dfa.catalog")))
  22.     (
  23.         (if (askbool
  24.             (prompt "There is an old version of DFA on "
  25.                     "your harddisk!\n\n"
  26.                     "Do you want to uninstall it?\n"
  27.             )
  28.             (help    "If you select 'YES', the old DFA "
  29.                     "and all related files, i.e. locale "
  30.                     "catalogs, preferences etc. are deleted. "
  31.                     "The address files are not touched, "
  32.                     "so you won't loose any addresses! "
  33.             )
  34.             )
  35.             (
  36.                 ;
  37.                 ; Uninstall DFA 1.x
  38.                 ;
  39.  
  40.                 (if (NOT (= (getassign "Locale") ""))
  41.                     (
  42.                         ;
  43.                         ; Delete locale catalogs
  44.                         ;
  45.  
  46.                         (working "Deleting catalog files of DFA V1.x...")
  47.  
  48.                         (run "delete Locale:Catalogs/dansk/dfa.catalog")
  49.                         (run "delete Locale:Catalogs/deutsch/dfa.catalog")
  50.                         (run "delete Locale:Catalogs/italiano/dfa.catalog")
  51.                         (run "delete Locale:Catalogs/nederlands/dfa.catalog")
  52.                         (run "delete Locale:Catalogs/suomi/dfa.catalog")
  53.                         (run "delete Locale:Catalogs/svenska/dfa.catalog")
  54.  
  55.                     )
  56.                 )
  57.  
  58.                 (if (exists "ENV:DFA/DFA.prefs")
  59.                     (
  60.                         ;
  61.                         ; Delete prefs
  62.                         ;
  63.  
  64.                         (working "Deleting preferences file of DFA V1.x...")
  65.  
  66.                         (run "delete ENV:DFA/DFA.prefs")
  67.                         (run "delete ENVARC:DFA/DFA.prefs")
  68.                     )
  69.                 )
  70.  
  71.                 (if (exists "SYS:WBStartup/DFA")
  72.                     (
  73.                         ;
  74.                         ; Delete DFA executable
  75.                         ;
  76.  
  77.                         (working "Deleting DFA V1.x executable...")
  78.  
  79.                         (run "delete SYS:WBStartup/DFA")
  80.                         (run "delete SYS:WBStartup/DFA.info")
  81.                     )
  82.                 )
  83.             )
  84.         )
  85.     )
  86.     (
  87.         (message
  88.             (    "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."
  89.             )
  90.         )
  91.     )
  92. )
  93.  
  94. (message
  95.     (    "*** 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"
  96.     )
  97. )
  98.  
  99.  
  100. (set @default-dest "SYS:")
  101.  
  102. (complete 0)
  103.  
  104. ;
  105. ; Set the dir and archive name for the binaries
  106. ;
  107.  
  108. (set bindir "DFA/")
  109. (set binarchive "DFA/DFA-20.lha")
  110.  
  111.  
  112.     ; ************************
  113.     ; Install the DFA - Server
  114.     ; ************************
  115.  
  116.     ;
  117.     ; Select destination drawer
  118.     ;
  119.  
  120. (set serverdest
  121.     (askdir
  122.         (prompt "Please select a place for the DFA-Server executable")
  123.         (default "SYS:WBStartup")
  124.         (help    "Choose a destination partition or directory "
  125.                 "to contain the DFA-Server executable.  The install "
  126.                 "program copies the DFA-Server executable 'DFA' "
  127.                 "to the location you choose. "
  128.                 "No extra drawer will be created! "
  129.         )
  130.     )
  131. )
  132.  
  133.     ;
  134.     ; Extract executable from archive
  135.     ;
  136.  
  137. (working "Extracting DFA-Server executable from archive...")
  138.  
  139. (if (AND (NOT (= (substr serverdest (- (strlen serverdest) 1 ) 1 ) ":" ))
  140.     (NOT (= (substr serverdest (- (strlen serverdest) 1 ) 1 ) "/" )))
  141.     (
  142.             ;
  143.             ; Destination ends not in ":" or "/", append "/"
  144.             ;
  145.  
  146.         (set serverdest (cat serverdest "/"))
  147.     )
  148. )
  149.  
  150.     ;
  151.     ; Generate command string...
  152.     ;
  153.  
  154. (set cmdstring "c/lhx e ")
  155. (set cmdstring (cat cmdstring binarchive))
  156. (set cmdstring (cat cmdstring " DFA "))
  157. (set cmdstring (cat cmdstring serverdest))
  158.  
  159.     ;
  160.     ; ...and execute it
  161.     ;
  162.  
  163. (run cmdstring)
  164.  
  165.     ;
  166.     ; Copy .info file
  167.     ;
  168.  
  169. (set error
  170.     (trap 4
  171.         (copyfiles
  172.             (prompt "Installing DFA-Server Icon...")
  173.             (source (tackon bindir "DFA.info")) (dest serverdest)
  174.         )
  175.     )
  176. )
  177.  
  178. (if (> error 0)
  179.     (message ("Dos Error %ld detected" @ioerr))
  180. )
  181.  
  182. (complete 10)
  183.  
  184.  
  185.     ; ************************
  186.     ; Install the DFA - Editor
  187.     ; ************************
  188.  
  189.     ;
  190.     ; Select destination drawer
  191.     ;
  192.  
  193. (set editordest
  194.     (askdir
  195.         (prompt "Please select a place for the DFA-Editor executable")
  196.         (default "C:")
  197.         (help    "Choose a destination partition or directory "
  198.                 "to contain the DFA-Editor executable.  The install "
  199.                 "program copies the DFA-Editor executable 'DFAEditor' "
  200.                 "to the location you choose. "
  201.                 "No extra drawer will be created! "
  202.         )
  203.     )
  204. )
  205.  
  206.     ;
  207.     ; Extract executable from archive
  208.     ;
  209.  
  210. (working "Extracting DFA-Editor executable from archive...")
  211.  
  212. (if (AND (NOT (= (substr editordest (- (strlen editordest) 1 ) 1 ) ":" ))
  213.         (NOT (= (substr editordest (- (strlen editordest) 1 ) 1 ) "/" )))
  214.     (
  215.             ;
  216.             ; Destination ends not in ":" or "/", append "/"
  217.             ;
  218.  
  219.         (set editordest (cat editordest "/"))
  220.     )
  221. )
  222.  
  223. (set cmdstring (cat "c/lhx e " binarchive))
  224. (set cmdstring (cat cmdstring " DFAEditor "))
  225. (set cmdstring (cat cmdstring editordest))
  226.  
  227. (run cmdstring)
  228.  
  229.     ;
  230.     ; Copy .info file
  231.     ;
  232.  
  233. (set error
  234.     (trap 4
  235.         (copyfiles
  236.             (prompt "Installing DFA-Editor Icon...")
  237.             (source (tackon bindir "DFAEditor.info"))
  238.             (dest editordest)
  239.         )
  240.     )
  241. )
  242.  
  243. (if (> error 0)
  244.     (message ("Dos Error %ld detected" @ioerr))
  245. )
  246.  
  247. (complete 20)
  248.  
  249.     ; ***************************************
  250.     ; Install the DFA - Preferences - Program
  251.     ; ***************************************
  252.  
  253.     ;
  254.     ; Select destination drawer
  255.     ;
  256.  
  257. (set prefsdest
  258.     (askdir
  259.         (prompt "Please select a place for the DFA-Prefs executable")
  260.         (default "SYS:Prefs")
  261.         (help    "Choose a destination partition or directory "
  262.                 "to contain the DFA-Prefs executable.  The install "
  263.                 "program copies the DFA-Prefs executable 'DFAPrefs' "
  264.                 "to the location you choose. "
  265.                 "No extra drawer will be created! "
  266.         )
  267.     )
  268. )
  269.  
  270.     ;
  271.     ; Extract executable from archive
  272.     ;
  273.  
  274. (working "Extracting DFA-Prefs executable from archive...")
  275.  
  276. (if (AND (NOT (= (substr prefsdest (- (strlen prefsdest) 1 ) 1 ) ":" ))
  277.         (NOT (= (substr prefsdest (- (strlen prefsdest) 1 ) 1 ) "/" )))
  278.     (
  279.             ;
  280.             ; Destination ends not in ":" or "/", append "/"
  281.             ;
  282.  
  283.             (set prefsdest (cat prefsdest "/"))
  284.     )
  285. )
  286.  
  287. (set cmdstring (cat "c/lhx e " binarchive))
  288. (set cmdstring (cat cmdstring " DFAPrefs %s"))
  289.  
  290. (run cmdstring prefsdest)
  291.  
  292.     ;
  293.     ; Copy .info file
  294.     ;
  295.  
  296. (set error
  297.     (trap 4
  298.         (copyfiles
  299.             (prompt "Installing DFA-Editor Icon...")
  300.             (source (tackon bindir "DFAPrefs.info"))
  301.             (dest prefsdest)
  302.         )
  303.     )
  304. )
  305.  
  306. (if (> error 0)
  307.     (message ("Dos Error %ld detected" @ioerr))
  308. )
  309.  
  310. (complete 30)
  311.  
  312.     ; *************************
  313.     ; Install the DFA - Library
  314.     ; *************************
  315.  
  316.     ;
  317.     ; Select destination drawer
  318.     ;
  319.  
  320. (set libdest
  321.     (askdir
  322.         (prompt "Please select a place for the DFA-Library")
  323.         (default "LIBS:")
  324.         (help    "Choose a destination partition or directory "
  325.                 "to contain the DFA-Library.  The install "
  326.                 "program copies the DFA-Library 'dfa.library' "
  327.                 "to the location you choose. "
  328.                 "No extra drawer will be created! "
  329.         )
  330.     )
  331. )
  332.  
  333.     ;
  334.     ; Extract executable from archive
  335.     ;
  336.  
  337. (working "Extracting the DFA-Library from archive...")
  338.  
  339. (if (AND (NOT (= (substr libdest (- (strlen libdest) 1 ) 1 ) ":" ))
  340.         (NOT (= (substr libdest (- (strlen libdest) 1 ) 1 ) "/" )))
  341.     (
  342.             ;
  343.             ; Destination ends not in ":" or "/", append "/"
  344.             ;
  345.  
  346.         (set libdest (cat libdest "/"))
  347.     )
  348. )
  349.  
  350. (set cmdstring (cat "c/lhx e " binarchive))
  351. (set cmdstring (cat cmdstring " dfa.library %s"))
  352.  
  353. (run cmdstring libdest)
  354.  
  355. (complete 35)
  356.  
  357.     ; ********************
  358.     ; Install Locale files
  359.     ; ********************
  360.  
  361.     ;
  362.     ; Locale: drawer present ?
  363.     ;
  364.  
  365. (if (AND (NOT (= (getassign "Locale") "")) (exists "libs:locale.library"))
  366.     (
  367.         ;
  368.         ; Select language(s)
  369.         ;
  370.  
  371.         (set language
  372.             (askoptions
  373.                 (prompt "Which language(s) do you want to get installed?")
  374.                     (choices    "German" )
  375.  
  376.                 (help    "You may choose none, one or more languages. "
  377.                         "If you don't have an operation system that "
  378.                         "supports locale, please select no language "
  379.                         "at all. "
  380.                         "Locale support is given in Workbench 2.1 "
  381.                         "and above. "
  382.                         "Please note that English is t