home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / r2e98204.zip / REXX2EXE.INF (.txt) < prev   
OS/2 Help File  |  1998-07-23  |  7KB  |  169 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Rexx Compiler (REXX2EXE.EXE) ΓòÉΓòÉΓòÉ
  3.  
  4. DESCRIPTION 
  5.  
  6. This program is used to compile rexx ".CMD" files into ".EXE" files so that the 
  7. source is not required.  I have released it as FreeWare although my original 
  8. intention was shareware.  I retain (C)opyright and reserve all rights. 
  9.  
  10. As the source is not required at runtime, you can distribute a binary file 
  11. which you know end users can't modify in any way. 
  12.  
  13. You have the option (which is on by default) to encrypt the compiled rexx so 
  14. that its readability is reduced to zero.  This ensures that not even strings 
  15. can be modified by end users (your copyright for example).  This encryption 
  16. while not simple should not be relied upon to secure highly sensitive 
  17. information, its only meant to deter anyone from modifying or looking at your 
  18. code. Someone extremely keen will crack it if its worth their while... 
  19.  
  20. As another precaution, the produced rexx binary is crc checked. 
  21.  
  22. The rexx compiler can produce either a small dynamically linked ".exe" which 
  23. requires a runtime or a larger statically linked ".exe". The advantage with the 
  24. dynamically linked version is that most of the runtime can be shared between 
  25. multiple compiled rexx programs.  The disadvantage is that the runtime must be 
  26. placed into a directory specified in the libpath (and only one version can be 
  27. active at any time, a major issue). 
  28.  
  29. I suggest that you have a look at the rexx code build program PPWIZARD.EXE 
  30. (available at "http://www.ozemail.com.au/~dbareis". This tool can be used to 
  31. create the source to be compiled to an executable as it gives you much more 
  32. control (#defines, #includes etc). 
  33.  
  34. If you structure your code suitably for the PPWIZARD "/pack" option then your 
  35. resultant EXE should be smaller! 
  36.  
  37. SYNTAX 
  38.  
  39.           REXX2EXE[.EXE]  SourceFile  TargetFile [/C] [/D] [/P] [/2] [/K[:key]]
  40.  
  41.  The "SourceFile" parameter of course specifies the input file while the 
  42.  "TargetFile" specifies the name of the generated rexx executable.  The 
  43.  extensions must be specified as there are no defaults. 
  44.  
  45.  The "/C" parameter tells the compiler to actually tokenise the source code and 
  46.  use the result (as was automatically done in previous versions of REXX2EXE) 
  47.  rather than just attach the source code.  If you move the resultant EXE to a 
  48.  different machine or use "SWITCHRX.CMD", you may find that it will no longer 
  49.  run. 
  50.  
  51.  The "/D" parameter tells the compiler to generate the target as a smaller 
  52.  dynamically linked version which requires the presence of the "REXX2EXE.DLL" 
  53.  support DLL (also generated).  The default is to produce a standalone 
  54.  statically linked program. 
  55.  
  56.  The "/P" parameter tells the compiler to create the EXE file as a PM program. 
  57.  This makes it much easier to utilise PM routines such as "RxMessageBox()". 
  58.  
  59.  The "/2" parameter tells the compiler to generate code in such a way that it 
  60.  will be able to run on OS/2 2.x machines. The default is to produce code which 
  61.  is smaller but will only run on OS/2 Warp version 3.0 onwards. 
  62.  
  63.  The compiler will normally encrypt the rexx code part of the runtime with a 
  64.  fixed key.  If for some reason you don't want the information encrypted then 
  65.  use "/K" (no subparameters).  To encrypt with your own key specify a hex value 
  66.  between 1 & 0xFFFFFFFF, for example "/K:1234". Note that when data is not 
  67.  encrypted it is also not compressed (as this is a form of encryption) so the 
  68.  generated code takes up more space. 
  69.  
  70.  Note that whether code is encrypted or not it is protected by a CRC and can't 
  71.  be altered.  If you specify a key with a value above 0xF0000000 (the default 
  72.  key for example) you will not be able to recovery the code from the 
  73.  executable.  A value of 0 turns off encryption.  You can specify your own 
  74.  default value by setting the environment variable "REXX2EXE_KEY" to a 
  75.  hexadecimal value. 
  76.  
  77.  EXTRACTING CODE FROM GENERATED EXE 
  78.  
  79.  This is not recommended as an archival mechanism, its intended purely as an 
  80.  emergency recovery process.  The process will be of little use if "/C" was 
  81.  specified at compile time as all you will recover is the tokenized rexx object 
  82.  (in a debug situation this could be useful). 
  83.  
  84.  You can only extract code if no key was used or its value was below 
  85.  "0xF0000000", you must also know the value that was used at "compile" time. 
  86.  The default key will create an EXE file from which you won't be able to 
  87.  recover the source.  It is suggested that you set the environment variable 
  88.  "REXX2EXE_KEY" to the value you want in CONFIG.SYS (or a batch file) so you 
  89.  never forget! 
  90.  
  91.  To extract the code you must set an environment variable to the value of the 
  92.  key used at compile time (in hexadecimal).  The name of the variable is the 
  93.  full name of the EXE file.  A file will be generated if the key is correct and 
  94.  below 0xF0000000.  An example follows: 
  95.  
  96.          SET C:\DB\UTILP\1.EXE=ABC123
  97.  
  98.  RESTRICTIONS 
  99.  
  100.  There are a few restrictions with this rexx compiler (with any rexx compiler!) 
  101.  as follows: 
  102.  
  103.        1. The return code from the rexx procedure should be numeric, for 
  104.           example "exit 'An error occurred'" should not be used. 
  105.  
  106.           If a non numeric return code is specified then the runtime support 
  107.           will generate an error message and a specific non-zero error level 
  108.           set, of course the rexx code has completed. 
  109.  
  110.        2. If the "/C" switch was used then you can't use the "SourceLine()" 
  111.           function to obtain the source line (as it doesn't exist)! 
  112.  
  113.        3. While a rexx procedure can delete itself on the fly you can't delete 
  114.           the exe program in the same way (as its in use). 
  115.  
  116.  
  117. ΓòÉΓòÉΓòÉ 2. Change History ΓòÉΓòÉΓòÉ
  118.  
  119. Change History 
  120.  
  121.        1. Version 98.204 
  122.  
  123.               Thanks to some good feedback I have modified the program to 
  124.                produce the EXE as a PM program when "/P" switch is specified. 
  125.  
  126.        2. Version 98.162 
  127.  
  128.               When producing a standalone executable and we would normally 
  129.                compress, don't compress unless the gain in compression at least 
  130.                makes up for the extra code required at runtime to uncompress 
  131.                it. The smallest executable is now smaller by about 10K. 
  132.               It is now possible to extract the code imbedded in the generated 
  133.                code (if key known etc). 
  134.               Can now specify your own default key in the "REXX2EXE_KEY" 
  135.                environment variable. 
  136.  
  137.        3. Version 98.160 
  138.  
  139.               If the resultant EXE takes up less space than the ".CMD" then 
  140.                specify the saving in the summary. 
  141.               Default is now for generation of static code and use of "/D" to 
  142.                generate dynamically linked output. 
  143.               New "/C" option which basically tells REXX2EXE to do what it had 
  144.                always done in previous releases and that is "compile" the code 
  145.                and use the tokenised result.  This is OK in a controlled 
  146.                environment by may fail on machines with different versions of 
  147.                rexx. 
  148.               The REXX2EXE.DLL interfaces version number has changed and is 
  149.                therefore incompatible with older EXEs. 
  150.  
  151.        4. Version 98.091 
  152.  
  153.               No longer require the rexx code to return a value, however if 
  154.                none provided a non-zero value is returned by the generated 
  155.                code. 
  156.  
  157.        5. Version 98.085 
  158.  
  159.               Created a "/2" option to handle way code was generated in 
  160.                previous releases.  The default is now to create code which is 
  161.                packed using the mechanism introduced in OS/2 version 3.0, this 
  162.                code will not run in previous versions of OS/2 (it is quite a 
  163.                bit smaller though!). 
  164.               Minor changes to generated messages. 
  165.  
  166.        6. Version 98.077 
  167.  
  168.               Initial release on my web page. 
  169.