home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / d / docmav1.3sw.lha / DocMa13 / Install-DocMa < prev    next >
Text File  |  1996-10-20  |  13KB  |  510 lines

  1. ; $VER: Install-DocMa 1.3 (19.10.96)
  2.  
  3. (set current_version "1.3")
  4. (set lng @language)
  5.  
  6. (complete 0)
  7.  
  8.  
  9. ;=============================================================================
  10. ; Locale strings
  11.  
  12. (set #intro_0 (cat "\n\Document Manager " current_version"\n========================\n© 1996, Marc Ewert"))
  13.  
  14.  
  15. ;=============================================================================
  16. ; german
  17.  
  18. (if (= lng "deutsch")
  19. (
  20.  
  21. (set #intro        "Willkommen zum DocMa Installationsprogramm.\n Hiermit können Sie DocMa auf Ihrem Amiga installieren/entfernen.")
  22. (set #welcome      "Bitte wählen Sie Ihren Kenntnisstand über den Amiga")
  23. (set #destdir      "Bitte wählen Sie ein Zielverzeichnis für DocMa aus. Ein Verzeichnis 'DocMa' wird dort angelegt. Falls dort bereits ein 'DocMa' Verzeichnis existiert, wird die Programmversion auf den neusten Stand gebracht.")
  24. (set #destexists_1 "\nIm gewählten Zielverzeichnis\n\n")
  25. (set #destexists_2 "\n\nexistiert bereits eine DocMa-Schublade. Wenn Sie fortfahren, wird die dort befindliche DocMa-Installation aktualisiert.")
  26. (set #copying      "\nKopiere ")
  27. (set #localeask    "Bitte wählen Sie den zu installierenden Sprachkatalog aus.")
  28.  
  29. (set #finished            "DocMa wurde erfolgreich installiert im Verzeichnis\n\n%s.\n\n Eventuell gesicherte Dateien finden Sie in DocMa/Backup.")
  30. (set #finished_1          "DocMa wurde in Ihrem Suchpfad eingefügt. Bitte starten Sie Ihren Rechner neu, damit diese Änderung in Kraft tritt.")
  31. (set #finished_removed    "DocMa wurde erfolgreich entfernt.")
  32. (set #finished_notremoved "DocMa wurde nicht erfolgreich entfernt.")
  33.  
  34. (set #cpuask       "Bitte wählen Sie gewünschte Prozessorversion von DocMa aus.")
  35. (set #docsask      "Bitte wählen Sie die Sprache für die Dokumentationen aus.")
  36. (set #startup      "Es werden nun einige Ergänzungen an Ihrer 'User-Startup' vorgenommen. DocMa wird in Ihrem Suchpfad eingefügt:\n\n%s")
  37. (set #startup_2    "Die Änderungen an der 'User-Startup' Datei werden gelöscht.")
  38. (set #startup_ask  "Möchten Sie, daß DocMa permanent in ihrem Suchpfad aufgenommen wird?")
  39. (set #remove_docma "Entferne das DocMa Verzeichnis. Leider bleibt eine leere Schublade übrig, wenn sich DocMa in Ihrem Suchpfad befand.")
  40.  
  41. (set #install_ask     "Was möchten Sie tun?")
  42. (set #install_install "DocMa installieren...")
  43. (set #install_remove  "DocMa entfernen...")
  44.  
  45. (set #sourcedir       "Bitte geben Sie das Verzeichnis ein, in dem sich ihr DocMa Verzeichnis befindet.")
  46. (set #sourcenotexists "Das Verzeichnis '%s' existiert nicht!")
  47.  
  48. (set #prefupdate_ask  "Soll ich jetzt Ihr alte Konfigurations Datei auf den neusten Stand bringen?")
  49.  
  50. (set #backup_ask      "Soll '%s' gesichert werden?")
  51. (set #backup_msg      "Sicher alte Dateien...")
  52.  
  53. )
  54.  
  55. ;=============================================================================
  56. ; english
  57.  
  58. (
  59.  
  60. (set #intro        "Welcome to the DocMa installation program.\nUse this tool to install/deinstall  DocMa on your Amiga.")
  61. (set #welcome      "Please select your knowledge level about the amiga")
  62. (set #destdir      "Please select a drawer for DocMa. A drawer 'DocMa' will be created there. If there is already a 'DocMa' drawer, the program version will be updated.")
  63. (set #destexists_1 "\nThe directory\n\n")
  64. (set #destexists_2 "\n\nalready contains a DocMa drawer. If you continue, the DocMa installation in this drawer is updated.")
  65. (set #copying      "\nCopying ")
  66. (set #localeask    "Please select which language catalogue should be installed.")
  67.  
  68. (set #finished            "DocMa was successfully installed in the drawer\n\n%s.\n\nYou can find possible backuped files in DocMa/Backup.")
  69. (set #finished_1          "DocMa was added to your search-path. Please reboot your Amiga, to let the changes take effect.")
  70. (set #finished_removed    "DocMa was successfully removed.")
  71. (set #finished_notremoved "DocMa wasn`t successfully removed.")
  72.  
  73. (set #cpuask       "Please select the processor version for DocMa.")
  74. (set #docsask      "Please select the language for the documentation.")
  75. (set #startup      "Some lines will be added to your 'User-Startup' file. DocMa will be added to your search-path:\n\n%s")
  76. (set #startup_2    "The changes of the 'user-startup' file will be removed.")
  77. (set #startup_ask  "Do you want DocMa to be permanently in your search-path?")
  78. (set #remove_docma "Delete the DocMa drawer. Unfortunately there will be an empty drawer left, if DocMa was in your search path.")
  79.  
  80. (set #install_ask     "What should be done?")
  81. (set #install_install "Install DocMa...")
  82. (set #install_remove  "Remove DocMa...")
  83.  
  84. (set #sourcedir       "Please insert the drawer, where you have installed the DocMa drawer.")
  85. (set #sourcenotexists "The drawer '%s' doesn`t exist!")
  86.  
  87. (set #prefupdate_ask  "Should your old config file be updated?")
  88.  
  89. (set #backup_ask      "Should '%s' be backuped?")
  90. (set #backup_msg      "Backup old files...")
  91.  
  92. ))
  93.  
  94.  
  95. (procedure P_COPYDIR #sourcedir #destdir
  96. (
  97.   (copyfiles
  98.     (prompt (cat #copying #sourcedir "..."))
  99.     (help @copyfiles-help)
  100.     (source #sourcedir)
  101.     (dest #destdir)
  102.     (optional "force" "askuser")
  103.     (confirm "expert")
  104.     (all)
  105.     (infos)
  106.   )
  107. )
  108. )
  109.  
  110.  
  111. (procedure P_COPYFILE #srcname #dstdir
  112. (
  113.   (copyfiles
  114.     (prompt #copying #srcname "...")
  115.     (help @copyfiles-help)
  116.     (source #srcname)
  117.     (dest #dstdir)
  118.     (optional "force" "askuser")
  119.     (confirm "expert")
  120.     (infos)
  121.   )
  122. )
  123. )
  124.  
  125.  
  126. (procedure P_GETLANGUAGE #text
  127. (
  128.   (if (= @language "deutsch")
  129.   (
  130.      (set #def 0)
  131.   )
  132.   (
  133.     (set #def 1)
  134.   ))
  135.   (if (= @user-level 0)
  136.   (
  137.     (set #def #def)
  138.   )
  139.   (
  140.     (askchoice
  141.       (prompt #text)
  142.       (choices "deutsch" "english")
  143.       (help @askoptions-help)
  144.       (default #def)
  145.     )
  146.   ))
  147. )
  148. )
  149.  
  150. (procedure P_BACKUP #source #dest
  151. (
  152. (if (askbool
  153.       (prompt (#backup_ask #source))
  154.       (default 1)
  155.       (help @askbool-help))
  156.   (
  157.     (copyfiles
  158.       (prompt #backup_msg)
  159.       (source #source)
  160.       (dest #dest)
  161.       (confirm "expert")
  162.       (help @copyfile-help)
  163.     )
  164.  
  165.   )
  166. )
  167. )
  168. )
  169.  
  170. (set #startup_change FALSE)
  171.  
  172. (set #mode_install 0)
  173. (set #mode_remove  1)
  174.  
  175. ;=============================================================================
  176. ; Say hello
  177.  
  178. (message #intro_0 "\n\n" #intro)
  179.  
  180. ; what should be done
  181.  
  182. (select (askchoice
  183.   (prompt #install_ask)
  184.   (choices #install_install #install_remove)
  185.   (help @askoptions-help)
  186.   (default #mode_install)
  187. )
  188.  
  189. (
  190.  
  191. ;=============================================================================
  192. ; INSTALL
  193. ;=============================================================================
  194.  
  195. ;=============================================================================
  196. ; Select destination directory
  197.  
  198. (welcome #welcome)
  199. (set seldir 1)
  200.  
  201.   (set #default-dest
  202.       (askdir
  203.           (prompt #destdir)
  204.           (default @default-dest)
  205.           (help @askdir-help)
  206.       )
  207.   )
  208.  
  209.   (set #default-dest (expandpath #default-dest))
  210.   (set @default-dest (#default-dest)) ; for finish message
  211.  
  212. (set destination (tackon #default-dest "DocMa"))
  213.  
  214. (if (<> seldir 0)
  215. (
  216.     (if (<> (exists destination) 0)
  217.     (
  218.         (message (cat #destexists_1 #default-dest #destexists_2))
  219.     )
  220.     )
  221. )
  222. )
  223.  
  224.  
  225. ;=============================================================================
  226. ; Lets go, create destination directory, copy main files
  227.  
  228. (complete 10)
  229.  
  230. ; create destination directory
  231. (if (= (exists destination) 0)
  232. (
  233.   (makedir destination (help @makedir-help))
  234.   (if (exists "/DocMa13.info") (run (cat "copy /DocMa13.info \"" destination ".info\"")))
  235.   (tooltype (dest destination) (noposition))
  236. )
  237. )
  238.  
  239. (copyfiles
  240.     (prompt (cat #copying "readme files ..."))
  241.     (source "")
  242.     (pattern "(ReadMe|LiesMich| )")
  243.     (dest destination)
  244.     (infos)
  245.     (confirm "expert")
  246.     (help @copyfile-help)
  247. )
  248.  
  249. ;=============================================================================
  250. ; Choose CPU and copy DocMa
  251.  
  252. (complete 15)
  253.  
  254. (set choice
  255.   (askchoice
  256.     (prompt #cpuask)
  257.     (default 0)
  258.     (help @askoptions-help)
  259.     (choices "68000" "68020" "68030" "68040")
  260.   )
  261. )
  262.  
  263. (if (= choice 0)
  264. (if (exists "c/docma.000") (run (cat "copy c/docma.000 \"" destination "/DocMa\""))))
  265. (if (= choice 1)
  266. (if (exists "c/docma.020") (run (cat "copy c/docma.020 \"" destination "/DocMa\""))))
  267. (if (= choice 2)
  268. (if (exists "c/docma.030") (run (cat "copy c/docma.030 \"" destination "/DocMa\""))))
  269. (if (= choice 3)
  270. (if (exists "c/docma.040") (run (cat "copy c/docma.040 \"" destination "/DocMa\""))))
  271.  
  272. ; Copy DocMa.info
  273. (P_COPYFILE "Icons/DocMa.info" destination)
  274.  
  275. (complete 20)
  276.  
  277. ;=============================================================================
  278. ; Tools
  279.  
  280. (P_COPYDIR "Tools" (tackon destination "Tools"))
  281. ; Copy Tools.info
  282. (P_COPYFILE "Tools.info" destination)
  283.  
  284. (complete 30)
  285.  
  286. ;=============================================================================
  287. ; Prefs
  288.  
  289. (if (= (exists (tackon destination "DocMa.pref")) 0)
  290. (
  291. (copyfiles
  292.     (prompt (cat #copying "DocMa.prefs ..."))
  293.     (source "DocMa.pref")
  294.     (dest destination)
  295.     (infos)
  296.     (confirm "expert")
  297.     (help @copyfile-help)
  298. )
  299. )
  300. (
  301.   (P_BACKUP "DocMa.pref" (tackon destination "Backup"))
  302.   (if (askbool
  303.       (prompt #prefupdate_ask)
  304.       (default 1)
  305.       (help @askbool-help))
  306.     (
  307.       (run
  308.         (cat "Tools/UpdateConfig "
  309.           "\""(tackon destination "DocMa.pref")"\""
  310.           " "
  311.           "\""(tackon destination "DocMa.pref")"\""
  312.         )
  313.       )
  314.     )
  315. )
  316. )
  317. )
  318.  
  319. (complete 40)
  320.  
  321. ;=============================================================================
  322. ; Catalogs
  323.  
  324. ; create Catalogs directory
  325. (if (= (exists (tackon destination "Catalogs")) 0) ( (makedir (tackon destination "Catalogs")
  326.   (help @makedir-help)))
  327. )
  328.  
  329. ; Catalogs drawer icon
  330. (P_COPYFILE "Catalogs.info" destination)
  331.  
  332. ; CD file
  333. (P_COPYFILE "Catalogs/DocMa.cd" (tackon destination "Catalogs"))
  334.  
  335. (set choice
  336.   (P_GETLANGUAGE #localeask)
  337. )
  338. (if (= choice 0) (P_COPYDIR "Catalogs/Deutsch" (tackon destination "Catalogs/Deutsch")))
  339.  
  340. (complete 50)
  341.  
  342. ;=============================================================================
  343. ; Icons
  344.  
  345. (P_COPYDIR "Icons" (tackon destination "Icons"))
  346.  
  347. ; Icons drawer icon
  348. (P_COPYFILE "Icons.info" destination)
  349.  
  350. (complete 60)
  351.  
  352.  
  353. ;=============================================================================
  354. ; Images
  355.  
  356. ; Images drawer icon
  357. (if (exists "Images.info") (run (cat "copy Images.info \"" (tackon destination "Images") ".info\""))
  358. )
  359.  
  360. (P_COPYDIR "Images" (tackon destination "Images"))
  361.  
  362. (complete 70)
  363.  
  364. ;=============================================================================
  365. ; Docs Drawer
  366.  
  367. (copyfiles
  368.   (prompt "copying Docs...")
  369.   (help @copyfiles-help)
  370.   (source "Docs")
  371.   (pattern "~(Deutsch#?|English#?)")
  372.   (dest (tackon destination "Docs"))
  373.   (optional "force" "askuser")
  374.   (confirm "expert")
  375.   (infos)
  376. )
  377.  
  378. ; Docs drawer icon
  379. (P_COPYFILE "Docs.info" destination)
  380.  
  381. (set choice
  382.   (P_GETLANGUAGE #docsask)
  383. )
  384.  
  385. (if (= choice 0) (
  386.                  (P_COPYDIR "Docs/Deutsch" (tackon destination "Docs/Deutsch"))
  387.                  (P_COPYFILE "Docs/Deutsch.info" (tackon destination "Docs"))
  388.                  ))
  389. (if (= choice 1) (
  390.                  (P_COPYDIR "Docs/English" (tackon destination "Docs/English"))
  391.                  (P_COPYFILE "Docs/English.info" (tackon destination "Docs"))
  392.                  ))
  393.  
  394. (complete 80)
  395.  
  396. ;=============================================================================
  397. ; Keyfile drawer
  398.  
  399. ; create Keyfile directory
  400. (if (= (exists (tackon destination "Keyfile")) 0) ( (makedir (tackon destination "Keyfile")
  401.   (help @makedir-help)))
  402. )
  403.  
  404. (complete 90)
  405.  
  406. ;=============================================================================
  407. ; Startup Sequence
  408.  
  409. (if (askbool
  410.       (prompt #startup_ask)
  411.       (default 1)
  412.       (help @askbool-help))
  413.   (
  414.     (set #cmd (cat "if exists " destination "\n  path " destination " add\nendif"))
  415.     (set #startup_change TRUE)
  416.     (startup "DocMa"
  417.       (confirm "expert")
  418.       (prompt (#startup #cmd))
  419.       (command #cmd)
  420.       (help @startup-help)
  421.     )
  422.   )
  423. )
  424.  
  425. (complete 100)
  426.  
  427. ;=============================================================================
  428. ; Finish Install
  429.  
  430. (if (= #startup_change TRUE)
  431.   (
  432.     (exit (#finished destination) "\n\n" #finished_1 (quiet))
  433.   )
  434.   (
  435.     (exit (#finished destination) (quiet))
  436.   )
  437. )
  438.  
  439. )
  440.  
  441. (
  442. ;=============================================================================
  443. ; REMOVE
  444. ;=============================================================================
  445.  
  446. ;=============================================================================
  447. ; Select source directory
  448.  
  449. ;(welcome #welcome)
  450. (set #removed FALSE)
  451.  
  452. (set seldir 1)
  453.  
  454.   (set #default-source
  455.       (askdir
  456.           (prompt #sourcedir)
  457.           (default @default-dest)
  458.           (help @askdir-help)
  459.       )
  460.   )
  461.  
  462.   (set #default-source (expandpath #default-source))
  463.  
  464. (set #source (tackon #default-source "DocMa"))
  465.  
  466. (if (<> seldir 0)
  467. (
  468.     (if (= (exists #source) 0)
  469.     (
  470.       (message (#sourcenotexists #source))
  471.     )
  472.     (
  473.       ;(run (cat "path \"" #source " remove\""))
  474.       (delete #source
  475.         (help @delete-help)
  476.         (prompt #remove_docma)
  477.         (all)
  478.         (infos)
  479.         (optional "force")
  480.         (confirm "expert")
  481.       )
  482.       (startup "DocMa"
  483.         (confirm "expert")
  484.         (prompt #startup_2)
  485.         (command ";")
  486.         (help @startup-help)
  487.       )
  488.       (set #removed TRUE)
  489.     )
  490.     )
  491. )
  492. )
  493.  
  494.  
  495. ;=============================================================================
  496. ; Finish Remove
  497.  
  498. (if (= #removed TRUE)
  499. (
  500.   (exit #finished_removed (quiet))
  501. )
  502. (
  503.   (exit #finished_notremoved (quiet))
  504. )
  505. )
  506.  
  507. )
  508. ) ;select
  509.  
  510.