Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. $!
  2. $!  MAKESFX.COM:  command-procedure to create self-extracting ZIP archives
  3. $!                usage:  @MAKESFX foo    (foo.zip -> foo.exe)
  4. $!
  5. $!  Change history:
  6. $!
  7. $!  Date      Who   What
  8. $!  --------  ----  -----------------------------------------------------------
  9. $!  19940804  MPJZ  Created
  10. $!  19940810  GRR   Removed superflous creation of name symbol
  11. $!  20000113  MPJZ  Better symbol check, fixed bug in zip "-A" check
  12. $!
  13. $!  MPJZ: Martin P.J. Zinser
  14. $!
  15. $!  For this to work a symbol unzipsfx has to be defined which contains the
  16. $!  location of the unzip stub (e.g., unzipsfx:== device:[dir]unzipsfx.exe)
  17. $!
  18. $!  The zipfile given in p1 will be concatenated with unzipsfx and given a
  19. $!  filename extension of .exe.  The default file extension for p1 is .zip
  20. $!
  21. $!  Use at your own risk, there is no guarantee here.  If it doesn't work,
  22. $!  blame me (zinser@decus.de), not the people from Info-ZIP.
  23. $!
  24. $!-----------------------------------------------------------------------------
  25. $!
  26. $! First check stub related stuff
  27. $!
  28. $ if (f$type(unzipsfx).nes."STRING")
  29. $ then
  30. $   type sys$input
  31. You need to define the symbol "unzipsfx" to point to the location of the
  32. unzipsfx stub before invoking this procedure.
  33. Exiting now...
  34. $   exit 2
  35. $ endif
  36. $ usfx = f$parse(unzipsfx) - ";"
  37. $ if (f$search(usfx).eqs."")
  38. $ then
  39. $   write sys$output "The unzipsfx stub can not be found on the location"
  40. $   write sys$output "pointed to by the unzipsfx symbol -- ''usfx'"
  41. $   write sys$output "Exiting now"
  42. $   exit 2
  43. $ endif
  44. $!
  45. $! Now check the input file
  46. $!
  47. $ if (p1.eqs."")
  48. $ then
  49. $   type sys$input
  50. Required parameter input-file missing
  51. Exiting now...
  52. $   exit 2
  53. $ endif
  54. $ inf = p1
  55. $ file = f$parse(inf,,,"DEVICE") + f$parse(inf,,,"DIRECTORY") + -
  56.          f$parse(inf,,,"NAME")
  57. $ finf = file + f$parse(inf,".ZIP",,"TYPE") + f$parse(inf,,,"VERSION")
  58. $ if (f$search(finf).eqs."")
  59. $ then
  60. $   write sys$output "Input file ''finf' does not exist"
  61. $   exit 2
  62. $ endif
  63. $!
  64. $! Finally create the self-extracting archive
  65. $!
  66. $ copy 'usfx','finf' 'file'.exe
  67. $!
  68. $! Zip "-A" will make the resulting archive compatible with other
  69. $! unzip programs, but is not essential for running the exe.
  70. $!
  71. $ if (f$type(zip).eqs."STRING") then zip "-A" 'file'.exe
  72. $ exit
  73.