home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / EDMI5.ZIP / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1993-10-06  |  4KB  |  117 lines

  1. /***************************************************************************/
  2. /* This command file "installs" this issue of EDM/2 on your machine.       */
  3. /***************************************************************************/
  4. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  5. Call SysLoadFuncs
  6.  
  7. /***************************************************************************/
  8. /* Display the banner                                                      */
  9. /***************************************************************************/
  10. Say "EDM/2 Installation program  Version 1.00"
  11. Say
  12.  
  13. /***************************************************************************/
  14. /* Check the command line                                                  */
  15. /***************************************************************************/
  16. Parse Upper Arg DRIVE
  17. If DRIVE="" Then DRIVE="C:"
  18. If Length(DRIVE)<>2 | Right(DRIVE,1)<>":" Then Signal Help
  19.  
  20. /***************************************************************************/
  21. /* Set the VOLUME and ISSUE variables                                      */
  22. /***************************************************************************/
  23. Call SetVars
  24. THISONE="EDMI"||VOLUME||"-"||ISSUE
  25.  
  26. Say "Attempting to install volume" VOLUME||", issue" ISSUE||"."
  27.  
  28. /***************************************************************************/
  29. /* Check to see if the boot drive is valid.  Note that we cannot verify    */
  30. /* that this is the boot drive, so we'll have to trust the user            */
  31. /***************************************************************************/
  32. DRIVES=SysDriveMap()
  33. GOOD=0
  34.  
  35. Do I=1 to Words(DRIVES)
  36.    If DRIVE=Subword(DRIVES,I,1) Then GOOD=1
  37. End
  38.  
  39. If GOOD=0 Then Do
  40.    Say "Invalid drive specified.  Stop."
  41.    Exit 2
  42. End
  43.  
  44. /***************************************************************************/
  45. /* Find the fully qualified names of the online document and its icon      */
  46. /***************************************************************************/
  47. WP_DESKTOP=DRIVE||"\OS!2" Left(SysOS2Ver(),3) "Desktop"
  48.  
  49. Call SysFileTree THISONE||".INF","SEARCH.","FO"
  50. If SEARCH.0=0 Then Do
  51.    Say THISONE||".INF is not in the current directory.  Stop."
  52.    Exit 2
  53. End
  54.  
  55. FULLNAME=SEARCH.1
  56.  
  57. Call SysFileTree THISONE||".ICO","SEARCH.","FO"
  58. If SEARCH.0=0 Then Do
  59.    Say THISONE||".ICO is not in the current directory.  Stop."
  60.    Exit 2
  61. End
  62.  
  63. FULLICON=SEARCH.1
  64.  
  65. /***************************************************************************/
  66. /* Find the first folder with the title "EDM/2"                            */
  67. /***************************************************************************/
  68. Call SysFileTree WP_DESKTOP||"\EDM!2","SEARCH.","SDO"
  69.  
  70. If SEARCH.0=0 Then Do
  71.    /************************************************************************/
  72.    /* If a folder was not found, create one off of the desktop             */
  73.    /************************************************************************/
  74.    If SysCreateObject("WPFolder","EDM/2",WP_DESKTOP)=0 Then Do
  75.       Say "Could not create EDM/2 folder.  Stop."
  76.       Exit 2
  77.    End
  78.  
  79.    SEARCH.1=WP_DESKTOP||"\EDM!2"
  80. End
  81.  
  82. LOCATION=SEARCH.1
  83.  
  84. Say "Installing to folder" LOCATION
  85.  
  86. /***************************************************************************/
  87. /* Create the shadow object and set the icon                               */
  88. /***************************************************************************/
  89. If SysCreateObject("WPShadow",THISONE,LOCATION,"SHADOWID="||FULLNAME)=0 Then Do
  90.    Say "Could not create file object.  Stop."
  91.    Exit 2
  92. End
  93.  
  94. If SysSetIcon(FULLNAME,FULLICON) Then Do
  95.    Say "Installation complete."
  96.    Exit 0
  97. End
  98. Else Do
  99.    Say "File object was created, but could not set file icon.  Ignored."
  100.    Exit 0
  101. End
  102.  
  103. Help:
  104. Say "Syntax:  INSTALL [drive:]"
  105. Say "  where 'drive' is an optional parameter specifying the boot drive"
  106. Say "  of your system"
  107. Exit 1
  108.  
  109. SetVars:
  110. /*****************************************************************************/
  111. /* This function sets the VOLUME and ISSUE variables used by the rest of the */
  112. /* program and is generated by 'newissue.cmd'                                */
  113. /*****************************************************************************/
  114. VOLUME=1
  115. ISSUE=5
  116. Return
  117.