home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / dskclk10.zip / DeskWPS.cmd < prev    next >
OS/2 REXX Batch file  |  2000-01-02  |  4KB  |  121 lines

  1. /* DeskWPS - Install / UnInstall for Desktop Clock          */
  2.  
  3. PARSE ARG action
  4.  
  5. IF RxFuncQuery('SysLoadFuncs') THEN DO
  6.     CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  7.     CALL SysLoadFuncs
  8. END
  9. CALL SysCls
  10. action = TRANSLATE(LEFT(action,1))
  11. SELECT
  12.     WHEN action = 'I' THEN CALL InstallMe
  13.     WHEN action = 'U' THEN CALL UnInstallMe
  14.     OTHERWISE CALL WhatAction
  15. END
  16.  
  17. Exit /* End of DeskWPS.cmd                       */
  18.  
  19. /* WhatAction - no action selected */
  20.  
  21. WhatAction:     PROCEDURE
  22.  
  23. CALL SysCls
  24. SAY 'No installation parameter specified.'
  25. SAY 'Correct parameter is: I = Install,  U = UnInstall, any other key = Exit.'
  26. SAY 'Please try again with correct parameter.'
  27. PARSE PULL action
  28.  
  29. SELECT
  30.     WHEN TRANSLATE(STRIP(action)) = 'I' THEN CALL InstallMe
  31.     WHEN TRANSLATE(STRIP(action)) = 'U' THEN CALL UnInstallMe
  32.     OTHERWISE CALL NoAction
  33. END
  34.  
  35. RETURN /* End of WhatAction */
  36.  
  37. /* NoAction - abort Install */
  38.  
  39. NoAction:   PROCEDURE
  40.  
  41. CALL SysCls
  42. SAY 'Error! No installation parameter specified. Press any key to exit ...'
  43. PULL answer
  44.  
  45. CALL SysCls
  46.  
  47. Exit /* End of NoAction */
  48.  
  49. /* InstallMe - procedura za instalaciju programa DesktopClock */
  50.  
  51. InstallMe:  PROCEDURE
  52.  
  53. CALL SysCls
  54.  
  55. SAY 'Welcome to Desktop Clock Installation procedure!'
  56. SAY 'Your files are in directory: '||DIRECTORY()
  57. SAY 'This procedure will do following:'
  58. SAY '     Create Program Object for Desktop Clock files on your Desktop,'
  59. SAY '     Add Desktop Clock specific entry in OS2.INI file, in App ToolsByGoran.'
  60. SAY 'Press "Y" (and Enter) to start Installation, any other key to exit...'
  61. PARSE PULL answer
  62.  
  63. IF TRANSLATE(STRIP(answer)) <> "Y" THEN DO
  64.     CALL NoAction
  65. END
  66.  
  67. SAY 'Writing entry in OS2.INI'
  68. CALL SysIni 'USER','ToolsByGoran','DesktopClockINIfile',DIRECTORY()||'\DESKCLK.INI'
  69.  
  70. ProgTitle = 'Desktop Clock 1.00'
  71. EXE = 'DeskClk.exe'
  72. ICO = 'DeskClk.ico'
  73. InstallDir = DIRECTORY()
  74. WorkDir = DIRECTORY()
  75. Setup = 'OBJECTID=<DESKTOPCLOCK100_PROG>;EXENAME='InstallDir'\'EXE';ICONFILE='InstallDir'\'ICO';STARTUPDIR='WorkDir''
  76. Action = Replace
  77. SAY 'Creating Program object'
  78. CALL SysCreateObject 'WPProgram',ProgTitle,'<WP_DESKTOP>',Setup,Action
  79. SAY 'WPS object created! To create shadow of Desktop Clock in Startup folder,'
  80. SAY 'press "Y" (and Enter) to create shadow, any other key to exit...'
  81. PARSE PULL answer
  82. IF TRANSLATE(STRIP(answer)) = "Y" THEN DO
  83.     CALL SysCreateShadow '<DESKTOPCLOCK090_PROG>', '<WP_START>'
  84. END
  85. CALL SysCls
  86. 'START /F View.exe DeskClk.inf Introduction'
  87. RETURN /* End of InstallMe */
  88.  
  89. /* UnInstallMe - uninstall DesktopClock */
  90.  
  91. UnInstallMe: PROCEDURE
  92.  
  93. CALL SysCls
  94. SAY 'This is Desktop Clock UnInstallation procedure!'
  95. SAY 'Your files are in directory: '||DIRECTORY()
  96. SAY 'This program will do following:'
  97. SAY '     Remove Desktop Clock specific entry in OS2.INI file, App ToolsByGoran.'
  98. SAY '     Destroy Desktop Clock Program object'
  99. SAY 'Note: if you want to ReInstall DesktopClock, start (DeskWPS I) again.'
  100. SAY 'Press "Y" (and Enter) to start UnInstall, any other key to exit...'
  101. PULL answer
  102.  
  103. IF answer <> "Y" THEN DO
  104.     CALL NoAction
  105. END
  106.  
  107. SAY 'Removing entries from OS2.INI'
  108. CALL SysIni 'USER','ToolsByGoran','DesktopClockINIfile','DELETE:'
  109. SAY 'Destroying Program object'
  110. CALL SysDestroyObject '<DESKTOPCLOCK090_PROG>'
  111. SAY ' '
  112. SAY 'UnInstallation complete.'
  113. SAY 'You can delete files in directory: '||DIRECTORY()
  114. CALL SysFileTree DIRECTORY()||'\*.*', 'files', 'FSO'
  115. DO i = 1 TO files.0
  116.     SAY '     '||FILESPEC('name',files.i)
  117. END
  118. SAY 'If you want to ReInstall Desktop Clock, start DeskWPS I.Press any key to exit...'
  119. PULL answer
  120. RETURN /* End of UnInstallMe */
  121.