home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 1 / Mecomp-CD.iso / amiga / tools / system / visualprefs / install < prev    next >
Text File  |  1997-07-21  |  10KB  |  383 lines

  1. ;** $VER: VisualPrefsBeta_install 40.10 (7.5.97) by Nik Soggia <nsoggia@telnetwork.it>
  2. ;**
  3. ;** modified (17.5.97) by Massimo Tantignone
  4. ;** modified (13.6.97) by Massimo Tantignone
  5. ;** modified (19.7.97) by Massimo Tantignone
  6. ;** modified (21.7.97) by Massimo Tantignone
  7. ;**
  8. ;** requires:
  9. ;** - RexxMast, Rx, Search and Edit commands
  10. ;** - T: and ENV: assignments for temporary files
  11.  
  12. ;***************************************
  13. ;** MESSAGES (DEFAULT: ENGLISH)
  14.  
  15. (set msg_rx    "Installer is unable to locate the \"Rx\" command")
  16. (set msg_rxm   "Installer is unable to locate the \"RexxMast\" command")
  17. (set msg_rxp   "Please locate it:")
  18. (set msg_wait  "Checking installation")
  19. (set msg_vpi   "A copy of VisualPrefs is already installed")
  20. (set msg_vpn   "VisualPrefs is not installed")
  21. (set msg_dir   "A drawer WILL NOT be created")
  22. (set msg_seldr "Select the destination drawer:")
  23. (set msg_lang  "What language catalogs do you want to install?")
  24. (set msg_l_ita "Italiano")
  25. (set msg_icoo  "Normal icons")
  26. (set msg_icon  "NewIcons")
  27. (set msg_icom  "Magic WB")
  28. (set msg_icoi  "Iconographics")
  29. (set msg_icop  "Select icon set")
  30. (set msg_exa   "Install example preferences?")
  31. (set msg_done  "VisualPrefs will be available next time you boot.")
  32. (set msg_done2 "\n\nIf you use them, you should remove Prop3D and\nCenterTitles from your User-startup.")
  33. (set rxhelp    "Use the file requester to select the \"Rx\" program.")
  34. (set rxmhelp   "Use the file requester to select the \"RexxMast\" program.")
  35. (set dirhelp   "Select the drawer into which VisualPrefs is to be copied.\nIt should reside in the system command path.")
  36. (set langhelp  "Choose one or more languages for VisualPrefs and the GUI editor.\nYou can later select which one to use with the Locale preferences editor.")
  37. (set iconhelp  "Choose the style for the icons to be installed.")
  38. (set exahelp   "If you select \"Yes\", an example preferences file (preset) will be copied into your SYS:Prefs/Presets drawer.")
  39. (set var_docd  "DocsEnglish")
  40. (set var_docr  "ReadMe")
  41. ;(set var_docc  "Changes")
  42.  
  43. ;***************************************
  44. ;** MESSAGES (ITALIANO)
  45.  
  46. (if (= @language  "italiano")(
  47.    (set msg_rx    "Installer non è in grado di trovare il comando \"Rx\"")
  48.    (set msg_rxm   "Installer non è in grado di trovare il comando \"RexxMast\"")
  49.    (set msg_rxp   "Per favore, localizzatelo:")
  50.    (set msg_wait  "Verifica installazione")
  51.    (set msg_vpi   "Una copia di VisualPrefs è già installata")
  52.    (set msg_vpn   "VisualPrefs non è installato")
  53.    (set msg_dir   "NON verrà creato alcun cassetto")
  54.    (set msg_seldr "Scegliere il cassetto di destinazione:")
  55.    (set msg_lang  "Per quali lingue deve essere installato un catalog?")
  56.    (set msg_l_ita "Italiano")
  57.    (set msg_icoo  "Normali")
  58.    (set msg_icon  "NewIcons")
  59.    (set msg_icom  "Magic WB")
  60.    (set msg_icoi  "Iconographics")
  61.    (set msg_icop  "Selezionare il set di icone")
  62.    (set msg_exa   "Installare preferenze di esempio?")
  63.    (set msg_done  "VisualPrefs sarà disponibile dopo il prossimo reboot.")
  64.    (set msg_done2 "\n\nSe li usate, dovreste rimuovere Prop3D e\nCenterTitles dalla vostra User-startup.")
  65.    (set rxhelp    "Usate il file requester per selezionare il programma \"Rx\".")
  66.    (set rxmhelp   "Usate il file requester per selezionare il programma \"RexxMast\".")
  67.    (set dirhelp   "Selezionare il cassetto in cui deve essere copiato VisualPrefs.\nDovrebbe trovarsi nel path dei comandi di sistema.")
  68.    (set langhelp  "Scegliere una o più lingue per VisualPrefs e l'editor GUI.\nIn seguito si potrà scegliere quale usare con l'editor di preferenze Locale.")
  69.    (set iconhelp  "Scegliere lo stile per le icone da installare.")
  70.    (set exahelp   "Selezionando \"Sì\" verrà copiato un file di preferenze di esempio (preset) nel vostro cassetto SYS:Prefs/Presets.")
  71.    (set var_docd  "DocsItaliano")
  72.    (set var_docr  "Leggimi")
  73.    ;(set var_docc  "Cambiamenti")
  74. ))
  75.  
  76. ;***************************************
  77. ;** LOCATE AREXX PROGRAMS
  78.  
  79. (if (= 1 (exists "sys:rexxc/rx" (noreq)))
  80.    (set var_rx "sys:rexxc/rx")
  81.    (if (= 1 (exists "c:rx" (noreq)))
  82.       (set var_rx "c:rx")
  83.       (set var_rx
  84.          (askfile
  85.             (default "SYS:RexxC/Rx")
  86.             (help rxhelp)
  87.             (prompt msg_rx ".\n\n" msg_rxp)
  88.          )
  89.       )
  90.    )
  91. )
  92.  
  93. (set var_rxm (tackon (pathonly var_rx) "rexxmast"))
  94.  
  95. (if (= 0 (exists var_rxm (noreq)))
  96.    (if (= 1 (exists "sys:rexxc/rexxmast" (noreq)))
  97.       (set var_rxm "sys:rexxc/rexxmast")
  98.       (if (= 1 (exists "c:rexxmast" (noreq)))
  99.          (set var_rxm "c:rexxmast")
  100.          (if (= 1 (exists "sys:system/rexxmast" (noreq)))
  101.             (set var_rxm "sys:system/rexxmast")
  102.             (set var_rxm
  103.                (askfile
  104.                   (default "SYS:System/RexxMast")
  105.                   (help rxmhelp)
  106.                   (prompt msg_rxm ".\n\n" msg_rxp)
  107.                )
  108.             )
  109.          )
  110.       )
  111.    )
  112. )
  113.  
  114. (run var_rxm)
  115.  
  116. ;***************************************
  117. ;** CHECK PREVIOUS INSTALLATION
  118.  
  119. (working "(" msg_wait ")")
  120.  
  121. (delete "t:installvp.rx" (optional force) (safe))
  122. (textfile
  123.    (safe)
  124.    (dest "t:installvp.rx")
  125.    (append (cat
  126.       "/* filter */\n"
  127.       "\n"
  128.       "pull string\n"
  129.       "\n"
  130.       "comment=pos(';',string)\n"
  131.       "if comment~==0 then string=trim(left(string,comment-1))\n"
  132.       "say right(string,length(string)-lastpos(' ',string))\n"
  133.    ))
  134. )
  135.  
  136. (delete "t:installvp.sh" (optional force) (safe))
  137. (textfile
  138.    (safe)
  139.    (dest "t:installvp.sh")
  140.    (append (cat
  141.       "delete force t:installvp.out\n"
  142.       "\n"
  143.       "search >t:installvp.out search visualprefs S:Startup-sequence\n"
  144.       "if $RC eq 0\n"
  145.       "   setenv installvp_vp 1\n"
  146.       "   setenv installvp_vpp `" var_rx " <t:installvp.out t:installvp.rx`\n"
  147.       "else\n"
  148.       "   setenv installvp_vp 0\n"
  149.       "   setenv installvp_vpp \"\"\n"
  150.       "endif\n"
  151.       "delete t:installvp.out\n"
  152.       "\n"
  153.    ))
  154. )
  155.  
  156. (execute "t:installvp.sh" (safe))
  157. (delete "t:installvp.rx" (safe))
  158. (delete "t:installvp.sh" (safe))
  159.  
  160. (set var_vp (getenv "installvp_vp"))
  161. (set var_vpp (getenv "installvp_vpp"))
  162. (run "unsetenv installvp_vp")
  163. (run "unsetenv installvp_vpp")
  164.  
  165. (if (= 1 var_vp)
  166.    (
  167.       (set @default-dest (pathonly var_vpp))
  168.       (set msg_vp msg_vpi)
  169.    )
  170.    (set msg_vp msg_vpn)
  171. )
  172.  
  173. (complete 5)
  174.  
  175. (set no_break_warning
  176.    (askdir
  177.       (default @default-dest)
  178.       (help dirhelp)
  179.       (prompt (cat msg_vp ".\n" msg_dir ".\n\n" msg_seldr))
  180.    )
  181. )
  182. (set @default-dest (tackon no_break_warning ""))
  183.  
  184. ;***************************************
  185. ;** ASK INSTALLATION PREFERENCES
  186.  
  187. (complete 10)
  188.  
  189. (set var_lang
  190.    (askoptions
  191.       (prompt msg_lang)
  192.       (help langhelp)
  193.       (choices msg_l_ita)
  194.       (default 1)
  195.    )
  196. )
  197.  
  198. (complete 12)
  199.  
  200. (set var_icon
  201.    (askchoice
  202.       (prompt msg_icop)
  203.       (help iconhelp)
  204.       (choices msg_icoo msg_icon msg_icom msg_icoi)
  205.    )
  206. )
  207.  
  208. (complete 15)
  209.  
  210. (set var_exa
  211.    (askbool
  212.       (prompt msg_exa)
  213.       (help exahelp)
  214.    )
  215. )
  216.  
  217. ;***************************************
  218. ;** INSTALL FILES: VISUALPREFS
  219.  
  220. (complete 20)
  221.  
  222. (copyfiles
  223.    (source "VisualPrefs")
  224.    (dest @default-dest)
  225.    (infos) (noposition)
  226. )
  227.  
  228. ;***************************************
  229. ;** INSTALL FILES: DOCUMENTATION
  230.  
  231. (complete 30)
  232.  
  233. (copyfiles
  234.    (source (tackon var_docd ""))
  235.    (dest @default-dest)
  236.    (all) (infos) (noposition)
  237. )
  238.  
  239. ;***************************************
  240. ;** INSTALL FILES: GUI-PREFS
  241.  
  242. (complete 40)
  243.  
  244. (copyfiles
  245.    (source "Prefs/GUI")
  246.    (dest "SYS:Prefs/")
  247.    (infos) (noposition)
  248. )
  249.  
  250. ;***************************************
  251. ;** INSTALL FILES: CATALOGS
  252.  
  253. (complete 50)
  254.  
  255. (if (bitand var_lang 1)
  256.    (
  257.       (copyfiles
  258.          (source "Catalogs/italiano/gui.catalog")
  259.          (dest "LOCALE:Catalogs/italiano/")
  260.       )
  261.    )
  262. )
  263.  
  264. ;***************************************
  265. ;** INSTALL FILES: ICONS
  266.  
  267. (complete 60)
  268.  
  269. (if (= 1 var_icon)(
  270.    (copyfiles
  271.       (source "NewIcons/GUI.info")
  272.       (dest "SYS:Prefs/")
  273.       (noposition)
  274.    )
  275.    (copyfiles
  276.       (source "NewIcons/doc.info")
  277.       (dest @default-dest)
  278.       (newname (cat var_docr ".info"))
  279.       (noposition)
  280.    )
  281. ;   (copyfiles
  282. ;      (source "NewIcons/doc.info")
  283. ;      (dest @default-dest)
  284. ;      (newname (cat var_docc ".info"))
  285. ;      (noposition)
  286. ;   )
  287. ))
  288.  
  289. (if (= 2 var_icon)(
  290.    (copyfiles
  291.       (source "MagicWB/GUI.info")
  292.       (dest "SYS:Prefs/")
  293.       (noposition)
  294.    )
  295.    (copyfiles
  296.       (source "MagicWB/doc.info")
  297.       (dest @default-dest)
  298.       (newname (cat var_docr ".info"))
  299.       (noposition)
  300.    )
  301. ;   (copyfiles
  302. ;      (source "MagicWB/doc.info")
  303. ;      (dest @default-dest)
  304. ;      (newname (cat var_docc ".info"))
  305. ;      (noposition)
  306. ;   )
  307. ))
  308.  
  309. (if (= 3 var_icon)(
  310.    (copyfiles
  311.       (source "Iconographics/GUI.info")
  312.       (dest "SYS:Prefs/")
  313.       (noposition)
  314.    )
  315.    (copyfiles
  316.       (source "Iconographics/doc.info")
  317.       (dest @default-dest)
  318.       (newname (cat var_docr ".info"))
  319.       (noposition)
  320.    )
  321. ;   (copyfiles
  322. ;      (source "Iconographics/doc.info")
  323. ;      (dest @default-dest)
  324. ;      (newname (cat var_docc ".info"))
  325. ;      (noposition)
  326. ;   )
  327. ))
  328.  
  329. ;***************************************
  330. ;** INSTALL FILES: SAMPLE PREFS
  331.  
  332. (complete 70)
  333.  
  334. (if (= 1 var_exa)
  335.    (copyfiles
  336.       (source "Prefs/Presets/")
  337.       (dest "SYS:Prefs/Presets/")
  338.       (all) (infos) (noposition)
  339.    )
  340. )
  341.  
  342. ;***************************************
  343. ;** INSTALL FILES: NEW PREFERENCES FILE
  344.  
  345. ;(complete 80)
  346.  
  347. ;(rename "ENVARC:Sys/gui.prefs" "ENVARC:Sys/beta_gui.prefs")
  348. ;(run "Tools/ConvertGUIPrefs > NIL: ENVARC:Sys/beta_gui.prefs ENVARC:Sys/gui.prefs")
  349.  
  350. ;***************************************
  351. ;** STARTUP-SEQUENCE
  352.  
  353. (complete 90)
  354.  
  355. (if (= 0 var_vp)(
  356.    (run "setenv installvp_ip `search nonum search C:IPrefs S:Startup-sequence`")
  357.    (set var_iprefs (getenv "installvp_ip"))
  358.    (run "unsetenv installvp_ip")
  359.  
  360.    (delete "t:installvp.edit" (optional force))
  361.    (textfile
  362.       (dest "t:installvp.edit")
  363.       (append (cat
  364.          "F /" var_iprefs "/\n"
  365.          "I\n"
  366.          "Run <>NIL: " (tackon @default-dest "VisualPrefs\n")
  367.          "Z\n"
  368.          "W\n"
  369.       ))
  370.    )
  371.  
  372.    (run "edit S:Startup-sequence with t:installvp.edit")
  373.    (protect "S:Startup-sequence" "+srwed")
  374.    (delete "t:installvp.edit")
  375. ))
  376.  
  377. ;***************************************
  378. ;** DONE
  379.  
  380. (complete 100)
  381. (exit (cat "\n" msg_done msg_done2))
  382.  
  383.