RoboHelp: batch automation (rhcl.exe)
Although it doesn’t seem to be too well-known, the command line version of RoboHelp can be extremely useful for automating help builds partially or completely.
What is rhcl.exe?
The name of the utility stands for RoboHelp Command Line and enables you to generate an SSL without opening RoboHelp itself. For small documentation systems, there’s not much effort in double-clicking an .xpj, but if you have 20 modules, you might be spending more time waiting for the modules to load than actually building the help… and this is where rhcl comes in.
How is it used?
Very simply, because it only has a few parameters (which I won’t go over, because they are available in Adobe’s documentation.) A command line could look like:
rhcl c:\sources\project1\project1.xpj -l WebHelp -o c:\builds\project1
In translation, first you have the name of the executable, then (without any parameter) the path where the xpj of the project you want to generate is located, then (with the parameter -l) the name of the layout to generate, and finally (with the parameter -o) the location where the files should be generated. For what I need at work, these parameters are enough. If you want, you can also use rhcl to publish a layout (using the option -p) or to generate logs (using the option -g), but I haven’t worked with either of these a lot. My batch looks something like this:
Tips & tricks/Troubleshooting
- If your command lines start with rhcl, the .bat file needs to be saved in the same folder as rhcl.exe. If, instead of simply rhcl, you use the absolute path to the executable (for example C:\Program Files (x86)\Adobe\Adobe RoboHelp 2015\RoboHTML\rhcl.exe), you can save the .bat file anywhere on your hard drive.
- If the path contains spaces, it needs to be between double quotes.
- rhcl is probably not very high on Adobe’s priority list, so it is not always properly tested. In RoboHelp 2015, if you tried to generate the help using rhcl and you had conditional build tags excluded from the SSL, the output was not correct (all tagged content was excluded, even if it appeared included in the SSL settings). The bug was fixed in update 2.
- Some modules refuse to be generated by batch, without any obvious reason. I don’t have a solution for this, other than generating the module manually (from the RoboHelp interface).
- In RoboHelp 2015, if you can’t generate anything by batch, install the KB2758694 and KB954430 Microsoft updates.