home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / blabla / pcbdesigner / install < prev    next >
Text File  |  1998-01-24  |  7KB  |  292 lines

  1. ;Installer script for PCBDesigner 0.34.
  2. ;by Grzegorz Kraszewski 1997
  3. ;$VER: PCBDesigner install 0.34 (28.10.97)
  4.  
  5. (complete 0)
  6.  
  7. ;*********** Installer version checking
  8.  
  9. (if (< @installer-version 2818051)
  10.     (abort "This script requires Installer v43.3 or newer. Please update.")
  11. )
  12.  
  13. ;*********** Check if MUI is installed.
  14.  
  15. (set #muiversion (getversion "LIBS:muimaster.library"))
  16.  
  17. (if (= #muiversion 0)
  18.     (abort "You haven't installed Magic User Interface (MUI), which is required by PCBDesigner (read the manual).")
  19. )
  20.  
  21. ;*********** Check MUI version. Expert gets additional informations.
  22.  
  23. (if (< #muiversion 720896)
  24.     (
  25.       (if (= @user-level 2)
  26.           (
  27.             (set #version (/ #muiversion 65536))
  28.             (set #revision (- #muiversion (* #version 65536)))
  29.              (message ("You have \"muimaster.library\" %ld.%ld installed, while PCBDesigner requires 11.0 or higher." #version #revision))
  30.           )
  31.       )
  32.       (abort "Your Magic User Interface (MUI) is too old. Please upgrade. PCBDesigner requires version 3.0 or higher (read the manual).")
  33.     )
  34. )
  35.  
  36. ;*********** Get destination directory from user.
  37.  
  38. (set #instdir
  39.   (askdir 
  40.     (prompt "Where to make \"PCBDesigner\" drawer?")
  41.     (help "You have to choose place on the harddisk, where PCBDesigner will be installed. \"PCBDesigner\" drawer will be created, all neccesary files will be placed in.")
  42.     (default @default-dest)
  43.   )
  44. )
  45.  
  46. ;*********** Get full destination path.
  47.  
  48. (set #destdir
  49.   (tackon #instdir "PCBDesigner")
  50. )
  51.  
  52. ;*********** Ask for installing additional files (not in NOVICE mode).
  53.  
  54. ;*********** NOVICE:
  55.  
  56. (if (= @user-level 0)
  57.     (
  58.       (set #instaldoc 1)
  59.       (set #installocpl 0)
  60.       (set #instalcdct 0)
  61.       (set #instaldocpl 0)
  62.       (set #instalconfig 1)
  63.     )
  64. )
  65.  
  66. ;*********** ADVANCED:
  67.  
  68. (if (= @user-level 1)
  69.     (
  70.       (set #bitmask
  71.         (askoptions
  72.           (prompt "Which additional files do You want to install?")
  73.           (help "Select additional elements of PCBDesigner, they are not neccesary to run the program, but makes work easier and nicer.")
  74.           (choices "documentation")
  75.         )
  76.       )
  77.       (if (BITAND #bitmask $00000001)
  78.           (set #instaldoc 1)
  79.           (set #instaldoc 0)
  80.       )
  81.       (set #installocpl 0)
  82.       (set #instalcdct 0)
  83.       (set #instaldocpl 0)
  84.       (set #instalconfig 1)
  85.     )
  86. )
  87.  
  88. ;*********** EXPERT:
  89.  
  90. (if (= @user-level 2)
  91.     (
  92.       (set #bitmask
  93.         (askoptions
  94.           (prompt "Which additional files do You want to install?")
  95.           (help "Select additional elements of PCBDesigner, they are not neccesary to run the program, but makes work easier and nicer.")
  96.           (choices "documentation" "default configuration" ".cd file" "Polish documentation" "Polish locale")
  97.         )
  98.       )
  99.       (if (BITAND #bitmask $00000001)
  100.           (set #instaldoc 1)
  101.           (set #instaldoc 0)
  102.       )
  103.       (if (BITAND #bitmask $00000002)
  104.           (set #instalconfig 1)
  105.           (set #instalconfig 0)
  106.       )
  107.       (if (BITAND #bitmask $00000004)
  108.           (set #instalcdct 1)
  109.           (set #instalcdct 0)
  110.       )
  111.       (if (BITAND #bitmask $00000008)
  112.           (set #instaldocpl 1)
  113.           (set #instaldocpl 0)
  114.       )
  115.       (if (BITAND #bitmask $00000010)
  116.           (set #installocpl 1)
  117.           (set #installocpl 0)
  118.       )
  119.     )
  120. )
  121.  
  122. ;*********** Ask for overwrite old version.
  123.  
  124.  
  125. (if (> @user-level 0)
  126.     (if (exists #destdir)
  127.         (if (NOT (askbool
  128.                    (prompt "ATTENTION! Directory " #destdir " already exists. Overwrite old files? (icons won't be overwritten)")
  129.                    (help "Directory \"PCBDesigner\" already exist in \"" #instdir "\". If You continue installation all old PCBDesigner files (except icons) will be replaced by new ones. Icons will stay intact, so You neend't rearrange them.")
  130.                  )
  131.             )
  132.             (abort "Installation aborted.")
  133.         )
  134.     )
  135. )
  136.  
  137. ;*********** Creating dest drawer.
  138.          
  139. (makedir #destdir)
  140.  
  141. (complete 10)
  142.  
  143. ;*********** Copying main file.
  144.  
  145. (copyfiles
  146.   (source "PCBDesigner")
  147.   (dest #destdir)
  148. )
  149.  
  150. (complete 30)
  151.  
  152. ;*********** Copying images.
  153.  
  154. (copyfiles
  155.   (source "Images")
  156.   (dest (tackon #destdir "Images"))
  157.   (all)
  158. )
  159.  
  160. (complete 50)
  161.  
  162. ;*********** Copying English docs.
  163.  
  164. (if (= #instaldoc 1)
  165.     (
  166.       (copyfiles
  167.         (source "Docs/PCBDesigner.guide")
  168.         (dest (tackon #destdir "Docs"))
  169.       )
  170.       (if (NOT (exists (tackon #destdir "Docs/PCBDesigner.guide.info")))
  171.           (copyfiles
  172.             (source "Docs/PCBDesigner.guide.info")
  173.             (dest (tackon #destdir "Docs"))
  174.           )
  175.       )
  176.       (copyfiles
  177.         (source "Docs/AFD-COPYRIGHT")
  178.         (dest (tackon #destdir "Docs"))
  179.       )
  180.     )
  181. )
  182.  
  183. ;*********** Copying Polish docs.
  184.  
  185. (if (= #instaldocpl 1)
  186.     (
  187.       (copyfiles
  188.         (source "Docs/PCBDesignerPL.guide")
  189.         (dest (tackon #destdir "Docs"))
  190.       )
  191.       (if (NOT (exists (tackon #destdir "Docs/PCBDesignerPL.guide.info")))
  192.           (copyfiles
  193.             (source "Docs/PCBDesignerPL.guide.info")
  194.             (dest (tackon #destdir "Docs"))
  195.           )
  196.       )
  197.       (copyfiles
  198.         (source "Docs/AFD-COPYRIGHT.pl")
  199.         (dest (tackon #destdir "Docs"))
  200.       )
  201.     )
  202. )
  203.  
  204. (complete 70)
  205.  
  206. ;*********** Copying Polish locale.
  207.  
  208. (if (= #installocpl 1)
  209.     (
  210.       (makedir (tackon #destdir "Catalogs"))
  211.       (copyfiles
  212.         (source "Catalogs/polski/pcbdesigner.catalog")
  213.         (dest (tackon #destdir "Catalogs/polski"))
  214.       )
  215.     )
  216. )
  217.  
  218. (complete 85)
  219.  
  220. ;*********** Copying .cd file.
  221.  
  222. (if (= #instalcdct 1)
  223.     (copyfiles
  224.       (source "Catalogs/pcbdesigner.cd")
  225.       (dest (tackon #destdir "Catalogs"))
  226.     )
  227. )
  228.  
  229. (complete 90)
  230.  
  231. ;*********** Copying default configuration file to ENVARC:
  232.  
  233. (if (= #instalconfig 1)
  234.     (
  235.       (if (exists "ENVARC:mui/PCBDESIGNER.1.cfg")
  236.           (if (= @user-level 2)
  237.               (set #instalconfig
  238.                 (askbool
  239.                   (prompt "PCBDesigner configuration file in ENVARC:mui drawer already exists. Overwrite it with defaults?")
  240.                   (help "If You overwrite Your configuration file all program settings changes to defaults.")
  241.                 )
  242.               )
  243.               (set #instalconfig 0)
  244.           )
  245.       )
  246.       (if (= #instalconfig 1)
  247.           (copyfiles
  248.             (source "PCBDESIGNER.1.cfg")
  249.             (dest "ENVARC:mui")
  250.           )
  251.       )
  252.     )
  253. )
  254.  
  255. (complete 95)
  256.  
  257. ;*********** Copying icons.
  258.  
  259. ;*********** Copying main drawer icon.
  260.  
  261. (if (NOT (exists (tackon #instdir "PCBDesigner.info")))
  262.     (copyfiles
  263.       (source "PCBdrawer.icon")
  264.       (newname "PCBDesigner.info")
  265.       (dest #instdir)
  266.     )
  267. )
  268.  
  269. ;*********** Copying program icon.
  270.  
  271. (if (NOT (exists (tackon #destdir "PCBDesigner.info")))
  272.     (copyfiles
  273.       (source "PCBDesigner.info")
  274.       (dest #destdir)
  275.     )
  276. )
  277.  
  278. ;*********** Copying Docs drawer icon.
  279.  
  280. (if (AND (= #instaldoc 1) (NOT (exists (tackon #destdir "Docs.info"))))
  281.     (copyfiles
  282.       (source "Docs.info")
  283.       (dest #destdir)
  284.     )
  285. )
  286.  
  287. (complete 100)
  288.  
  289. (set @default-dest #instdir)
  290.  
  291. (exit)
  292.