home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / suite.zip / dshield.zip / Rebuild.cmd < prev    next >
OS/2 REXX Batch file  |  2000-01-13  |  3KB  |  89 lines

  1. /* Run this script to set up the desktop    */
  2. /* object for Data Shield and an object     */
  3. /* to change skins from                     */
  4. /*                                          */
  5. /*                                          */
  6. /* When adding new skins you may add to     */
  7. /* this objects parameters                  */
  8. /*                                          */
  9. /* Run this from the Data Shield directory  */
  10. /*                                          */
  11.  
  12. /* Prerequisites for the desktop object     */
  13. /* and this cmd file                        */
  14. crlf    ='0d0a'x
  15. exe    ='dshield.exe'
  16. Title    ='Data Shield'
  17.  
  18. /* Load RexxUtil DLL                        */
  19. call RxFuncAdd 'SysLoadFuncs' , RexxUtil, 'SysLoadFuncs'
  20. call SysLoadFuncs
  21. Call SysCls
  22.  
  23. say crlf crlf
  24. say 'This script sets up the desktop object for '||Title
  25. say 'and an object to change skins from the WorkPlaceShell'||crlf
  26. say 'Be sure you have unzipped the skins archive so the directories are'
  27. say 'created directly under the Data Shield directory.'||crlf crlf
  28.  
  29. say 'Press [Y] to continue or [Enter] to quit'||crlf
  30. pull approval
  31. if approval <> 'Y' then exit
  32. say crlf
  33.  
  34. /* Are we in the right program directory?   */
  35. say 'Locating '||exe||'...'||crlf
  36. TestFor=directory()||'\'||exe
  37. CALL SysFileTree TestFor,'List','FO'
  38. if List.0 = 0 then do
  39.    say 'Please run this program from the same directory as the '||exe||' file'||crlf
  40.    say 'Exiting...'||crlf
  41.    exit
  42. end
  43.  
  44. CALL SysFileTree directory()||'\skins\','List','DO'
  45. if List.0 = 0 then do
  46.    say 'You must have a '||directory()||'\Skins'||' directory and'
  47.    say 'it must have directories created under it with skin bitmaps in them.'||crlf
  48.    say 'Exiting...'||crlf
  49.    exit
  50. end
  51. else do
  52.    SkinList = ''
  53.    do index = 1 to List.0
  54.       value = right(List.index,length(List.index)-LASTPOS('\',List.index))
  55.       if translate(value) <> 'DEFAULT' then SkinList = SkinList||' '||value
  56.    end
  57. end
  58.  
  59. /* Create the desktop object                */
  60. Title    ='Data Shield'
  61. Setup    ='OBJECTID=<DATASHIELD>;'||,
  62.           'EXENAME=' || Directory() || '\' || exe || ';' ||,
  63.           'STARTUPDIR=' || Directory() || ';' ||,
  64.           'PROGTYPE=PM;'
  65.  
  66. call SysCreateObject "WPProgram", Title, "<WP_DESKTOP>", Setup, 'Update'
  67. /* Check if the WPS object was created   */
  68. if rc = 0 then
  69.    say 'Object creation for 'Title ' failed!  rc='
  70. else
  71.    say 'Object created for' Title
  72.  
  73. /* Create the desktop object                */
  74. Title    ='Data Shield Skins'
  75. Setup    ='OBJECTID=<DS_SKIN>;'||,
  76.           'EXENAME=' || Directory() || '\Skin.cmd;' ||,
  77.           'STARTUPDIR=' || Directory() || ';' ||,
  78.           'PARAMETERS=' || '[Choices:'||SkinList||'];' ||,
  79.           'MINIMIZED=YES;' ||,
  80.           'PROGTYPE=WINDOWABLEVIO;'
  81.  
  82. call SysCreateObject "WPProgram", Title, "<WP_DESKTOP>", Setup, 'Update'
  83. /* Check if the WPS object was created   */
  84. if rc = 0 then
  85.    say 'Object creation for 'Title ' failed!  rc='rc||crlf crlf
  86. else
  87.    say 'Object created for' Title||crlf crlf
  88.  
  89.