home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / varie / amibroker320 / install-amibroker < prev    next >
Text File  |  2000-01-18  |  12KB  |  492 lines

  1. ; Installer Script for AmiBroker 3.20
  2. ; Revision 10
  3. ; January 18th, 2000  Tomasz Janeczko, TJ Productions.
  4. ; $VER: Install-AmiBroker 10 (18 Jan 2000)
  5. ;
  6.  
  7. ; ********* English strings (default)
  8.  
  9. (set #badkick "I'm sorry, but AmiBroker requires OS 2.04 or better")
  10. (set #welcome (cat "\nAmiBroker 3.20\nHard Disk Install Script Rev 10.\n"
  11.                    "Copyright (C)1995-2000 by Tomasz Janeczko\n\n"
  12.                    "This is SHAREWARE product, so if you use it you should register\n\n\n"
  13.                    "ReqTools (C)1991-95 Nico François\n"
  14.                    "SAS/C (C)1988-93 SAS Institute Inc.\n"
  15.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  16.  
  17. (set #destination "Where do you want to install AmiBroker? ( 'AmiBroker' drawer will be created there )" )
  18. (set #programver  "Which version of AmiBroker do you want to install" )
  19. (set #progverhelp (cat "\nAmiBroker - this version is for 68000+ processors and will work on all Amigas.\n\n"
  20.                        "AmiBroker.FPU - this version is for 68020+ and 68882 floating point coprocessor "
  21.                        "or 68040/060. Will work only on accelerated Amigas" ))
  22.  
  23. (set #olddataexist (cat "You have stock database already installed in your 'data' directory\n"
  24.                         "AmiBroker 3.0 comes with example data from Polish Stock Exchange\n"
  25.                         "Please select desired action:" ))
  26.  
  27. (set #dataexisthelp (cat "\nOption:'replace old data' will erase all existing stock data and replace them with a new database"
  28.                          "\n\nOption: 'backup old data and install new' will move your old data to separate directory. Then, new data will be installed."
  29.                          "\n\nOption 'leave untouched' won't change anything in your database (no new data will be installed)" ))
  30.  
  31. (set #replace "replace old data")
  32. (set #backup "backup old data and install new")
  33. (set #leave "leave untouched")
  34.  
  35. (set #backupinprogress (cat "Creating backup of your stock database...\n\n"
  36.                             "You'll find it in directory:\n" ))
  37.  
  38. (set #unpacking    "Unpacking AmiBroker program to:\n")
  39. (set #unpackingFPU "Unpacking AmiBroker.FPU program to:\n")
  40. (set #dearchiving  "Dearchiving database and installing files to:\n")
  41. (set #limiting     (cat "Because your Amiga is equiped with small amount of memory (less than 2MB) "
  42.                         "I have to limit the number of quotation in database to 100"))
  43.  
  44.  
  45. (set #oldkeyfile   "You have got an old 'broker.key' keyfile installed.\nYou will have to re-register in order to use full potential of AmiBroker." )
  46.  
  47. ; ********* Polish strings
  48.  
  49. (if (= @language "polski") (
  50.  
  51. (set #badkick "Bardzo mi przykro ale program AmiBroker wymaga systemu w wersji 2.04 lub wyûszej")
  52. (set #welcome (cat "\nAmiBroker 3.20\nSkrypt instalacyjny HD (Rev 10)\n"
  53.                    "Copyright (C)1995-2000 by Tomasz Janeczko\n\n"
  54.                    "Program ten to SHAREWARE, chcâc wiëc go uûywaê powinieneô zarejestrowaê sië jako legalny uûytkownik\n\n\n"
  55.                    "ReqTools (C)1991-95 Nico François\n"
  56.                    "SAS/C (C)1988-93 SAS Institute Inc.\n"
  57.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  58.  
  59. (set #destination "Wskaû dysk lub katalog gdzie chcesz umieôciê AmiBrokera? ( Zostanie tam utworzony katalog 'AmiBroker')" )
  60. (set #programver  "Wybierz jakâ wersjë AmiBrokera chcesz zainstalowaê" )
  61. (set #progverhelp (cat "\nAmiBroker - to wersja na zwykîy procesor 68000.\n\n"
  62.                        "AmiBroker.FPU - to wersja na 68020 z koprocesorem 68882 "
  63.                        "lub teû procesory 68040 i 68060" ))
  64.  
  65. (set #olddataexist (cat "Masz juû zainstalowane dane o spóîkach i notowaniach w katalogu 'data'\n"
  66.                         "Zdecyduj co mam z nimi zrobiê:" ))
  67.  
  68. (set #dataexisthelp (cat "\nOpcja 'zastâp stare notowania nowymi' skasuje dotychczasowe dane i zainstaluje nowe w dotychczasowym podkatalogu 'data'"
  69.                          "\n\nOpcja 'utwórz kopië starych i zainstaluj nowe' przeniesie stare notowania do katalogu 'data_old', a nowe dane zapisze w katalogu 'data'"
  70.                          "\n\nOpcje 'pozostaw stare notowania' nie zainstaluje ûadnych nowych danych, pozostawiajâc tym samym stare dane bez zmian" ))
  71.  
  72. (set #replace "zastâp stare notowania nowymi")
  73. (set #backup "utwórz kopië starych i zainstaluj nowe")
  74. (set #leave "pozostaw stare notowania")
  75.  
  76. (set #backupinprogress (cat "Tworzë kopie starych notowaï...\n\n"
  77.                             "Znajdziesz je w katalogu:\n" ))
  78.  
  79. (set #unpacking    "Rozpakowujë program AmiBroker do katalogu:\n")
  80. (set #unpackingFPU "Rozpakowujë program AmiBroker.FPU do katalogu:\n")
  81. (set #dearchiving  "Rozpakowujë archiwum i instalujë nowe notowania do katalogu:\n")
  82. (set #limiting     (cat "Poniewaû Twoja Amiga jest wyposaûona w niewielkâ iloôê pamiëci (mniej niû 2MB) "
  83.                         "muszë ograniczyê iloôê notowaï w bazie danych do 100"))
  84.  
  85. (set #oldkeyfile   "Masz zainstalowanâ starâ wersjë pliku kluczowego 'broker.key'.\nBëdziesz musiaî zarejestrowaê sië ponownie by uûywaê wszystkich funkcji AmiBrokera." )
  86.  
  87. ))
  88.  
  89. ; ******* main install part
  90.  
  91. ; set up an error cleanup routine
  92. (onerror
  93.         (makeassign "AmiBrokerinstpgm" (safe))
  94. )
  95.  
  96. ; check OS version
  97.  
  98. (if (< (/ (getversion) 65536) 37)
  99.     (
  100.         (message #badkick)
  101.         (exit (quiet))
  102.     )
  103. )
  104.  
  105. ;just started
  106. (complete 0)
  107.  
  108. (message #welcome)
  109.  
  110. (welcome)
  111.  
  112. ;cancel the assign in case of installation restart
  113. (makeassign "AmiBrokerinstpgm" (safe))
  114.  
  115.  
  116. ; get the dest dir for AmiBroker
  117. (set AmiBroker_dest
  118.         (tackon
  119.                 (askdir
  120.                         (prompt #destination)
  121.                         (help @askdir-help)
  122.                         (default @default-dest)
  123.                 )
  124.                 "AmiBroker"
  125.         )
  126. )
  127.  
  128.  
  129. (complete 10)
  130.  
  131.  
  132. ;We now have a valid destination, so tell Installer where AmiBroker will end up
  133. ;so the exit page will be correct.
  134. (set @default-dest AmiBroker_dest)
  135.  
  136. ;
  137. ; Ask which files one wants to have installed
  138. ;
  139. ;
  140.  
  141. (set progver 1)
  142.  
  143. (if (OR (exists "AmiBroker.FPU") (exists "AmiBroker.FPU.lha") )
  144.    (set progver (askoptions
  145.                  (prompt #programver )
  146.                  (help  #progverhelp )
  147.                   (choices
  148.                     "AmiBroker"
  149.                     "AmiBroker.FPU"
  150.                   )
  151.                  (default 3)
  152.                 )
  153.    )
  154. )
  155.  
  156. ;copy program files from source to dest
  157.  
  158. (if (IN progver 0)
  159.  (if (exists "AmiBroker")
  160.    (copyfiles
  161.      (source "AmiBroker")
  162.      (dest AmiBroker_dest)
  163.      (infos)
  164.    )
  165.    (;else
  166.      (working #unpacking AmiBroker_dest )
  167.      (run (cat "lha -qf x AmiBroker.lha \"" (tackon AmiBroker_dest "\"" ) ) )
  168.    )
  169.  )
  170. )
  171.  
  172. (complete 10)
  173.  
  174. (if (IN progver 1)
  175.  (if (exists "AmiBroker.FPU")
  176.    (copyfiles
  177.      (source "AmiBroker.FPU")
  178.      (dest AmiBroker_dest)
  179.      (infos)
  180.    )
  181.    (;else
  182.      (working #unpackingFPU AmiBroker_dest )
  183.      (run (cat "lha -qf x AmiBroker.FPU.lha \"" (tackon AmiBroker_dest "\"" ) ) )
  184.    )
  185.  )
  186. )
  187.  
  188. (complete 20)
  189.  
  190. (makedir (tackon AmiBroker_dest "Locale") )
  191.  
  192. (copyfiles
  193.   (source "Locale")
  194.   (dest (tackon AmiBroker_Dest "Locale" ) )
  195.   (all)
  196.   (infos)
  197. )
  198.  
  199. (copyfiles
  200.   (source "Locale.info")
  201.   (dest   AmiBroker_Dest )
  202. )
  203.  
  204. (copyfiles
  205.   (source "Locale/Catalogs")
  206.   (dest "LOCALE:Catalogs" )
  207.   (all)
  208. )
  209.  
  210.  
  211. (copyfiles
  212.   (source "AmiBroker.guide.info")
  213.   (dest   AmiBroker_Dest)
  214.   (all)
  215. )
  216.  
  217. (if (= @language "polski")
  218.      (copyfiles
  219.        (source "Locale/Guides/polski/AmiBroker.guide")
  220.        (dest AmiBroker_dest)
  221.      )
  222.      (copyfiles
  223.        (source "Locale/Guides/english/AmiBroker.guide")
  224.        (dest AmiBroker_dest)
  225.      )
  226. )
  227.  
  228. (copyfiles
  229.   (source "Classes")
  230.   (dest   "SYS:Classes" )
  231.   (all)
  232. )
  233.  
  234. (complete 30)
  235.  
  236. (copyfiles
  237.   (source "AmiBroker.history")
  238.   (dest AmiBroker_dest)
  239.   (infos)
  240. )
  241.  
  242. (copyfiles
  243.   (source "ReadMe")
  244.   (dest AmiBroker_dest)
  245.   (infos)
  246. )
  247.  
  248. (copyfiles
  249.   (source "ReleaseNotes.txt")
  250.   (dest AmiBroker_dest)
  251.   (infos)
  252. )
  253.  
  254. (copyfiles
  255.   (source "ReleaseNotes.html")
  256.   (dest AmiBroker_dest)
  257.   (infos)
  258. )
  259.  
  260. ; delete old data file if exists
  261. (if (exists (tackon AmiBroker_dest "broker.data"))
  262.     (delete (tackon AmiBroker_dest "broker.data"))
  263. )
  264.  
  265.  
  266. (if (exists (tackon AmiBroker_dest "data"))
  267.     (set datmode (askchoice
  268.                   (prompt #olddataexist)
  269.                   (help #dataexisthelp )
  270.                   (default 1)
  271.                   (choices
  272.                      #replace
  273.                      #backup
  274.                      #leave
  275.                   )
  276.                  )
  277.     )
  278. )
  279.  
  280.  
  281. (if (= datmode 1) (
  282.        (makedir (tackon AmiBroker_dest "data_old") )
  283.        (working #backupinprogress (tackon AmiBroker_dest "data_old"))
  284.        (copyfiles
  285.                (source (tackon AmiBroker_dest "data") )
  286.                (dest   (tackon AmiBroker_dest "data_old") )
  287.                (all)
  288.                (nogauge)
  289.        )
  290. ))
  291.  
  292. (complete 40)
  293.  
  294. (makedir (tackon AmiBroker_dest "data") )
  295.  
  296. (if (< datmode 2)
  297.         (if (exists "data")
  298.             (copyfiles
  299.                  (source "data")
  300.                  (dest   (tackon AmiBroker_dest "data") )
  301.                  (all)
  302.             )
  303.             (;else
  304.                  (working #dearchiving (tackon AmiBroker_dest "data"))
  305.                  (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  306.                  (run "lha -qf x abdata.lha AmiBrokerData:" )
  307.                  (makeassign "AmiBrokerData" (safe))
  308.             )
  309.         )
  310.  
  311. )
  312.  
  313.  
  314. (complete 60)
  315.  
  316. (set #freemem (database "total-mem") )
  317.  
  318. (if (< (- #freemem 2000000) 0)
  319.   (
  320.      (working #limiting)
  321.      (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  322.      (run "ConvertData >NIL: AmiBrokerData: 100" )
  323.      (makeassign "AmiBrokerData" (safe))
  324.   )
  325. )
  326.  
  327. (working)
  328.  
  329. (if (NOT (exists (tackon AmiBroker_dest "broker.portfolio") ) )
  330.     (copyfiles
  331.      (source "broker.portfolio")
  332.      (dest AmiBroker_dest)
  333.     )
  334. )
  335.  
  336. (if (exists (tackon AmiBroker_dest "broker.key") )
  337.     (if (< (/ (getversion (tackon AmiBroker_dest "broker.key") ) 65536) 21)
  338.         (message #oldkeyfile)
  339.     )
  340. )
  341.  
  342. ; copy key-file if exists
  343. (if (exists "broker.key")
  344.     (copyfiles
  345.      (source "broker.key")
  346.      (dest AmiBroker_dest)
  347.     )
  348. )
  349.  
  350. ; copy arexx-file if exists
  351. (if (exists "broker.arexx")
  352.     (if (NOT (exists (tackon AmiBroker_dest "broker.arexx" ) ) )
  353.         (copyfiles
  354.          (source "broker.arexx")
  355.          (dest AmiBroker_dest)
  356.          )
  357.     )
  358. )
  359.  
  360.  
  361. ; copy Trading rules file if exists
  362. (if (exists "broker.rules")
  363.     (if (NOT (exists (tackon AmiBroker_dest "broker.rules" ) ) )
  364.         (copyfiles
  365.          (source "broker.rules")
  366.          (dest AmiBroker_dest)
  367.          )
  368.     )
  369. )
  370.  
  371. ; copy Guru commentaries if exists
  372. (if (exists "broker.comment")
  373.     (if (NOT (exists (tackon AmiBroker_dest "broker.comment" ) ) )
  374.         (copyfiles
  375.          (source "broker.comment")
  376.          (dest AmiBroker_dest)
  377.          )
  378.     )
  379. )
  380.  
  381.  
  382. ; copy Custom charts if exists
  383. (if (exists "broker.charts")
  384.     (if (NOT (exists (tackon AmiBroker_dest "broker.charts" ) ) )
  385.         (copyfiles
  386.          (source "broker.charts")
  387.          (dest AmiBroker_dest)
  388.          )
  389.     )
  390. )
  391.  
  392. (complete 70)
  393.  
  394. ; delete old BrokerSymbol font (1.22 and earlier vers) if exists
  395. (if (exists "FONTS:BrokerSym.font")
  396.     (delete "FONTS:BrokerSym.font")
  397. )
  398.  
  399. (if (exists "FONTS:BrokerSym/16")
  400.     (delete "FONTS:BrokerSym/16")
  401. )
  402.  
  403. (if (exists "FONTS:BrokerSym")
  404.     (delete "FONTS:BrokerSym")
  405. )
  406.  
  407. ; copy fonts needed
  408. (copyfiles
  409.   (source "fonts")
  410.   (dest "FONTS:")
  411.   (fonts)
  412.   (all)
  413. )
  414.  
  415.  
  416. (complete 80)
  417.  
  418. (copyfiles
  419.   (source "ARexxDemo.abrx")
  420.   (dest AmiBroker_dest)
  421.   (infos)
  422. )
  423.  
  424. (makedir (tackon AmiBroker_dest "Examples") )
  425.  
  426. (copyfiles
  427.   (source "Examples")
  428.   (dest (tackon AmiBroker_Dest "Examples" ) )
  429.   (all)
  430. )
  431.  
  432.  
  433. (makedir (tackon AmiBroker_dest "Metastock") )
  434.  
  435. (copyfiles
  436.   (source "Metastock")
  437.   (dest (tackon AmiBroker_Dest "Metastock" ) )
  438.   (all)
  439. )
  440.  
  441.  
  442. (makedir (tackon AmiBroker_dest "Teletext") )
  443.  
  444. (copyfiles
  445.   (source "Teletext")
  446.   (dest (tackon AmiBroker_Dest "Teletext" ) )
  447.   (all)
  448. )
  449.  
  450.  
  451. (makedir (tackon AmiBroker_dest "Rexx") )
  452.  
  453. (copyfiles
  454.   (source "Rexx")
  455.   (dest (tackon AmiBroker_Dest "Rexx" ) )
  456.   (all)
  457. )
  458.  
  459.  
  460. (makedir (tackon AmiBroker_dest "AFL") )
  461.  
  462. (copyfiles
  463.   (source "AFL")
  464.   (dest (tackon AmiBroker_Dest "AFL" ) )
  465.   (all)
  466.   (infos)
  467. )
  468.  
  469. (copyfiles
  470.   (source "AFL.info")
  471.   (dest   AmiBroker_Dest )
  472. )
  473.  
  474.  
  475.  
  476. (complete 90)
  477.  
  478. ;un-snapshot the AmiBroker drawer icon
  479. (tooltype
  480.         (dest AmiBroker_dest)
  481.         (noposition)
  482. )
  483.  
  484. ;done with the install
  485. (complete 100)
  486.  
  487. ;cleanup
  488. (makeassign "AmiBrokerinstpgm" (safe))
  489.  
  490. ;and get out
  491. (exit)
  492.