home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / dcpac2b4.zip / DCsetup.cmd next >
OS/2 REXX Batch file  |  2000-02-12  |  29KB  |  772 lines

  1. /**************************************************************/
  2. /* REXX installation/uninstallation script for DC User Pack   */
  3. /* Copyright (C) 1999 by Alex Porollo                         */
  4. /* modified  (C) 2000 by VicTor Smirnoff                      */
  5. /**************************************************************/
  6.  
  7. /**************************************************************/
  8. /* Library registration                                       */
  9. /**************************************************************/
  10.  
  11. if RxFuncQuery('SysLoadFuncs') then
  12.   do
  13.     call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  14.     call SysLoadFuncs 
  15.   end
  16.  
  17.  
  18. /**************************************************************/
  19. /* Constants                                                  */
  20. /**************************************************************/
  21.  
  22. Ver='v0.02 (beta VI)'
  23. DefaultDir='\DCpack'
  24. PluginDir='plugin'
  25. LibPath='\OS2\APPS\DLL'
  26.  
  27. SourceDist='COMMON'
  28. SourceExe.0='OS2'
  29. SourceExe.1='EMX'
  30.  
  31. RootFilesCount=7
  32. RootFile.1='DCsetup.cmd'
  33. RootFile.2='FILE_ID.DIZ'
  34. RootFile.3='FILE_ID.RUS'
  35. RootFile.4='DCUP.ABS'
  36. RootFile.5='DCUP.RUS'
  37. RootFile.6='LICENSE.ENG'
  38. RootFile.7='LICENSE.RUS'
  39.  
  40. DllFilesCount=2
  41. DllFile.1='DCplus.dll'
  42. DllFile.2='rxDCplus.dll'
  43.  
  44. ComDllFilesCount=1
  45. ComDllFile.1='DCdll.dll'
  46.  
  47. ExeFilesCount=2
  48. ExeFile.1='DCclico.exe'
  49. ExeFile.2='decode.exe'
  50.  
  51. ComExeFilesCount=2
  52. ComExeFile.1='DC.exe'
  53. ComExeFile.2='DCfilter.exe'
  54.  
  55. DistFilesCount=12
  56. DistFile.1='DCclicoE.hlp'
  57. DistFile.2='DCclicoR.hlp'
  58. DistFile.3='DCclico.ico'
  59. DistFile.4='DCpack.ico'
  60. DistFile.5='DCsetup.ico'
  61. DistFile.6='DCpackE.INF'
  62. DistFile.7='DCpackR.INF'
  63. DistFile.8='DCpack.bmp'
  64. DistFile.9='DC.ini'
  65. DistFile.10='rxDeMime.cmd'
  66. DistFile.11='rxEnMime.cmd'
  67. DistFile.12='tstDCplu.cmd'
  68.  
  69. PlugFilesCount=6
  70. PlugFile.1='DCauto.dll'
  71. PlugFile.2='DCmanual.dll'
  72. PlugFile.3='DCmime.dll'
  73. PlugFile.4='DCsystem.dll'
  74. PlugFile.5='DCvolpk.dll'
  75. PlugFile.6='decode.dll'
  76.  
  77. AddPlugFilesCount=1
  78. AddplugFile.1='user.cod'
  79.  
  80. IniFile='DCCLICO.INI'
  81.  
  82. Esc=D2C(27)'[1;'
  83. Grey_color=Esc'30m'
  84. Red_color=Esc'31m'
  85. Green_color=Esc'32m'
  86. Yellow_color=Esc'33m'
  87. Blue_color=Esc'34m'
  88. Magenta_color=Esc'35m'
  89. Cyan_color=Esc'36m'
  90. White_color=Esc'37m'
  91. ErrorMsg.0='Error: '
  92. ErrorMsg.1='ÄΦ¿í¬á: '
  93.  
  94. VisualDelay=1
  95.  
  96. EmxFilesCount=6
  97. EmxFile.1='emx'
  98. EmxFile.2='emxio'
  99. EmxFile.3='emxlibc'
  100. EmxFile.4='emxlibcm'
  101. EmxFile.5='emxlibcs'
  102. EmxFile.6='emxwrap'
  103. EmxVersion.1=60
  104. EmxVersion.2=60
  105. EmxVersion.3=60
  106. EmxVersion.4=62
  107. EmxVersion.5=62
  108. EmxVersion.6=60
  109.  
  110. /**************************************************************/
  111. /* Some additional variables                                  */
  112. /**************************************************************/
  113.  
  114. '@echo off'
  115. if Right(DefaultDir,1)='\' then DefaultDir=Left(DefaultDir,Length(DefaultDir)-1)
  116. if Left(DefaultDir,1)\='\' then DefaultDir='\'DefaultDir
  117. if Right(PluginDir,1)='\' then PluginDir=Left(PluginDir,Length(PluginDir)-1)
  118. if Left(PluginDir,1)='\' then PluginDir=Right(PluginDir,Length(PluginDir)-1)
  119. if Right(LibPath,1)='\' then LibPath=Left(LibPath,Length(LibPath)-1)
  120. if Left(LibPath,1)\='\' then LibPath='\'LibPath
  121. BootDrv=FileSpec('drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))
  122. DefaultDir=BootDrv''DefaultDir
  123. LibPath=BootDrv''LibPath
  124.  
  125. newq=RxQueue('Create')
  126. od=RxQueue('Set',newq)
  127. do while Queued()>0
  128.   pull .
  129. end
  130. 'chcp |rxqueue 'newq
  131. pull Codepage
  132. do while Queued()>0
  133.   pull .
  134. end
  135. Codepage=Space(Codepage)
  136. parse var Codepage tmp': 'Codepage
  137.  
  138.  
  139. /**************************************************************/
  140. /* StartUp                                                    */
  141. /**************************************************************/
  142.  
  143. call SysCls
  144. say
  145. say Center(Grey_color'-='Yellow_color' DC User Pack for OS/2 'White_color''Ver''Yellow_color' setup 'Grey_color'=-',79+7*5)
  146. say
  147.  
  148. if Codepage=866 then
  149.   do
  150.     MsgRLang=0
  151.     say White_color'éδíÑα¿ΓÑ «ñ¿¡ ¿º óáα¿á¡Γ«ó:'
  152.     if Translate(Arg(1))\='-UNINSTALL' then
  153.       do
  154.         say Cyan_color'  (Y)'Green_color' »α«ñ«½ª¿Γ∞ ¿¡ßΓá½½∩µ¿ε απß߬«⌐ óÑαß¿¿ »á¬ÑΓá'
  155.         say Cyan_color'  (n)'Green_color' install the international (english) version'
  156.       end
  157.     else
  158.       do
  159.         say Cyan_color'  (Y)'Green_color' »α«ñ«½ª¿Γ∞ ó απß߬«⌐ óÑαß¿¿ ñÑ¿¡ßΓá½½∩Γ«αá'
  160.         say Cyan_color'  (n)'Green_color' use international (english) version of the uninstaller'
  161.       end
  162.     call CharOut ,White_color'ì᪼¿ΓÑ 'Cyan_color'(Y/n)'White_color
  163.     if AskYN(1) then MsgRLang=1
  164.   end
  165. else
  166.   do
  167.     MsgRLang=1
  168.     say White_color'Select the language:'
  169.     if Translate(Arg(1))\='-UNINSTALL' then
  170.       do
  171.         say Cyan_color'  (Y)'Green_color' continue to install the international (english) version'
  172.         say Cyan_color'  (n)'Green_color' πßΓá¡«ó¿Γ∞ απß߬πε óÑαß¿ε »á¬ÑΓá'
  173.       end
  174.     else
  175.       do
  176.         say Cyan_color'  (Y)'Green_color' continue in the international (english) version of the uninstaller'
  177.         say Cyan_color'  (n)'Green_color' ¿ß»«½∞º«óáΓ∞ απß߬πε óÑαß¿ε ñÑ¿¡ßΓá½½∩Γ«αá'
  178.       end
  179.     call CharOut ,White_color'Press 'Cyan_color'(Y/n)'White_color
  180.     if AskYN(1) then MsgRLang=0
  181.   end
  182. do i=1 to 4
  183.   call ClearPrevLine
  184. end
  185.  
  186. /**************************************************************/
  187. /* Detect EMX/standalone mode                                 */
  188. /**************************************************************/
  189.  
  190. EmxExist=0
  191. if Translate(Arg(1))\='-UNINSTALL' then
  192.   do
  193.     EmxExist=1
  194.     do i=1 to EmxFilesCount
  195.       if EmxRevision(EmxFile.i)<EmxVersion.i then
  196.         do
  197.           EmxExist=0;  leave i
  198.         end
  199.     end
  200.     if EmxExist then
  201.       do
  202.         EmxExist=0
  203.         if MsgRLang then msg='é éáΦÑ⌐ ß¿ßΓѼѠ«í¡áαπªÑ¡á »«ñσ«ñ∩Θá∩ óÑαß¿∩ EMX.'
  204.         else msg='Your system uses the suitable version of the EMX.'
  205.         say Green_color''msg
  206.         if MsgRLang then msg='éδíÑα¿ΓÑ «ñ¿¡ ¿º óáα¿á¡Γ«ó:'
  207.         else msg='Select the version:'
  208.         say White_color''msg
  209.         if MsgRLang then msg='πßΓá¡«ó¿Γ∞ EMX-óÑαß¿ε'
  210.         else msg='install the EMX version'
  211.         say Cyan_color'  (Y)'Green_color''msg
  212.         if MsgRLang then msg='πßΓá¡«ó¿Γ∞ «íδτ¡πε óÑαß¿ε'
  213.         else msg='install the standalone version'
  214.         say Cyan_color'  (n)'Green_color''msg
  215.     
  216.         if MsgRLang then msg='ì᪼¿ΓÑ'
  217.         else msg='Press'
  218.         call CharOut ,''White_color''msg' 'Cyan_color'(Y/n)'White_color
  219.         if AskYN(1) then EmxExist=1
  220.         do i=1 to 5
  221.           call ClearPrevLine
  222.         end
  223.       end
  224.   end
  225.  
  226. call SysCurState 'OFF'
  227. if MsgRLang then msg='Å«ªá½π⌐ßΓá, ºá¬α«⌐ΓÑ óßÑ á¬Γ¿ó¡δÑ »α¿½«ªÑ¡¿∩, ¿ß»«½∞ºπεΘ¿Ñ DC User Pack!'
  228. else msg='Please stop any running applications using the DC User Pack!'
  229. say Red_color''msg''White_color
  230. if MsgRLang then msg='çáΓѼ ¡áª¼¿ΓÑ ½εíπε ¬½áó¿Φπ'
  231. else msg='Then press any key'
  232. call CharOut ,Grey_color''msg'...'White_color
  233. call SysGetKey('NOECHO')
  234. say;
  235. do i=1 to 2
  236.   call ClearPrevLine
  237. end
  238. call SysCurState 'ON'
  239.  
  240.  
  241. /**************************************************************/
  242. /* Detect installation/uninstallation mode                    */
  243. /**************************************************************/
  244.  
  245. AllDllCount=DllFilesCount*2+ComDllFilesCount
  246. DllCount=0
  247. do i=1 to DllFilesCount
  248.   if Stream(SourceExe.0'\'DllFile.i,'c','query exists')\='' then DllCount=DllCount+1
  249.   if Stream(SourceExe.1'\'DllFile.i,'c','query exists')\='' then DllCount=DllCount+1
  250. end
  251. do i=1 to ComDllFilesCount
  252.   if Stream(SourceDist'\'ComDllFile.i,'c','query exists')\='' then DllCount=DllCount+1
  253. end
  254. if DllCount=AllDllCount & Stream(IniFile,'c','query exists')='' & Arg(1)='' then
  255.  
  256. /**************************************************************/
  257. /* Select installation mode                                   */
  258. /**************************************************************/
  259.  
  260.   do
  261.     if MsgRLang then msg='ê¡ßΓá½½∩µ¿∩'
  262.     else msg='Installation'
  263.     say White_color''msg':'
  264.  
  265.     if MsgRLang then msg='ìáτ¿¡áΓ∞ ¿¡ßΓá½½∩µ¿ε'
  266.     else msg='Continue with installation'
  267.     call CharOut ,Green_color'  'msg' 'Cyan_color'(Y/n)'Green_color'? 'White_color
  268.     if AskYN(1) then
  269.       do
  270.         /******************************************************/
  271.         /* Select installation directory                      */
  272.         /******************************************************/
  273.         if MsgRLang then msg='éóÑñ¿ΓÑ »πΓ∞ πßΓá¡«ó¬¿'
  274.         else msg='Input target path'
  275.         call CharOut ,Green_color'  'msg' 'Cyan_color'('DefaultDir')'Green_color': 'White_color
  276.         InstallDir=LineIn()
  277.         if Space(InstallDir)='' then InstallDir=DefaultDir
  278.         InstallDir=Translate(InstallDir,'\','/')
  279.         if Right(InstallDir,1)='\' then InstallDir=Left(InstallDir,Length(InstallDir)-1)
  280.         if Substr(InstallDir,2,1)\=':' then
  281.           do
  282.             if Left(InstallDir,1)\='\' then InstallDir='\'InstallDir
  283.             InstallDir=BootDrv''InstallDir
  284.           end
  285.         fPluginDir=InstallDir'\'PluginDir
  286.         call ClearPrevLine
  287.         if MsgRLang then msg='éδíαá¡á ñ¿αÑ¬Γ«α¿∩'
  288.         else msg='Target path'
  289.         say Green_color'  'msg': 'White_color''InstallDir
  290.         call SysFileTree InstallDir,dir,'D'
  291.         if dir.0=0 then
  292.           do
  293.             if MsgRLang then msg='éδíαá¡¡á∩ ñ¿αÑ¬Γ«α¿∩ ¡Ñ ßπΘÑßΓóπÑΓ! æ«ºñáΓ∞ ÑÑ'
  294.             else msg='Target path not found! Create it'
  295.             call CharOut ,Red_color'  'msg' 'Cyan_color'(Y/n)'Red_color'? 'White_color
  296.             if AskYN(1) then
  297.               do
  298.                 call ClearPrevLine
  299.                 parse var InstallDir s'\'d.0'\'d.1'\'d.2'\'d.3'\'d.4'\'d.5'\'d.6'\'d.7'\'d.8'\'d.9'\'d.10
  300.                 i=0
  301.                 do while d.i\=''
  302.                   s=s'\'d.i
  303.                   call SysFileTree s,dir,'D'
  304.                   if dir.0=0 then
  305.                     if SysMkDir(s)\=0 then
  306.                       do
  307.                         if MsgRLang then msg='ìÑ󫺼«ª¡« ß«ºñáΓ∞ óδíαá¡¡πε ñ¿αÑ¬Γ«α¿ε'
  308.                         else msg='Can`t create target directory'
  309.                         say Red_color'  'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  310.                         call AbortProg(1)
  311.                       end
  312.                   i=i+1
  313.                 end
  314.               end
  315.             else call AbortProg(1)
  316.           end
  317.         else
  318.           do
  319.             if MsgRLang then msg='ä¿αÑ¬Γ«α¿∩ ¡á⌐ñÑ¡á! ôñ὿Γ∞ óßÑ Σá⌐½δ ¿º φΓ«⌐ ñ¿αÑ¬Γ«α¿¿'
  320.             else msg='Target path found! Remove all files from this directory'
  321.             call CharOut ,Green_color'  'msg' 'Cyan_color'(Y/n)'Green_color'? 'White_color
  322.             if AskYN(1) then
  323.               do
  324.                 if MsgRLang then msg='ôñá½∩Ѽ óßÑ Σá⌐½δ ¿º óδíαá¡¡«⌐ ñ¿αÑ¬Γ«α¿¿'
  325.                 else msg='Removing all files from target directory'
  326.                 call CharOut ,Grey_color'    'msg'... '
  327.                 call SysFileTree InstallDir'\*','file','FOS'
  328.                 do i=1 to file.0
  329.                   if SysFileDelete(file.i)\=0 then
  330.                     do
  331.                       if MsgRLang then msg='ìÑ󫺼«ª¡« πñ὿Γ∞ Σá⌐½δ ¿º óδíαá¡¡«⌐ ñ¿αÑ¬Γ«α¿¿'
  332.                       else msg='Removing files from target directory failed'
  333.                       say; say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  334.                       call AbortProg(1)
  335.                     end
  336.                 end
  337.                 say White_color'Ok.'
  338.               end
  339.           end
  340.         call SysFileTree fPluginDir,dir,'D'
  341.         if dir.0=0 then
  342.           if SysMkDir(fPluginDir)\=0 then
  343.             do
  344.               if MsgRLang then msg='ìÑ󫺼«ª¡« ß«ºñáΓ∞ ñ¿αÑ¬Γ«α¿ε ñ½∩ »½πú¿¡«ó'
  345.               else msg='Can`t create plugin directory'
  346.               say Red_color'  'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  347.               call AbortProg(1)
  348.             end
  349.  
  350.         /******************************************************/        
  351.         /* Search for old relative DLLs                       */
  352.         /******************************************************/
  353.         if MsgRLang then msg='ìá⌐Γ¿ ¿ πñ὿Γ∞ DLL-¬¿ «Γ »αÑñδñπΘ¿σ óÑαß¿⌐'
  354.         else msg='Search for any old relative DLLs for removing'
  355.         call CharOut ,Green_color'  'msg' 'Cyan_color'(Y/n)'Green_color'? 'White_color
  356.         if AskYN(1) then
  357.           do
  358.             call SysCurState 'OFF'
  359.             if MsgRLang then msg='Å«»α«íπѼ ¡á⌐Γ¿ ¿ «íѺóαÑñ¿Γ∞'
  360.             else msg='Trying to remove old relative DLLs'
  361.             call CharOut ,Grey_color'    'msg'... '
  362.             parse value SysCurPos() with Oldrow Oldcol
  363.             say; call RemoveDLL
  364.             call SysCurPos Oldrow,Oldcol
  365.             say White_color'Ok.'
  366.           end
  367.  
  368.         /******************************************************/
  369.         /* Installing components                              */
  370.         /******************************************************/
  371.         call SysCurState 'OFF'
  372.         if MsgRLang then msg='ê¡ßΓá½½¿απѼ ¬«¼»«¡Ñ¡Γδ DC User Pack'
  373.         else msg='Installing DC User Pack components'
  374.         call CharOut ,Grey_color'    'msg'... '
  375.         parse value SysCurPos() with Oldrow Oldcol
  376.         say
  377.         if MsgRLang then
  378.           do
  379.             msg1='è«»¿απѼ'; msg2='ó'
  380.           end
  381.         else
  382.           do
  383.             msg1='Copying'; msg2='to'
  384.           end
  385.         do i=1 to DllFilesCount
  386.           say Left(Grey_color'      'msg1' 'Yellow_color''DllFile.i''Grey_color' 'msg2' 'Yellow_color''LibPath''Grey_color'...',79+7*4)
  387.           'copy 'SourceExe.EmxExist'\'DllFile.i' 'LibPath' >nul'
  388.           call SysSleep VisualDelay
  389.           call ClearPrevLine
  390.         end
  391.         do i=1 to ComDllFilesCount
  392.           say Left(Grey_color'      'msg1' 'Yellow_color''ComDllFile.i''Grey_color' 'msg2' 'Yellow_color''LibPath''Grey_color'...',79+7*4)
  393.           'copy 'SourceDist'\'ComDllFile.i' 'LibPath' >nul'
  394.           call SysSleep VisualDelay
  395.           call ClearPrevLine
  396.         end
  397.         do i=1 to ExeFilesCount
  398.           say Left(Grey_color'      'msg1' 'Yellow_color''ExeFile.i''Grey_color' 'msg2' 'Yellow_color''InstallDir''Grey_color'...',79+7*4)
  399.           'copy 'SourceExe.EmxExist'\'ExeFile.i' 'InstallDir' >nul'
  400.           call SysSleep VisualDelay
  401.           call ClearPrevLine
  402.         end
  403.         do i=1 to ComExeFilesCount
  404.           say Left(Grey_color'      'msg1' 'Yellow_color''ComExeFile.i''Grey_color' 'msg2' 'Yellow_color''InstallDir''Grey_color'...',79+7*4)
  405.           'copy 'SourceDist'\'ComExeFile.i' 'InstallDir' >nul'
  406.           call SysSleep VisualDelay
  407.           call ClearPrevLine
  408.         end
  409.         do i=1 to RootFilesCount
  410.           say Left(Grey_color'      'msg1' 'Yellow_color''RootFile.i''Grey_color' 'msg2' 'Yellow_color''InstallDir''Grey_color'...',79+7*4)
  411.           'copy 'RootFile.i' 'InstallDir' >nul'
  412.           call SysSleep VisualDelay
  413.           call ClearPrevLine
  414.         end
  415.         do i=1 to DistFilesCount
  416.           if MsgRLang & (i=1 | i=6) then iterate
  417.           if \MsgRLang & (i=2 | i=7) then iterate
  418.           say Left(Grey_color'      'msg1' 'Yellow_color''DistFile.i''Grey_color' 'msg2' 'Yellow_color''InstallDir''Grey_color'...',79+7*4)
  419.           'copy 'SourceDist'\'DistFile.i' 'InstallDir' >nul'
  420.           call SysSleep VisualDelay
  421.           call ClearPrevLine
  422.         end
  423.         do i=1 to AddPlugFilesCount
  424.           say Left(Grey_color'      'msg1' 'Yellow_color''AddPlugFile.i''Grey_color' 'msg2' 'Yellow_color''fPluginDir''Grey_color'...',79+7*4)
  425.           'copy 'PluginDir'\'AddPlugFile.i' 'fPluginDir' >nul'
  426.           call SysSleep VisualDelay
  427.           call ClearPrevLine
  428.         end
  429.         do i=1 to PlugFilesCount
  430.           say Left(Grey_color'      'msg1' 'Yellow_color''PlugFile.i''Grey_color' 'msg2' 'Yellow_color''fPluginDir''Grey_color'...',79+7*4)
  431.           'copy 'PluginDir'\'SourceExe.EmxExist'\'PlugFile.i' 'fPluginDir' >nul'
  432.           call SysSleep VisualDelay
  433.           call ClearPrevLine
  434.         end
  435.         call SysCurPos Oldrow,Oldcol
  436.         say White_color'Ok.'
  437.  
  438.         /******************************************************/
  439.         /* Create DC User Pack folder                         */
  440.         /******************************************************/
  441.         param='ICONFILE='InstallDir'\'DistFile.4';OBJECTID=<DCUP_FLD>;ALWAYSSORT=Yes;ICONVIEWPOS=25,25,45,30;BACKGROUND='InstallDir'\'DistFile.8',T'
  442.         if SysCreateObject('WPFolder','DC User Pack','<WP_DESKTOP>',param,'REPLACE') then
  443.           do
  444.             if MsgRLang then msg='ÅỬá DC User Pack πß»ÑΦ¡« ß«ºñá¡á ¡á αáí«τѼ ßΓ«½Ñ'
  445.             else msg='DC User Pack folder successfully created on the desktop'
  446.             say Grey_color'    'msg'!'
  447.             call SysSleep VisualDelay
  448.           end
  449.         else
  450.           do
  451.             if MsgRLang then msg='ìÑ󫺼«ª¡« ß«ºñáΓ∞ »á»¬π DC User Pack'
  452.             else msg='DC User Pack folder creating failed'
  453.             say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  454.             call AbortProg(1)
  455.           end
  456.  
  457.         /******************************************************/
  458.         /* Create DCclico object                              */
  459.         /******************************************************/
  460.         ExeParam=''
  461.         if MsgRLang then
  462.           do
  463.             cpProgName='è«ñ¿α«óΘ¿¬ üπΣÑαá Äí¼Ñ¡á'
  464.             if Codepage\=866 then ExeParam='-l:rus'
  465.           end
  466.         else
  467.           do
  468.             cpProgName='Clipboard Coder'
  469.             if Codepage=866 then ExeParam='-l:eng'
  470.           end
  471.         if ExeParam\='' then ExeParam='PARAMETERS='ExeParam';'
  472.         param='ICONFILE='InstallDir'\'DistFile.3';OBJECTID=<DCUPCLICO_EXE>;EXENAME='InstallDir'\'ExeFile.1';'ExeParam'STARTUPDIR='InstallDir
  473.         if SysCreateObject('WPProgram',cpProgName,'<DCUP_FLD>',param,'REPLACE') then
  474.           do
  475.             if MsgRLang then msg='ÄíΩÑ¬Γ DCclico πß»ÑΦ¡« ß«ºñá¡'
  476.             else msg='DCclico object successfully created'
  477.             say Grey_color'    'msg'!'
  478.             call SysSleep VisualDelay
  479.           end
  480.         else
  481.           do
  482.             if MsgRLang then msg='ìÑ󫺼«ª¡« ß«ºñáΓ∞ «íΩÑ¬Γ DCclico'
  483.             else msg='DCclico object creating failed'
  484.             say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  485.             call AbortProg(1)
  486.           end
  487.  
  488.         /******************************************************/
  489.         /* Create DC User Pack Uninstall object               */
  490.         /******************************************************/
  491.         if MsgRLang then cpProgName='äÑ¿¡ßΓá½½∩µ¿∩ DC User Pack'
  492.         else cpProgName='Uninstall DC User Pack'
  493.         param='ICONFILE='InstallDir'\'DistFile.5';EXENAME=*;PROGTYPE=WINDOWABLEVIO;MINIMIZED=NO;NOAUTOCLOSE=NO;PARAMETERS=/c start "Uninstall DC User Pack" /c /f /max /win 'InstallDir'\'RootFile.1' -Uninstall;STARTUPDIR='InstallDir
  494.         if SysCreateObject('WPProgram',cpProgName,'<DCUP_FLD>',param,'REPLACE') then
  495.           do
  496.             if MsgRLang then msg='ÄíΩÑ¬Γ ñÑ¿¡ßΓá½½∩µ¿¿ πß»ÑΦ¡« ß«ºñá¡'
  497.             else msg='Uninstall object successfully created'
  498.             say Grey_color'    'msg'!'
  499.             call SysSleep VisualDelay
  500.           end
  501.         else
  502.           do
  503.             if MsgRLang then msg='ìÑ󫺼«ª¡« ß«ºñáΓ∞ «íΩÑ¬Γ ñÑ¿¡ßΓá½½∩µ¿¿'
  504.             else msg='Uninstall object creating failed'
  505.             say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  506.             call AbortProg(1)
  507.           end
  508.  
  509.         /******************************************************/
  510.         /* Install DC User Pack Information                   */
  511.         /******************************************************/
  512.         if MsgRLang then
  513.           do
  514.             msg='Ä»¿ßá¡¿Ñ DC User Pack'; InfFile=DistFile.7
  515.           end
  516.         else
  517.           do
  518.             msg='DC User Pack Reference'; InfFile=DistFile.6
  519.           end
  520.         param='PROGTYPE=PM;NOPRINT=YES;HELPPANEL=4083;EXENAME=VIEW.EXE;NOPRINT=YES;STARTUPDIR='InstallDir';PARAMETERS='InstallDir'\'InfFile
  521.         if SysCreateObject('WPProgram',msg,'<DCUP_FLD>',param,'REPLACE') then
  522.           do
  523.             if MsgRLang then msg='ÄíΩÑ¬Γ «»¿ßá¡¿∩ DC User Pack πß»ÑΦ¡« ß«ºñá¡'
  524.             else msg='DC User Pack Information object successfully created'
  525.             say Grey_color'    'msg'!'
  526.             call SysSleep VisualDelay
  527.           end
  528.         else
  529.           do
  530.             if MsgRLang then msg='ìÑ󫺼«ª¡« ß«ºñáΓ∞ «íΩÑ¬Γ «»¿ßá¡¿∩ DC User Pack'
  531.             else msg='DC User Pack Information object creating failed'
  532.             say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  533.             call AbortProg(1)
  534.           end
  535.         if MsgRLang then msg='Åα«µÑßß ¿¡ßΓá½½∩µ¿¿ πß»ÑΦ¡« ºáóÑαΦÑ¡'
  536.         else msg='Installation process successfully completed'
  537.         say Green_color'  'msg'!'
  538.       end
  539.     else call AbortProg(1)
  540.   end
  541.  
  542. else
  543.  
  544. /**************************************************************/
  545. /* Select uninstallation mode                                 */
  546. /**************************************************************/
  547.  
  548.   if Translate(Arg(1))='-UNINSTALL' then
  549.     do
  550.       if MsgRLang then msg='äÑ¿¡ßΓá½½∩µ¿∩'
  551.       else msg='Uninstallation'
  552.       say White_color''msg':'
  553.       if MsgRLang then msg='ìáτ¿¡áΓ∞ ñÑ¿¡ßΓá½½∩µ¿ε'
  554.       else msg='Continue with uninstallation'
  555.       call CharOut ,Green_color'  'msg' 'Cyan_color'(y/N)'Green_color'? 'White_color
  556.       if AskYN(0) then
  557.         do
  558.           /****************************************************/
  559.           /* Removing DC User Pack objects                    */
  560.           /****************************************************/
  561.           call SysCurState 'OFF'
  562.           if MsgRLang then msg='ôñá½∩Ѽ «íΩѬΓδ DC User Pack ß αáí«τÑú« ßΓ«½á'
  563.           else msg='Removing DC User Pack objects from the desktop'
  564.           call CharOut ,Grey_color'    'msg'... '
  565.           if SysDestroyObject('<DCUP_FLD>') then
  566.             do
  567.               call SysSleep VisualDelay
  568.               say White_color'Ok.'
  569.             end
  570.           else 
  571.             do
  572.               if MsgRLang then msg='ìÑ󫺼«ª¡« πñ὿Γ∞ «íΩѬΓδ DC User Pack'
  573.               else msg='DC User Pack objects removing failed'
  574.               say; say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  575.               call AbortProg(2)
  576.             end
  577.  
  578.           /****************************************************/
  579.           /* Removing DC User Pack from the system INI files  */
  580.           /****************************************************/
  581.           if MsgRLang then msg='ôñá½∩Ѽ ºá»¿ß¿ DC User Pack ¿º ß¿ßΓѼ¡δσ INI Σá⌐½«ó'
  582.           else msg='Removing DC User Pack records from the system INI files'
  583.           call CharOut ,Grey_color'    'msg'... '
  584.           if SysIni('BOTH','Clipboard Coder','DELETE:')='ERROR:' then
  585.             do
  586.               if MsgRLang then msg='ìÑ󫺼«ª¡« πñ὿Γ∞ ºá»¿ß¿ ¿º ß¿ßΓѼ¡δσ INI Σá⌐½«ó'
  587.               else msg='Removing records from the system INI files failed'
  588.               say; say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  589.               call AbortProg(2)
  590.             end
  591.           else
  592.             do
  593.               call SysSleep VisualDelay
  594.               say White_color'Ok.'
  595.             end
  596.  
  597.           /****************************************************/
  598.           /* Removing DC User Pack relative DLLs              */
  599.           /****************************************************/
  600.           if MsgRLang then msg='ôñá½∩Ѽ ßó∩ºá¡¡δÑ ß DC User Pack DLL-¬¿'
  601.           else msg='Removing DC User Pack relative DLLs'
  602.           call CharOut ,Grey_color'    'msg'... '
  603.           parse value SysCurPos() with Oldrow Oldcol
  604.           say; call RemoveDLL
  605.           call SysCurPos Oldrow,Oldcol
  606.           say White_color'Ok.'
  607.  
  608.           /****************************************************/
  609.           /* Removing DC User Pack files                      */
  610.           /****************************************************/
  611.           if MsgRLang then msg='ôñá½∩Ѽ Σá⌐½δ DC User Pack'
  612.           else msg='Removing DC User Pack files'
  613.           call CharOut ,Grey_color'    'msg'... '
  614.           call SysFileTree '*','file','FOS'
  615.           do i=1 to file.0
  616.             if SysFileDelete(file.i)\=0 then
  617.               do
  618.                 if MsgRLang then msg='ìÑ󫺼«ª¡« πñ὿Γ∞ Σá⌐½δ DC User Pack'
  619.                 else msg='DC User Pack files removing failed'
  620.                 say; say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  621.                 call AbortProg(2)
  622.               end
  623.           end
  624.           call SysSleep VisualDelay
  625.           say White_color'Ok.'
  626.  
  627.           /****************************************************/
  628.           /* Removing DC User Pack directories                */
  629.           /****************************************************/
  630.           if MsgRLang then msg='ôñá½∩Ѽ ñ¿αÑ¬Γ«α¿¿ DC User Pack'
  631.           else msg='Removing DC User Pack directories'
  632.           call CharOut ,Grey_color'    'msg'... '
  633.           if SysRmDir(PluginDir)\=0 then
  634.             do
  635.               if MsgRLang then msg='ìÑ󫺼«ª¡« πñ὿Γ∞ ñ¿αÑ¬Γ«α¿ε »½πú¿¡«ó'
  636.               else msg='Can`t remove plugin directory'
  637.               say; say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  638.               call AbortProg(2)
  639.             end
  640.           currentDCdir=Directory()
  641.           call Directory '..'
  642.           if SysRmDir(currentDCdir)\=0 then
  643.             do
  644.               if MsgRLang then msg='ìÑ󫺼«ª¡« πñ὿Γ∞ ñ¿αÑ¬Γ«α¿ε DC User Pack'
  645.               else msg='Can`t remove DC User Pack directory'
  646.               say; say Red_color'    'ErrorMsg.MsgRLang''Yellow_color''msg'!'
  647.               call AbortProg(2)
  648.             end
  649.           call SysSleep VisualDelay
  650.           say White_color'Ok.'
  651.           if MsgRLang then msg='Åα«µÑßß ñÑ¿¡ßΓá½½∩µ¿¿ πß»ÑΦ¡« ºáóÑαΦÑ¡'
  652.           else msg='Uninstallation process successfully completed'
  653.           say Green_color'  'msg'!'
  654.         end
  655.     end
  656.   else
  657.     do
  658.       if MsgRLang then msg='ä¿ßΓα¿íπΓ¿ó ¡Ñ »«½«¡'
  659.       else msg='The distributive is not full'
  660.       say; say Red_color''msg'!!!'White_color
  661.       call AbortProg(1)
  662.     end
  663.  
  664. if MsgRLang then msg='éδ»«½¡Ñ¡«'
  665. else msg='Done'
  666. say; say Green_color''msg'.'White_color
  667. call PressAnyKey
  668. exit
  669.  
  670.  
  671.  
  672. /**************************************************************/
  673. /* Procedures                                                 */
  674. /**************************************************************/
  675.  
  676. RemoveDLL:
  677. call SysFileSearch 'LIBPATH',BootDrv'\CONFIG.SYS','file'
  678. s=Translate(Translate(file.1,' ',';'))
  679. parse var s 'LIBPATH='s
  680. if MsgRLang then msg='ôñá½∩Ѽ'
  681. else msg='Removing'
  682. do i=1 to Words(s)
  683.   SysLibPath=Word(s,i)
  684.   if Right(SysLibPath,1)\='\' then SysLibPath=SysLibPath'\'
  685.   do j=1 to DllFilesCount
  686.     if Stream(SysLibPath''DllFile.j,'c','query exists')\='' & SysLibPath\='.\' then
  687.       do
  688.         say Grey_color'      'msg' 'Yellow_color''SysLibPath''DllFile.j''Grey_color'...'
  689.         call SysFileDelete SysLibPath''DllFile.j
  690.         call SysSleep VisualDelay
  691.         call ClearPrevLine
  692.       end
  693.   end
  694.   do j=1 to ComDllFilesCount
  695.     if Stream(SysLibPath''ComDllFile.j,'c','query exists')\='' & SysLibPath\='.\' then
  696.       do
  697.         say Grey_color'      'msg' 'Yellow_color''SysLibPath''ComDllFile.j''Grey_color'...'
  698.         call SysFileDelete SysLibPath''ComDllFile.j
  699.         call SysSleep VisualDelay
  700.         call ClearPrevLine
  701.       end
  702.   end
  703. end
  704. return
  705.  
  706. ClearPrevLine:
  707. parse value SysCurPos() with row col
  708. call SysCurPos row-1,0
  709. say Copies(' ',79)
  710. call SysCurPos row-1,0
  711. return
  712.  
  713. AskYN:
  714. do forever
  715.   Key=SysGetKey('NOECHO')
  716.   Key=Translate(Key)
  717.   if Key='Y' | Key='N' | Key=d2c(13) then
  718.     do
  719.       if Key='Y' | (Key=d2c(13) & Arg(1)) then
  720.         do
  721.           reply=1; Key='y'
  722.         end
  723.       if Key='N' | (Key=d2c(13) & \Arg(1)) then
  724.         do
  725.           reply=0; Key='n'
  726.         end
  727.       call CharOut ,Key
  728.       leave
  729.     end
  730. end
  731. say
  732. return reply
  733.  
  734. PressAnyKey:
  735. say Esc'0;37m'
  736. call SysCurState 'OFF'
  737. if MsgRLang then msg='ì᪼¿ΓÑ ½εíπε ¬½áó¿Φπ'
  738. else msg='Press any key'
  739. call CharOut ,msg'...'
  740. call SysGetKey('NOECHO')
  741. call SysCurState 'ON'
  742. return
  743.  
  744. AbortProg:
  745. say
  746. if MsgRLang then
  747.   do
  748.     if Arg(1) then msg=''
  749.     else msg='ñÑ'
  750.     say Red_color'Åα«µÑßß 'msg'¿¡ßΓá½½∩µ¿¿ »αÑαóá¡.'
  751.   end
  752. else
  753.   do
  754.     if Arg(1) then Prefix='I'
  755.     else Prefix='Uni'
  756.     say Red_color''Prefix'nstallation process aborted.'
  757.   end
  758. call PressAnyKey
  759. exit
  760.  
  761. EmxRevision: procedure
  762.   arg pathname
  763.   call RxFuncAdd emx_revision, pathname, emx_revision
  764.   signal on syntax name EmxError
  765.   tmp = emx_revision()
  766.   signal off syntax
  767.   call RxFuncDrop emx_revision
  768.   return tmp
  769.  
  770. EmxError:
  771.   return 0
  772.