home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 November / PCO_1198.ISO / filesbbs / os2 / win95key.arj / WIN95KEY.ZIP / remove.cmd < prev    next >
Encoding:
Text File  |  1998-08-10  |  1.3 KB  |  59 lines

  1. /*Uninstalling win95key*/
  2.  
  3. ModuleName="WIN95KEY"
  4.  
  5. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6. call SysLoadFuncs
  7.  
  8. KeyValue=SysIni("USER", "SYS_DLLS", "LoadOneTime")
  9.  
  10. Installed=0
  11.  
  12. do i=1 to Length(KeyValue)
  13.    if Substr(KeyValue, i, Length(ModuleName)) = ModuleName then
  14.       Installed=i
  15. end
  16.  
  17. i=Installed
  18.  
  19. if Installed <> 0 then
  20.  do
  21.  
  22.    if (i < 2) then
  23.      NewKey1=""
  24.     else
  25.      NewKey1=Substr(KeyValue, 1, i-1)
  26.  
  27.    if (i+Length(ModuleName)+1) > Length(KeyValue) then
  28.      do
  29.       if (i < 3) then
  30.         NewKey1=""
  31.        else
  32.         NewKey1=Substr(KeyValue, 1, i-2)
  33.        NewKey2=""
  34.      end
  35.     else
  36.      NewKey2=Substr(KeyValue, i+Length(ModuleName)+1, Length(KeyValue)-i-Length(ModuleName))
  37.  
  38.    NewKey=NewKey1||NewKey2
  39.  
  40.    say "Do you REALLY want to remove "ModuleName" ? ( y | n )"
  41.    Answer=charin()
  42.    if Answer="y" then
  43.      do 
  44.        if SysIni("USER", "SYS_DLLS", "LoadOneTime", NewKey) = '' then
  45.           do
  46.            say ModuleName" deregistered. You may delete c:\os2\dll\"ModuleName".dll"
  47.            "@unlock c:\os2\dll\win95key.dll >nul 2>nul"
  48.            say "Please reboot."
  49.           end
  50.          else
  51.           do
  52.            say "Failed for unknown reason :("
  53.           end
  54.      end
  55.  
  56.  end
  57. else
  58.  say "Win95key seems to be not installed here"
  59.