home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Demos / UP-EP004 / EP-Installer < prev    next >
Text File  |  2000-09-27  |  12KB  |  416 lines

  1.  
  2. ;$VER: Up Rough EP Install-script 1.1 (25-Sep-00) ©2000 Up Rough
  3.  
  4. ;****************************************************************************************
  5. ;*                                   File Information                                   *
  6. ;*======================================================================================*
  7. ;*                                                                                      *
  8. ;*         Installation script used to copy/update UPEP main files and copy EPs.        *
  9. ;*                                                                                      *
  10. ;*==========+=============+=============================================================*
  11. ;* YY/MM/DD |     Who     |                          Description                        *
  12. ;*==========+=============+=============================================================*
  13. ;* 00/09/25 |   Nemonic   | Removed ptreplay.library n some other stuff.                *
  14. ;*----------+-------------+-------------------------------------------------------------*
  15. ;* 00/07/25 |   Nemonic   | Temp fix for the font...its now copied every time. What     *
  16. ;*          |             | should be done later is that it should be ver checked....   *
  17. ;*----------+-------------+-------------------------------------------------------------*
  18. ;* 00/06/06 |   Nemonic   | Copied some strings from the ver SPOT had edited ;)         *
  19. ;*----------+-------------+-------------------------------------------------------------*
  20. ;* 00/05/26 |   Nemonic   | Libraries...NEWWpA8...UPEPFont...bla bla...yada yada..      *
  21. ;*----------+-------------+-------------------------------------------------------------*
  22. ;* 00/05/12 |   Nemonic   | Lots of UPEP* changed to EP*.                               *
  23. ;*----------+-------------+-------------------------------------------------------------*
  24. ;* 00/05/02 |   Nemonic   | Got somtn that works pretty good.                           *
  25. ;****************************************************************************************
  26.  
  27. (user 2)            ; User must be expert...even if the user in question isn't one ;p
  28.  
  29. ;****************************************************************************************
  30. ;*                                    Error handling                                    *
  31. ;****************************************************************************************
  32.  
  33. (onerror
  34.  
  35.     (if (> @ioerr 0)
  36.         (
  37.             (message
  38.  
  39.                 ((cat "An error has occurred during installation.\n"
  40.                       "Please check the log file to understand the error."))
  41.             )
  42.         )
  43.     )
  44.  
  45.     (exit (quiet))
  46. )
  47.  
  48. ;****************************************************************************************
  49. ;*                       Check if we are running under correct OS                       *
  50. ;****************************************************************************************
  51.  
  52. (welcome)
  53.  
  54. (if (< (/ (getversion) 65536) 39)
  55.     (
  56.         (abort "Incorrect OS version (software requires OS 39 or better)!")
  57.     )
  58. )
  59.  
  60. ;****************************************************************************************
  61. ;*                            Set the destination directory                             *
  62. ;****************************************************************************************
  63.  
  64. (if (exists "EP:" (NOREQ))
  65.     (
  66.         ; The assign EP: exists...user must have a previous installation
  67.  
  68.         (set @default-dest (getassign "EP"))
  69.         (set previnstall 1)
  70.     )
  71.     ; ELSE
  72.     (
  73.         ; EP: doesn't exist...ask user if there is a previous installation
  74.  
  75.         (set previnstall
  76.             (askbool
  77.  
  78.                 (prompt (cat "Couldn't find the EP: assign!\n"
  79.                              "Have ya got a previous installation of Up Rough EP on your HD?"))
  80.  
  81.                 (help @askbool-help)
  82.  
  83.                 (choices
  84.  
  85.                     "Yea"
  86.                     "No"
  87.                 )
  88.  
  89.                 (default 1)
  90.             )
  91.         )
  92.  
  93.         (if (= previnstall 1)
  94.             (
  95.                 ; User answered yes to that question
  96.                 ; Now he/she have 2 specify where its installed
  97.  
  98.                 (set @default-dest
  99.  
  100.                     (askdir
  101.  
  102.                         (prompt "Then show me where ya got it:")
  103.  
  104.                         (help @askdir-help)
  105.  
  106.                         (default @default-dest)
  107.                     )
  108.                 )
  109.             )            
  110.         )
  111.     )
  112. )
  113.  
  114. ;****************************************************************************************
  115. ;*  If first install, create all needed dirs and copy the icons...and some other stuff  *
  116. ;****************************************************************************************
  117.  
  118. (if (= previnstall 0)
  119.     (
  120.         ; Ask where user want UPEP installed
  121.  
  122.         (set @default-dest
  123.  
  124.             (askdir
  125.  
  126.                 (prompt "Where do ya want da EP to be installed (a drawer will be created):")
  127.  
  128.                 (help @askdir-help)
  129.  
  130.                 (default @default-dest)
  131.             )
  132.         )
  133.  
  134.         ; Create all directories
  135.  
  136.         (makedir (tackon @default-dest "UpRoughEP"))
  137.         (makedir (tackon @default-dest "UpRoughEP/Data"))
  138.         (makedir (tackon @default-dest "UpRoughEP/EPs"))
  139.  
  140.         ; Set @default-dest to our newly created directory
  141.  
  142.         (set @default-dest (tackon @default-dest "UpRoughEP"))
  143.  
  144. ;        ; Let the user select what type of icons to use
  145. ;
  146. ;        (set icontype
  147. ;
  148. ;            (askchoice
  149. ;
  150. ;                (prompt "What type of icons do ya wanna use?")
  151. ;
  152. ;                (help @askchoice-help)
  153. ;
  154. ;                (choices
  155. ;
  156. ;                    "OS3.5"
  157. ;                    "Old style"
  158. ;                )
  159. ;
  160. ;                (default 1)
  161. ;            )
  162. ;        )
  163.  
  164.         ; Copy the icons
  165.  
  166.         (copyfiles
  167.  
  168. ;            (source (tackon "Icons/" (select icontype "3.5" "Old")))
  169.             (source "Icons/")
  170.  
  171.             (dest @default-dest)
  172.  
  173.             (pattern "#?.info")
  174.  
  175.             (optional "fail")
  176.         )
  177.  
  178.         ; Copy the font, some libraries and C: commands
  179.  
  180.         (set copythis
  181.  
  182.             (askoptions
  183.  
  184.                 (prompt (cat "Select what stuff to copy to your SYS: partition...\n"
  185.                              "The ones that are checked as default are requiered!!!"))
  186.  
  187.                 (help @askoptions-help)
  188.  
  189.                 (choices
  190.  
  191.                     "UPEPFont (FONTS:)"
  192.                     "dbplayer.library V2.0 (LIBS:)"
  193. ;                    "ptreplay.library V6.6 (LIBS:)"
  194.                     "NewWPA8 V1.4 (C:) (for AGA users!)"
  195.                 )                
  196.  
  197. ;                (default 7)
  198.                 (default 3)
  199.             )
  200.         )
  201.  
  202.         (set showdocstxt 0)
  203.         (set docstxt "See the Docs/ dir for more info on...\n\n")
  204.  
  205.         (if (BITAND copythis 1)  ; Copy the font?
  206.             (
  207.                 (copyfiles
  208.  
  209.                     (source "Fonts/")
  210.  
  211.                     (dest "FONTS:")
  212.  
  213.                     (all)
  214.  
  215.                     (optional "fail")
  216.                 )
  217.             )
  218.         )
  219.  
  220.         (if (BITAND copythis 2)  ; Copy dbplayer.library?
  221.             (
  222. ;                (copylib
  223. ;
  224. ;                    (prompt "dbplayer.library...")
  225. ;
  226. ;                    (help @copylib-help)
  227. ;
  228. ;                    (source "Libs/dbplayer.library")
  229. ;
  230. ;                    (dest "LIBS:")
  231. ;
  232. ;                    (optional "force" "askuser")
  233. ;
  234. ;                    (confirm "expert")
  235. ;                )
  236.  
  237.                 (copyfiles
  238.  
  239.                     (source "Libs/dbplayer.library")
  240.  
  241.                     (dest "LIBS:")
  242.  
  243.                     (optional "fail")
  244.                 )
  245.  
  246.                 (set showdocstxt 1)
  247.                 (set docstxt (cat docstxt "dbplayer.library (whole arc. avail. on aminet)\n"))
  248.             )
  249.         )
  250.  
  251. ;        (if (BITAND copythis 4)  ; Copy ptreplay.library?
  252. ;            (
  253. ;                (copylib
  254. ;
  255. ;                    (prompt "ptreplay.library...")
  256. ;
  257. ;                    (help @copylib-help)
  258. ;
  259. ;                    (source "Libs/ptreplay.library")
  260. ;
  261. ;                    (dest "LIBS:")
  262. ;
  263. ;                    (optional "force" "askuser")
  264. ;
  265. ;                    (confirm "expert")
  266. ;                )
  267. ;
  268. ;                (set showdocstxt 1)
  269. ;                (set docstxt (cat docstxt "ptreplay.library (whole arc. avail. on aminet)\n"))
  270. ;            )
  271. ;        )
  272.  
  273. ;        (if (BITAND copythis 8)  ; Copy NewWPA8?
  274.         (if (BITAND copythis 4)
  275.             (
  276.                 (copyfiles
  277.  
  278.                     (source "C/NewWPA8")
  279.  
  280.                     (dest "C:")
  281.  
  282.                     (optional "fail")
  283.                 )
  284.  
  285.                 (set showdocstxt 1)
  286.                 (set docstxt (cat docstxt "NewWPA8 (whole arc. avail. on aminet)\n"))
  287.             )
  288.         )
  289.  
  290.         (if (= showdocstxt 1)
  291.             (
  292.                 (message (docstxt))
  293.             )
  294.         )
  295.  
  296.         ; Ask if EP: should be added 2 user-startup...and add it if wanted
  297.  
  298.         (startup "UpRoughEP"
  299.  
  300.             (prompt (cat "Do you want the line\n\n"
  301.                          "assign EP: \"" @default-dest "\"\n"
  302.                          "\nto be added to ya \"s:user-startup\" file?\n"
  303.                          "Since you SHOULD use the enclosed scripts to start EP "
  304.                          "(where the assign is taken care of) there is no need to "
  305.                          "add this line to your user-startup. But it's up to you. "
  306.                          "If you don't want it added then select \"Skip this part\"."))
  307.  
  308.             (help @startup-help)
  309.  
  310.             (command "Assign EP: \"" @default-dest "\"\n")
  311.         )
  312.     )
  313. )
  314.  
  315. ;****************************************************************************************
  316. ;*                              Copy/Update the main files                              *
  317. ;****************************************************************************************
  318.  
  319. ; A little procedure to make version copying easier...really should be a built in
  320. ; function that did the same (I dont wanna use copylib for ordinary files)....BAH!
  321.  
  322. (procedure upepvercpy #srcfile
  323.     (
  324.         (set upepvcpyfile 1)
  325.  
  326.         (if (exists (tackon @default-dest #srcfile) (NOREQ))
  327.             (
  328.                 (if (<= (getversion #srcfile) (getversion (tackon @default-dest #srcfile)))
  329.                     (
  330.                         ; The new file isn't newer than the old
  331.  
  332.                         (set upepvcpyfile 0)
  333.                     )
  334.                 )
  335.             )
  336.         )
  337.  
  338.         (if (= upepvcpyfile 1)
  339.             (
  340.                 (copyfiles
  341.  
  342.                     (source #srcfile)
  343.  
  344.                     (dest @default-dest)
  345.  
  346.                     (optional "fail")
  347.                 )
  348.             )
  349.         )
  350.     )
  351. )
  352.  
  353. ; Copy/Update EP, EP.guide, Prefs, PrefsMUI and Start
  354.  
  355. (upepvercpy "EP")
  356. (upepvercpy "EP.guide")
  357. (upepvercpy "EP.guide.info")
  358. (upepvercpy "Prefs")
  359. (upepvercpy "Prefs.info")
  360. (upepvercpy "PrefsMUI")
  361. (upepvercpy "PrefsMUI.info")
  362. (upepvercpy "Start")
  363. (upepvercpy "Start.info")
  364.  
  365. ; Copy Data/EPLogo.up and Data/EPLogoPal.up
  366.  
  367. (copyfiles
  368.  
  369.     (source "Data/")
  370.  
  371.     (dest (tackon @default-dest "Data"))
  372.  
  373.     (choices "LogoPal.up" "Logo.up")
  374.  
  375.     (optional "fail")
  376. )
  377.  
  378. (copyfiles
  379.  
  380.     (source "Fonts/")
  381.  
  382.     (dest "FONTS:")
  383.  
  384.     (all)
  385.  
  386.     (optional "fail")
  387. )
  388.  
  389. ;****************************************************************************************
  390. ;*                  Let the user choose the EPs to copy...then copy em                  *
  391. ;****************************************************************************************
  392.  
  393. (copyfiles
  394.  
  395.     (prompt "Select EP(s) to install this time...")
  396.  
  397.     (source "EPs/")
  398.  
  399.     (dest (tackon @default-dest "EPs"))
  400.  
  401.     (help @copyfiles-help)
  402.  
  403.     (all)
  404.  
  405.     (confirm "expert")
  406.  
  407.     (optional "fail")
  408. )
  409.  
  410. ;****************************************************************************************
  411. ;*                                         Exit                                         *
  412. ;****************************************************************************************
  413.  
  414. (exit)
  415.  
  416.