home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Patch / Programs / CD3008.LHA / ModemUpdate_CanDo / InstallPatch < prev    next >
Encoding:
Text File  |  1994-12-14  |  7.6 KB  |  325 lines

  1. ;********************************************************************
  2. ; $VER: InstallPatch V3.00 Monday 07-Nov-94 12:53:42
  3. ;       Inovatronics, Inc.
  4. ;       Suite 209b
  5. ;       8499 Greenville Ave
  6. ;       Dallas, Texas 75231
  7. ;       USA
  8. ;********************************************************************
  9. ; History
  10. ; v3.00 based on Install-CanDo and InstallCanDo
  11. ; v1.xx & 2.xx old versions of the install script
  12. ;********************************************************************
  13. ; The required variables
  14. ;********************************************************************
  15. (set true 1)
  16. (set false 0)
  17. (set not_here 0)
  18. (set is_a_file 1)
  19. (set is_a_dir 2)
  20. (set newline "\n")
  21. (set quote "\"")
  22. (set nothing "")
  23. (set testing true)
  24. (set testing false)
  25. (delopts "AskUser" "OkNoDelete" "Force")
  26. (set cpu (database "CPU"))
  27. (set aga (= (database "CHIPREV") "AA"))
  28.  
  29. ;********************************************************************
  30. ; The common/general/english strings
  31. ;********************************************************************
  32. (set Intro_text
  33.     (cat
  34.         "Welcome to the CanDo Patch installer.  This installer uses the "
  35.         "Commodore Amiga Installer.  All of our products use this "
  36.         "installer and we would love to get any feedback that might "
  37.         "help improve the installation procedure." newline
  38.     )
  39. )
  40.  
  41. (set IsCanDoHere_text
  42.     (cat
  43.         "This appears to be were CanDo is installed.  Is this correct?"
  44.     )
  45. )
  46.  
  47. (set Unarchiving_text
  48.     (cat
  49.         "One moment please, unarchiving"
  50.         newline
  51.         newline
  52.     )
  53. )
  54.  
  55. (set Final_text
  56.     (cat
  57.         "The CanDo patch has now been successfully installed on your "
  58.         "machine.  You are now updated to "
  59.     )
  60. )
  61.  
  62. (set PathPrefix "Path=")
  63.  
  64. (set FilePrefix "File(s)=")
  65.  
  66.  
  67. ;********************************************************************
  68. ; The error strings
  69. ;********************************************************************
  70.  
  71. (set NoCanDo_error
  72.     (cat
  73.         "We cannot find the CanDo: assignment.  That means that CanDo "
  74.         "has either not been installed or incorrectly installed."
  75.         newline
  76.     )
  77. )
  78.  
  79. (set NotThree_error
  80.     (cat
  81.         "The CanDo installed is not v3.0.  It is possible that the CanDo: "
  82.         "assignment is pointing to the wrong program.  If so please point "
  83.         "it at your CanDo v3.0 and then re-run the patch installer."
  84.         newline
  85.     )
  86. )
  87.  
  88. (set NoNeed_error
  89.     (cat
  90.         "The CanDo installed is newer than this patch so we do not need to patch it."
  91.         newline
  92.     )
  93. )
  94.  
  95. (set NoSupport_error
  96.     (cat
  97.         "We could not find these support files in Ram:.  "
  98.         "Please reboot and try to install again."
  99.         newline
  100.     )
  101. )
  102.  
  103. (set DirIsAFile_error
  104.     (cat
  105.         "Should be a directory but it is actually a file..."
  106.         newline
  107.     )
  108. )
  109.  
  110. (set DirNotMade_error
  111.     (cat
  112.         "We could not create the directory..."
  113.         newline
  114.     )
  115. )
  116.  
  117.  
  118. ;********************************************************************
  119. ; The language specific strings, overlay the pre-defined strings
  120. ;********************************************************************
  121. (if (= @language "deutsch")
  122.     (
  123.         ; german strings go here
  124.  
  125.         (set Intro_text
  126.             (cat "Willkommen zum Installationsprogramm von " progname ". "
  127.              "Um die Installtion für Sie so einfach wie möglich zu gestalten, "
  128.              "benutzen wir den Commodore-Installer."
  129.              newline newline
  130.             )
  131.         )
  132.     )
  133. )
  134.  
  135. ;********************************************************************
  136. ; Some common procedures
  137. ;********************************************************************
  138. ; where do we install the CanDo directory
  139. (procedure find_home_dir
  140.     (
  141.         ; if we were installed, where are we?
  142.         (if (= testing true)
  143.             (set CanDo_dir "Ram:")
  144.             (set CanDo_dir (getassign "CanDo"))
  145.         )
  146.         
  147.         ; is CanDo assign made?
  148.         (if (= CanDo_dir nothing)
  149.             (abort NoCanDo_error)
  150.         )
  151.         
  152.         ; where are we to install?
  153.         (set cando_dir
  154.             (askdir
  155.                 (prompt IsCanDoHere_text)
  156.                 (help @askdir-help)
  157.                 (default cando_dir)
  158.                 (newpath)
  159.             )
  160.         )
  161.  
  162.         ; what CanDo is to be installed?
  163.         (run "version >env:candoversion CanDo_Patch_Install:CanDo")
  164.         (set newcando (getenv "candoversion"))
  165.         (set newver (+ (substr newcando 6 1) 0))
  166.         (set newrev (+ (substr newcando 8 3) 0))
  167.         
  168.         ; is CanDo already installed here?
  169.         (run "version >env:candoversion CanDo:CanDo")
  170.         (set oldcando (getenv "candoversion"))
  171.         (set oldver (+ (substr oldcando 6 1) 0))
  172.         (set oldrev (+ (substr oldcando 8 3) 0))
  173.         
  174.         ; hey its not v3.0!
  175.         (if (<> oldver 3)
  176.             (abort NotThree_error)
  177.         )
  178.         
  179.         ; is the new revision greater than the installed one?
  180.         (if (> oldrev newrev)
  181.             (abort NoNeed_error)
  182.         )
  183.     )
  184. )
  185.  
  186.  
  187. ; unarchive an archive, destination=path/file, archive=path
  188. (procedure unarchive
  189.     (
  190.         (set destination (pathonly destination))
  191.         (insure_dir)
  192.         
  193.         ; create a batch file
  194.         (textfile
  195.             (dest "Ram:LHEX.script")
  196.             (append
  197.                 (cat
  198.                     "Cd " quote thepath quote newline
  199.                     "Stack 20480" newline
  200.                     "Ram:LHEX -qf x " quote archive quote newline
  201.                 )
  202.             )
  203.         )
  204.         
  205.         ; unarchive then
  206.         (working Unarchiving_Text FilePrefix quote archive quote newline PathPrefix quote thepath quote)
  207.         (execute "Ram:LHEX.script")
  208.     )
  209. )
  210.  
  211. ; insure a directory exists, destination=path
  212. (procedure insure_dir
  213.     (
  214.         (set thepath destination)
  215.         
  216.         ; if it is a file then abort
  217.         (if (= (exists thepath) is_a_file)
  218.             (abort DirIsAFile_error PathPrefix quote thedir quote)
  219.         )
  220.         
  221.         ; if it doesn't exist make it
  222.         (if (= (exists thepath) not_here)
  223.             (
  224.                 (working CreateDir_text PathPrefix quote thepath quote)
  225.                 (makedir thepath (infos))
  226.             )
  227.         )
  228.         
  229.         ; verify it actually is a directory
  230.         (if (<> (exists thepath) is_a_dir)
  231.             (abort DirNotMade_error quote thedir quote)
  232.         )
  233.     )
  234. )
  235.  
  236. ;********************************************************************
  237. ; The error handler
  238. ;********************************************************************
  239. (onerror
  240.     (delete "Ram:LHEX" (safe))
  241.     (delete "Ram:LHEX.script" (safe))
  242. )
  243.  
  244.  
  245. ; *******************************************************************
  246. ; on with the show
  247. ; *******************************************************************
  248. (welcome intro_text)
  249.  
  250. ; where are we?
  251. (makeassign "CanDo_Patch_Install" "" (safe))
  252.  
  253. ; where to install?
  254. (find_home_dir)
  255.  
  256. ; to novice mode
  257. (user 0)
  258.  
  259. ; how far have we come?
  260. (complete 0)
  261.  
  262.  
  263. ; *******************************************************************
  264. ; copy LHEX to ram:
  265. ; *******************************************************************
  266. ; verify we got LHEX into ram:
  267. (if (<> (exists "Ram:LHEX") is_a_file)
  268.     (copyfiles
  269.         (source "CanDo_Patch_Install:LHEX")
  270.         (dest "Ram:")
  271.         (files)
  272.     )
  273. )
  274.  
  275. ; verify we got LHEX into ram:
  276. (if (<> (exists "Ram:LHEX") is_a_file)
  277.     (abort NoSupport_error quote "LHEX" quote)
  278. )
  279.  
  280.  
  281. ; *******************************************************************
  282. ; copy readme to the destination
  283. ; *******************************************************************
  284. (copyfiles
  285.     (source "CanDo_Patch_Install:CanDoPatch.doc")
  286.     (dest cando_dir)
  287.     (files)
  288.     (infos)
  289. )
  290.  
  291. ; how far have we come?
  292. (complete 25)
  293.  
  294.  
  295. ; *******************************************************************
  296. ; delete CanDo and install new one
  297. ; *******************************************************************
  298. (set destination (tackon cando_dir "CanDo"))
  299. (set archive "CanDo_Patch_Install:CanDo_Stuff.lha")
  300. (unarchive)
  301.  
  302. ; how far have we come?
  303. (complete 75)
  304.  
  305.  
  306. ; *******************************************************************
  307. ; Libs: CanDo.library
  308. ; *******************************************************************
  309. (set destination "Libs:CanDo.library")
  310. (set archive "CanDo_Patch_Install:CanDo_Libs.lha")
  311. (unarchive)
  312.  
  313. ; how far have we come?
  314. (complete 100)
  315.  
  316.  
  317. ; *******************************************************************
  318. ; ok we are done then
  319. ; *******************************************************************
  320. (delete "Ram:LHEX" (safe))
  321. (delete "Ram:LHEX.script" (safe))
  322. (makeassign "CanDo_Patch_Install" (safe))
  323. (set @default-dest cando_dir)
  324. (exit Final_text newcando)
  325.