home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / 049 / misc / instl049_lite.cmd < prev    next >
OS/2 REXX Batch file  |  2002-07-15  |  5KB  |  181 lines

  1. /*
  2.     Create eWorkplace installation objects
  3.     German version (049)
  4.     (C) 1998-2000 Ulrich Möller.
  5.  */
  6.  
  7. /* change the following language code to your language. */
  8. LanguageCode = "049";
  9.  
  10. /* Here come the titles of the objects to be created.
  11.    Translate these to your language. */
  12.  
  13. XWorkplace          = "eCS";
  14. OS2                 = "eCS"
  15.  
  16. WorkplaceShell      = "Workplace Shell";
  17. Screen              = "Bildschirm";
  18. String              = "Konfigurationsstring";
  19. FontFolder          = "Schriftarten";
  20. TrashCan            = "Papierkorb";
  21.  
  22. Lockup              = "Sperren";
  23. FindObjects         = "Suchen";
  24. Shutdown            = "Systemabschluß";
  25.  
  26. /*********************************************
  27.  *
  28.  *  NLS-independent portion
  29.  *
  30.  *  Note: All of this was rewritten with V0.9.19,
  31.  *  but the NLS part above is unchanged. Just copy
  32.  *  the entire chunk below from instl001.cmd to your
  33.  *  translated file, and it should still work.
  34.  *
  35.  ********************************************/
  36.  
  37. call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  38. call SysLoadFuncs
  39.  
  40. parse source dir;
  41. parse var dir x1 x2 dir;
  42. dir = filespec("D", dir)||filespec("P", dir);
  43. pdir = left(dir, length(dir)-8);
  44. idir = dir;
  45. dir = pdir||"bin\";
  46.  
  47. HelpLibrary = "HELPLIBRARY="pdir||"\help\xfldr"LanguageCode".hlp;"
  48.  
  49. /* "Fonts" folder  */
  50. class = "XWPFontFolder";
  51. title = FontFolder;
  52. setup = "DEFAULTVIEW=DETAILS;DETAILSCLASS=XWPFontObject;SORTCLASS=XWPFontObject;"
  53. id = "<XWP_FONTFOLDER>"
  54. target = "<WP_CONFIG>";
  55. call CreateObject;
  56.  
  57. /* create "Workplace Shell" */
  58. class = "XFldWPS";
  59. title = WorkplaceShell;
  60. setup = "";
  61. id = "<XWP_WPS>";
  62. target = "<WP_CONFIG>";
  63. call CreateObject;
  64.  
  65. /* create "Screen" */
  66. class = "XWPScreen";
  67. title = Screen;
  68. setup = "";
  69. id = "<XWP_SCREEN>";
  70. target = "<WP_CONFIG>";
  71. call CreateObject;
  72.  
  73. /* create "Setup String" template in Templates folder */
  74. class = "XWPString";
  75. title = String;
  76. setup = "TEMPLATE=YES;"
  77. id = "<XWP_STRINGTPL>";
  78. target = "<WP_TEMPS>";
  79. call CreateObject;
  80.  
  81. /* create trash can on desktop */
  82. class = "XWPTrashCan";
  83. title = TrashCan;
  84. setup = "DEFAULTVIEW=DETAILS;ALWAYSSORT=YES;DETAILSCLASS=XWPTrashObject;SORTCLASS=XWPTrashObject;"
  85. id = "<XWP_TRASHCAN>";
  86. target = "<WP_DESKTOP>";
  87. call CreateObject;
  88.  
  89. /* the following three added with V0.9.19
  90.    and redone with V0.9.20 */
  91. commonXWPString = "DEFAULTOBJECT=<WP_DESKTOP>;CONFIRMINVOCATION=NO;NOSTRINGPAGE=YES;HELPLIBRARY=WPHELP.HLP;HELPPANEL="
  92.  
  93. /* create "Lockup" setup string object */
  94. class = "XWPString";
  95. title = Lockup;
  96. setup = "SETUPSTRING=MENUITEMSELECTED%3D705%3B;"commonXWPString"=8004;ICONRESOURCE=78,PMWP;"
  97. id = "<XWP_LOCKUPSTR>"
  98. target = "<WP_NOWHERE>";
  99. call CreateObject;
  100.  
  101. /* create "Find objects" setup string object */
  102. class = "XWPString";
  103. title = FindObjects;
  104. setup = "SETUPSTRING=MENUITEMSELECTED%3D8%3B;"commonXWPString"=1205;ICONRESOURCE=79,PMWP;";
  105. id = "<XWP_FINDSTR>";
  106. target = "<WP_NOWHERE>";
  107. call CreateObject;
  108.  
  109. /* create "Shutdown" setup string object */
  110. /* setup string modified to use POSTSHUTDOWN=YES V0.9.20 */
  111. class = "XWPString";
  112. title = Shutdown;
  113. setup = "SETUPSTRING=POSTSHUTDOWN%3DYES%3B;"commonXWPString"=4001;ICONRESOURCE=80,PMWP;"
  114. id = "<XWP_SHUTDOWNSTR>";
  115. target = "<WP_NOWHERE>";
  116. call CreateObject;
  117.  
  118. /* create eCenter in eCS "Utilities" folder */
  119. class = "XCenter";
  120. title = "eCenter";
  121. setup = "";
  122. id = "<XWP_XCENTER>"
  123. target = "<WP_TOOLS>";
  124. call CreateObject;
  125.  
  126. "@call "idir"crobj"LanguageCode
  127.  
  128. exit;
  129.  
  130.  
  131. CreateObject:
  132.     len = length(id);
  133.     if (len == 0) then do
  134.         Say 'Error with object "'title'": object ID not given.';
  135.         exit;
  136.     end
  137.  
  138.     if (left(id, 1) \= '<') then do
  139.         Say 'Error with object "'title'": object ID does not start with "<".';
  140.         exit;
  141.     end
  142.  
  143.     if (right(id, 1) \= '>') then do
  144.         Say 'Error with object "'title'": object ID does not end with ">".';
  145.         exit;
  146.     end
  147.  
  148.     len = length(setup);
  149.     if ((len > 0) & (right(setup, 1) \= ';')) then do
  150.         Say 'Error with object "'title'": Setup string "'setup'" does not end in semicolon.';
  151.         exit;
  152.     end
  153.     call charout , 'Creating "'title'" of class "'class'", setup "'setup'"... '
  154.     rc = SysCreateObject(class, title, target, setup"TITLE="title";OBJECTID="id";", "U");
  155.     if (\rc) then do
  156.         rc = SysCreateObject(class, title, "<WP_DESKTOP>", setup"TITLE="title";OBJECTID="id";", "U");
  157.     end;
  158.     if (\rc) then do
  159.         Say 'Warning: object "'title'" of class "'class'" could not be created.'
  160.     end
  161.     else do
  162.         Say "OK"
  163.     end
  164.  
  165.     id = "";
  166.  
  167.     return;
  168.  
  169. CreateObjectWithShadow:
  170.     idOld = id;
  171.     call CreateObject;
  172.  
  173.     class = "WPShadow";
  174.     setup = "SHADOWID="idOld";"
  175.     id = idOfShadow;
  176.     target = "<XWP_MAINFLDR>";
  177.  
  178.     call CreateObject;
  179.  
  180.     return;
  181.