how to edit an html file inside chm file in python - chm

I am working on a chm project. Is there a way to open and edit with Python (or other way but I prefer Python) the HTML compiled in the chm files so it can be updated without recompile?
I have tried the chm and chmlib in Python with no luck. I am trying to find a way to edit existed chm file. Any suggestions?

No solution but to decompile the CHM, make the modifications and recompile.
Depending on the complexity of the CHM file, it might be better to reuse the original sources, not the compiled CHM, since a decompilation-recompilation step with free tools won't always recreate the same CHM.
There are various decompilers, but only two freely available compilers, one by Microsoft, and one by the Free Pascal Team. (use for e.g. Preshrunk Cotton python project and in some distributions.)
You could also investigate some commercial tools. They probably do a better job than the open source decompilers.

Related

Converting .exe to VS solution file / project

I've recently had an issue at work where I have lost my solution files to my projects, but I still have the executables that have been produced by the projects / solution. It has been collection of 50+ webforms.
I have tried some de-compiler tools like ILSpy, JustComplie and .Net Reflector but everything gives source code in different format (not originally written by me) and also not designs of forms.
Is there any possibility to decompiling the executable back into a solution/project file?
I don't think that you can actually decompile the executables to a solution structure as seen on VS.
Although you can decompile the executable files (there are decompilers on the net that can perofrm the operation for you - only the decompilation),
you need to re-create the solution manually and add the source files you have retrieved from the previous operation.
Furthermore, if your files were obfuscated this makes it harder for them to be decompiled.
Even if this works, be prepared to do some debugging and check references/dependencies.
There is a Decompiler that works very well for .Net applications called DNSpy.
Here is link to the Project :
https://github.com/0xd4d/dnSpy
After you have decompiled you can start debugging and such from this application.
Hope this help.

adding files to all platforms of a cocos2d-x project

This is a very basic question, but I have not been able to find the answer anywhere.
I just got Cocos 2Dx 3.3, made a new project and built the HelloWorld scene that was generated.
It generated projects for all platforms, but I am currently compiling and running the Mac project using XCode.
I can easily add new files using XCode, but of course it only adds it to my XCode Project. I would have expected a way to automatically modify all projects at once to add files or change compiler settings. I saw that there is a CMake file, probably used for command line compilation, but I cannot find a way to use that to regenerate the projects for all platforms.
Is it possible to automatically add a file to all platforms? Maybe it is possible to modify the template directory os Cocos and use the cocos new command line to recreate the project from scratch?
Or is it better to do all that manually?
Such an automation would imply parsing of a project file, finding list of relevant files and then changing all the dozen of project files. Which is hell of the work.
Even if it was implemented, how would this implementation decide which project file is a main one? (to get filelist from) And if your projects all have different lists of files? This would need merging etc. etc.
For now cocos new only copies files from one place to another. Frankly, Cocos2d-x have much more serious problems to solve, so I don't think this feature will ever be implemented.
However, you could customize project files/folders to your needs to make process of adding files more or less convenient and sometimes even automatic. Here are some clues:
It is easy to change Android and Linux Makefiles so they will pick up all the source files from a specified folder. Just use wildcards. Resource files are picked up by default.
For Visual Studio solutions (Win32, Win8, WinPhone) you could enable "Show all files" to see all files that either added or not. Unfortunately you can only see files down in the folder tree relative to project folder. To see Classes folder, make a symlink (link /j) of a Classes folder near .vcxproj file. You'd better don't copy/move project folder after it. And don't forget to add this linked folder to ignore list of your versioning system, or you will end up with duplicated files. Resource files are picked up by default for Windows projects.
I am not aware of any solution for XCode project, so you basically stuck with manual source file addition. Which is most annoying among all platforms. However it can pick up resource folders with all files.
Anyway, I would be glad if someone would proof me wrong and would write some kind of script to solve this problem (and also to change project name, company id, automatic versioning, etc.). I believe it could be done more or less reliably with, let's say Python and some regex magic. At least until project file formats will change.

Convert HTML or Word to CHM without installation

I would like to convert an HTML file or a Word file (.doc, .docx or .rtf) to a .chm file. I searched for ways of doing this and they all said that I should install a program on my computer. Is there a way of doing this without installing anything (online, with a program initially installed on Windows or with a USB version of a program)? I also accept a CHM editor as long as it doesn't need to be installed. I found a way to open a .html with hh.exe (the program that opens .chm) but as soon as I rename it from help.html to help.chm it doesn't work.
As far as I know the answer is – no. I've seen never an online version or a USB solution for effective HTMLHelp (CHM) compiling.
You can’t rename a foobar.html to foobar.chm and get this working for a single file, because CHM is like a zipped webpage with all files needed inside and some more internal files e.g. for full text search or an index with keywords. Please see snapshot of a special view with FAR HTML below (left side only, navigation pane).
You can't rename from .zip to .chm too, because the internal structure of a CHM file is complicated and you need a compiler for generating CHM's.
Background:
Please note that the proprietary file format is normally generated by MS HH Workshop (hhw.exe). It’s nearly 20 years old und was first shipped with IE4 and Windows 95. It’s deep integrated to the Windows operating system.
The HTML Help compiler is part of MS HTML Help Workshop (HHW.exe). This is a free, very basic authoring system provided by Microsoft and must be installed before any other authoring tool (e.g. such as FAR HTML) can compile to a .chm help file.
HTML Help Workshop (HHW) installer is called HtmlHelp.EXE and contains a copy of the HTML Help Run-time installer (HHUpd.EXE). There are a few Independent Software Vendor (ISV) that install HHA.DLL and itcc.dll separately instead of installing the full MS HH Workshop (htmlhelp.exe). This is generally an OK practice if the ISV knows what they are doing. But there are many problems. ISVs please keep in mind the safest approach is probably to install the full Workshop.
HTML Help is in maintenance mode, which means no new features are expected for either the runtime or the compiler. All mainstream development on HH has stopped – but HTMLHelp (.chm help files) is still recommended as software application help (for offline (local) help).
At the time of writing (announced 1996-Feb) HTMLHelp is the only Microsoft help platform available for general application help. WinHelp is deprecated and no longer ships with the Windows OS. Visual Studio products such as MS Help 2 & Help Viewer only ship with VS.
Here's word2chm.
It converts word docs to chm help files.
https://sourceforge.net/projects/word2chm/
You will need Microsoft's HTML Help Workshop installed for this to work.
Another more robust program is:
https://sourceforge.net/projects/nuhelp/
Requirements of nuhelp:
1) Word 2003, 2007, 2010 or 2013.
2) HTML Help Workshop (included in zip file)
3) .Net 3.5 Client Profile (already on most computers)

html to chm file under linux

I have html files/Directories, I want to convert them to .chm help file, under Linux using command lines at Terminal?
Any help would be appreciated.
The Free Pascal compiler, version 2.4.4 or higher has a CHM compiler for *nix called "chmcmd". I would recommend getting it from version 2.6.0. It works on MSHelp .hhp project files.
The compiler is also available in source (styled like a classes library), so you could roll your own. It is crossplatform, but Big Endian platforms are not tested very well.
2.6.0 is from januari 1st 2012, so you might need to get it from a "bleeding edge" packages repository of your distribution.
CHM is a proprietary Microsoft format, so keep in mind most Open Source tools will likely be focused on reading and converting chm to html . if you want to create CHM file on Linux then you will need a CHM compiler that you can use with wine . details are on the following link Compiling_CHM_help_files_in_Linux_with_HHC_and_Wine
You can do that with libchm, you find it http://www.jedrea.com/chmlib/ .
It contains extract_chmLib, which extracts html pages from the help pages to a directory.

Seeking a compact format for HTML ebooks for offline reading under Linux

I have a netbook running Linux and a large collection of computer books and reference material as HTML. I'd like some compact way of storing these books which can be browed without unpacking them first. This would save space and reduce wear on my small SSD.
If there was some way to convince Firefox to browse files contained in ZIP file, this would be ideal. (I know iCab (Mac) had a web archive format that worked this way.) Perhaps a Firefox plugin? A small web server that can serve directly from ZIP files? Some magic FUSE module? Does anyone have any ideas?
On my PDA (which the netbook is largely replacing) I used iSilo for this, but it's not available for Linux, its conversions are lossy and it costs money.
There is the FUSE zip thing here :
http://code.google.com/p/fuse-zip/
Gvfs should also support zip files.
Calibre might help (convert to a compressed format, manage, view e-books).
You can use OpenOffice.org to open the html pages, and then save them as OO documents. OO documents are essentially a zip files.
Another option is to use OO to save as pdf.
You can even do this from a command line using this OO macro.
Same with AbiWord - you can use it on commandline to convert.
In the AbiWord example there is shown how to convert all files in a directory to a desired format (pdf). Then you can use pdftools to merge all pages in one document.
Also, I do not know what windows manager your laptop has, but if it is KDE, konqueror (the file and web browser for KDE) opens web pages from inside a zip file w/o any problem.
Most probably Gnome's Nautilus can do this as well (I have no Gnome here to test).
Have you ever tried to open a zip file with whatever file manager you have, and then click on a web page inside it?