home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sysset12.zip / sysset.cmd < prev    next >
OS/2 REXX Batch file  |  2000-06-02  |  2KB  |  84 lines

  1. /**/
  2. dll = 'SYSSET'
  3. UnlockModule = 'syssetUnlockModule'
  4. class.0 = 1
  5. class.1 = 'WPSysset'
  6. /**/
  7. call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  8. call SysLoadFuncs
  9. if RxFuncQuery('UnlockModule') = 0 then
  10.   call RxFuncDrop 'UnlockModule'
  11. call RxFuncAdd 'UnlockModule', dll, UnlockModule
  12. dll = dll'.DLL'
  13. arg opt
  14. select
  15.   when opt = 'I' then do
  16.     call SysFileTree dll, 'stem', 'O'
  17.     if stem.0 = 0 then
  18.       say 'Unable to locate' dll
  19.     else do
  20.       do i = 1 to class.0
  21.     call register class.i
  22.       end
  23.       call createobj
  24.     end
  25.   end
  26.   when opt = 'U' then do
  27.     call deleteobj
  28.     do i = 1 to class.0
  29.       call deregister class.i
  30.     end
  31.     call charout , 'Unlocking' dll': '
  32.     rc = UnlockModule(dll)
  33.     if rc = 0 | rc = 296 then
  34.       say 'Success'
  35.     else
  36.       say 'Failure'
  37.   end
  38.   otherwise
  39.     parse upper source . . me
  40.     me = filespec('N', me)
  41.     say
  42.     say 'Usage:' left(me, lastpos('.', me) - 1) '<option>'
  43.     say
  44.     say 'Option is: I - Install'
  45.     say '           U - Uninstall'
  46. end
  47. call RxFuncDrop 'UnlockModule'
  48. return
  49.  
  50. register:
  51.   parse arg newclass
  52.   call charout , 'Registering class' newclass': '
  53.   if SysRegisterObjectClass(newclass, stem.1) \= 0 then
  54.     say 'Success'
  55.   else
  56.     say 'Failure'
  57.   return
  58.  
  59. deregister:
  60.   parse arg newclass
  61.   call charout , 'Deregistering class' newclass': '
  62.   if SysDeregisterObjectClass(newclass) \= 0 then
  63.     say 'Success'
  64.   else
  65.     say 'Failure'
  66.   return
  67.  
  68. createobj:
  69.   call charout , 'Creating Sysset object: '
  70.   if SysCreateObject('WPSysset', 'Sysset', '<WP_NOWHERE>',,
  71.       'OBJECTID=<SYSSET>') \= 0 then
  72.     say 'Success'
  73.   else
  74.     say 'Failure'
  75.   return
  76.  
  77. deleteobj:
  78.   call charout , 'Deleting Sysset object: '
  79.   if SysDestroyObject('<SYSSET>') \= 0 then
  80.     say 'Success'
  81.   else
  82.     say 'Failure'
  83.   return
  84.