home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / wset-os2.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  2003-05-26  |  3KB  |  89 lines

  1. /*  rexx-program generating a Write&Set folder and
  2.     program objects with Wordstar file association,
  3.     pointing to WSformat and WSedit
  4.     Author: Martin Vieregg, Germany, December 2002 */
  5.  
  6. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  7. Call SysLoadFuncs
  8.  
  9. CurrentDir = directory()
  10.  
  11. rc = SysOpenObject("<WSAssocFolder>", ICON, TRUE)
  12.  
  13. if (rc = 1) then DO
  14.   say "The Write&Set association folder already exists.";
  15.   say "Do you want to delete all these WPS Objects ? (press Y or N) "
  16.   pull Contin
  17.   if  ((Contin = "N") | (Contin = "n")) then EXIT
  18.  
  19.   Call Destroy "<WSreadmeShadow>"
  20.   Call Destroy "<WSwsformatShadow>"
  21.   Call Destroy "<WSwsformatHelp>"
  22.   Call Destroy "<WSwseditHelp>"
  23.   Call Destroy "<WSlessonsShadow>"
  24.   Call Destroy "<WSwsformat>"
  25.   Call Destroy "<WSwseditform>"
  26.   Call Destroy "<WSwseditunform>"
  27.   Call Destroy "<WSAssocFolder>"
  28.   "@pause"
  29.   exit
  30. END
  31.  
  32. say "Please enter the WSformat directory"
  33. say "or RETURN if the directory is "CurrentDir"\WSformat"
  34. pull WSformatDir
  35. if (WSformatDir = "") then
  36.   WSformatDir = CurrentDir"\WSformat"
  37. say "Please enter the WSedit directory"
  38. say "or RETURN if the directory is "CurrentDir"\WSedit"
  39. pull WSeditDir
  40. if (WSeditDir = "") then
  41.   WSeditDir = CurrentDir"\WSedit"
  42. say
  43. say "The WSedit executable file is:"
  44. "@dir "WSeditDir"\WSedit.exe /f"
  45. say "The WSformat executable file is:"
  46. "@dir "WSformatDir"\WSformat.exe /f"
  47.  
  48.   Call SysCreateObject "WPFolder", "Write&Set associations", "<WP_DESKTOP>",,
  49.     "OBJECTID=<WSAssocFolder>;;"
  50.  
  51.   Call SysCreateObject "WPProgram", "WSedit unformatted", "<WSAssocFolder>",,
  52. "OBJECTID=<WSwseditunform>;EXENAME="WSeditDir"\WSedit.EXE;ICONFILE="CurrentDir"\InstData\WSedit.ICO;ASSOCFILTER=*.WS;"
  53.  
  54.   Call SysCreateObject "WPProgram", "WSedit formatted", "<WSAssocFolder>",,
  55. "OBJECTID=<WSwseditform>;EXENAME="WSeditDir"\WSedit.EXE;ICONFILE="CurrentDir"\InstData\formated.ICO;ASSOCFILTER=*.FMT,*.FUN,*.TOC,*.TAF;"
  56.  
  57.   Call SysCreateObject "WPProgram", "WSformat", "<WSAssocFolder>",,
  58. "OBJECTID=<WSwsformat>;EXENAME="WSformatDir"\WSformat.EXE;ICONFILE="CurrentDir"\InstData\WSformat.ICO;ASSOCFILTER=*.WS,*.TXT;"
  59.  
  60. Call SysCreateObject "WPShadow", "WSformat", "<WP_DESKTOP>",,
  61.     "OBJECTID=<WSwsformatShadow>;SHADOWID=<WSwsformat>;"
  62.  
  63. Call SysCreateObject "WPShadow", "readme.txt", "<WSAssocFolder>",,
  64.     "OBJECTID=<WSreadmeShadow>;SHADOWID="CurrentDir"\readme.txt;"
  65.  
  66. Call SysCreateObject "WPProgram", "WSedit Help", "<WSAssocFolder>",,
  67. "OBJECTID=<WSwseditHelp>;EXENAME=VIEW.EXE;PARAMETERS="WSeditDir"\wsedit-e.hlp;"
  68.  
  69. Call SysCreateObject "WPProgram", "WSformat Help", "<WSAssocFolder>",,
  70. "OBJECTID=<WSwsformatHelp>;EXENAME=VIEW.EXE;PARAMETERS="WSformatDir"\wsfdocu.hlp;"
  71.  
  72. Call SysCreateObject "WPShadow", "Tutorial", "<WSAssocFolder>",,
  73.     "OBJECTID=<WSlessonsShadow>;SHADOWID="CurrentDir"\Tutorial;"
  74.  
  75.  
  76. "pause"
  77.  
  78. Call SysOpenObject "<WSAssocFolder>", ICON, TRUE
  79.  
  80. exit
  81.  
  82. Destroy:
  83. if SysDestroyObject(ARG(1)) then DO
  84.   say "deleting "ARG(1)" OK"
  85. END
  86. else DO
  87.   say "deleting "ARG(1)" failed"
  88. END
  89. return