Recompile CHM file - chm

I'm working on a script that should be able to add additional information to a .chm file.
After decompiling it with hh.exe -decompile outputFolder fileName.chm command, I get the html files, and other 2 files with .hhc and .hhk extension.
After editing the html files, I'd like to recompile the files into a single .chm file. I read that that I also need a .hhp file in order to do that, but that's not generated in the decompilation process.
How can I solve this?

This is a problem of Compiled Help Modules (CHM). And yes - you need a *.hhp for compiling again by HTMLHelp Workshop or e.g. FAR HTML.
You know, you can use 7Zip or just open a command prompt window on a Windows PC and type the following:
hh.exe -decompile <target_directory> <path>\<filename>.chm
The only decompiler with any additional features is KeyTools as this can try to rebuild the project (.hhp) file. You'll need this file if you want to recompile the help project.
One thing to note is that the decompile/recompile process isn't a "round-trip" process. Certain features that the help author added to the original help file can't be recovered when you decompile it, so these may no longer work properly after you've recompiled.
This is especially true in the area of context-sensitive help, which may be broken in the new version of the file.
It can be useful, to include the .hhp file itself - after regenerating is done - into the section [FILES] of the project file (.HHP). Thus, this is included in the Compiled Help Module (CHM) when compiling. The appropriate *.HHP file then is decompiled in addition to the other files for future use.

Related

Can I compile with electron-build and keep my html files?

I'm using electron-build to transform a "website" into an "app" and it's pretty awesome! But the compilation process obviously transforms the HTML pages into other types of files.
Is there any compilation option, flag or anything that can allow me to keep the html files and resources so that a curious user can click on index.html and use the app in their favorite web browser?
I havent found anything, so I'm considering simply copy pasting the source files in the output folder, but that's a lot of duplicate data :)
Thanks!

Robohelp: How to reference a .chm file rather than copy it into a merged project?

I am assigning new .CHM files to existing merged projects. You may recognize this dialog:
When I go to assign a (in my case) an existing merged project a new .CHM file, I am presented with this dialog. However, I do not want the .CHM file to be copied in, I want it to reference a .CHM file. This is because I am working on a help project that compiles many other help projects that get changed separately from time to time. This leaves the compilation project out of date if the .CHM files are simply copied in; they're just older copies.
Is there a way to have a merged project point to a .CHM file rather than copy it in so that it reflects outside changes made to the .CHM file?
Thanks!
Someone was very helpful on Adobe forums and posted a video about my question. The short answer is that, as far as I can tell, RH cannot "reference" a file. If you want child projects .CHM files to appear in a master project, you must either copy the files manually, or output from the child project build separately to each directory you would like to have an updated .CHM in.
Here's the vid:
[https://www.youtube.com/watch?v=Q774WbvYd-c&feature=youtu.be][1]

How to create chm file using the directory containing html files

I have a directory containing multiple html files. Need to create chm file using all the html files of the directory.
I am trying to create chm file using chmprocessor.
(downloaded from- http://sourceforge.net/projects/chmprocessor/files/)
I have referred http://chmprocessor.sourceforge.net/ and tried following:
I selected html file using "Add file" under Source Files tab. And selected the directory using "Add directory" under additional files tab. But it didn't worked.
Could any one please suggest the steps to create chm file using the directory containing html files?
I have also tried using HTML Help Workshop, but this tool does not provide the capability to directly create chm file by selecting the directory containing html files.
This is really annoying - after installing chmProcessor I have given the tool a longer try and the chmProcessor for (good structered) Word files (*.doc) is really working good.
But testing for HTML with the one selected HTML at 'Source files' makes me crazy as a former Microsoft Help MVP. Only linked files are included in the CHM I added with "Add Directory".
I put a 'Change Request' for more documentation about 'Source files' to SourceForge where you may download my test sample and some snaps of things I tried:
http://sourceforge.net/p/chmprocessor/bugs/29/
HTMLHelp Workshop has a learn curve and creating Table of Contents (TOC) needs a fairly long time.
So, one more thought: You may have your HTML files in a web structure with sub-directories. A tool I have experience with is FAR HTML. Using the Help Wizard makes a CHM in some minutes. These is shown in a Video I uploaded for you. Give it a try - it's free with full working functions for some weeks.
http://www.help-info.de/files_share/VideoCreateChmHelpFilesWithFAR-HTML.mp4

CHM file unreadble if saved to hdd

I've just downloaded JSon.Net for framework 4.0 as a zip file.
Opening zip (using WinRar) I'm able to open Documentation.chm file by double-clicking over the name listed and the help file is well done.
Anyway if I extract this file to hdd and I open it, help is unreadable.
Sounds silly, but it's happening.
Thanks for your help!!!
EDITED:
Another tip: unreadble chm file is located in D:\.... (second NTFS partition of first hdd); if I save it on my desktop, chm file becomes readable !!! Crazy...
------------------------------------
---------- SOLUTION ----------
------------------------------------
I answer my question to close it and to help someone who finds in my same trouble.
Using tip suggested by #Marco van de Voort I searched Google for "chm unblock" and found this link:
Your CHM files are stored in the folder with '#' (hash) character in
the path Many C# developers discovered that their documentation
and e-books in CHM format cannot be read because they were storing
their CHM files in the directories like 'C:\E-books\C#\'. The hash
character signifies an anchor in HTML so the CHM viewer fails to
resolve the path properly and to retrieve the content.
That was my problem: I had path with a #... and I'd never thought this could be a great mess for CHM files!!!
Thanks to SO mates for the help given !!
Windows keeps track of downloaded files on NTFS systems, and puts certain restrictions on them. If you extract with windows explorer, this status propagates from archive to file. Using a third party tool (winrar in your case, I use INFO zip) can circumvent this.
Some descriptions and other links can be found
http://wiki.lazarus.freepascal.org/chm_backend_for_fpdoc#Troubleshooting
Free Pascal (2.4.4) has some tool to unlock them. (chmls unblock). It is done by truncating an alternate filestream (therefore it only works with NTFS). I found this info somewhere on stackoverflow, but can't quickly find the link.
It might be that virtual folders like desktop don't fully support this.
maybe the references to some content is to web or no chm file. maybe if you can disassamble in CHM editor and change paths can fix it.
maybe this can help you
There are security permissions applied to this file type by a recent patch.
you need to unblock the file:
http://www.helpscribble.com/chmnetwork.html
instead of thinking many possibilities of "windows security permission", get a CHM reader or wrap your CHM using winrar, and doubleclick to view it like you did.
It's save your time a lot!!
So, two simple solutions are:
have a CHM reader: https://blog.kowalczyk.info/articles/chm-reader-viewer-for-windows.html
OR right click CHM file/s, > Add to RAR Archive.
If you want to read it, double click RAR file > double click CHM file. BINGO!!

How to extract hhp file from a chm file

I have an A.chm file for my windows application which runs as expected.
When I decompile it using HTML workshop I get set of html files, .hhc file, .hhk file. When I compile another file B.chm from these extracted files without changing any of the files.((I want to add more html contents to this file but looks like I am losing some information after decompiling)) The output file I get is 72K where as the original file was 75K. B.chm's contents look all file when viewed in the chm viewer but the behavior is lost when when used with the application.
After reading around I found that if .hhp can be extracted from a .chm file then it can be re-constructed as it is without losing any mapping or aliases. Is that true?
How can I extract .hhp file from a .chm file?
Thanks,
Sam
No, Yes , and no.
The original hhp can't be guaranteed extracted
however since chm is an archive type, the project could have added all project files to the archive. I assume you already would have found them if that were the case.
If the decompile process does its administration, it can regenerate the .hhp to a certain degree.
Comments and #define names will probably be lost though, maybe more, but that should not result in problems when recompiling.
But of course it could be that the decompiler is limited. You could try some other (search for something from "keytools").
If not, then take "chmlib" and start drilling down into the format.