The 'Windows Help' system

Running EF2000 on modern systems!
Post Reply
mikew
Data Genius
Posts: 559
Joined: 2022-Jan-09, 20:21

The 'Windows Help' system

Post by mikew »

While EF2000 Reloaded is mainly aimed at 3dFX DOS version, the Windows 95 version 'Super EF2000' used the Windows help system to provide a nice 'online' help window.
Unfortunately, this no longer works on Window10, and clicking on it has no effect.
efr_help.png
efr_help.png (176.19 KiB) Viewed 2984 times
The information is held in a file called 'super_ef.hlp' which is no longer supported.

What can be done is to use the 'helpdeco' tool available here:
https://www.oocities.org/mwinterhoff/helpdeco.htm
..to dissect the .hlp file into its component parts and produce a project file compatible with the Windows compressed HTML generation tool available here:
https://docs.microsoft.com/en-us/previo ... -downloads

Using this, a 'super_ef.chm' file can be created, and the help information is visible once more. This is also 1990's technology though, so not a long term solution.
efrchm.PNG
efrchm.PNG (34.31 KiB) Viewed 2984 times
User avatar
Krishty
Site Admin
Posts: 1271
Joined: 2022-Jan-09, 00:59

Re: The 'Windows Help' system

Post by Krishty »

Excellent! Does EF2000 look for a CHM file specifically or did you just replace the HLP file with the CHM version of the exact same name?
mikew
Data Genius
Posts: 559
Joined: 2022-Jan-09, 20:21

Re: The 'Windows Help' system

Post by mikew »

Super EF2000 (and EF2000 Reloaded) use the .hlp file. I've converted to .chm but haven't tried integrating it with EF2000 Reloaded, so it's completely standalone.

But there's a problem in that the .shg files that have 'hotspots' don't work at all. This is the first thing you see when you open super_ef.chm:
efrchm1.PNG
efrchm1.PNG (74.9 KiB) Viewed 2978 times
But clicking on the picture doesn't do anything. The .shg file (in this case bm0.shg) can be converted to a gif and some html using some commercial SW, that I'm using a trial of.
efrchm2.png
efrchm2.png (67.35 KiB) Viewed 2978 times
Going HTML might be the best bet, since .chm probably won't be supported for much longer, and standalone browsers are quite common these days. :)
Maybe a lot of effort though...
User avatar
Krishty
Site Admin
Posts: 1271
Joined: 2022-Jan-09, 00:59

Re: The 'Windows Help' system

Post by Krishty »

Oh I get it now!

Wow, those clickable areas are something rare. What a pity they aren’t well-supported!

You can totally do this with HTML image maps. No JavaScript etc. required, and full browser support: https://www.w3schools.com/html/html_images_imagemap.asp

Indeed, going to HTML would be the best option. It would also improve our workflow drastically, as replacing images or changing text becomes literally opening a single file and doing the change directly. But it requires thorough planning, e.g. for having correct navigation bars on all pages.
mikew
Data Genius
Posts: 559
Joined: 2022-Jan-09, 20:21

Re: The 'Windows Help' system

Post by mikew »

Yes, that's what that conversion SW is doing:
efrhtml.PNG
efrhtml.PNG (20.57 KiB) Viewed 2973 times
The problem as I see it, is that we don't know exactly which html file extracted from the .hlp file is the destination of those hotspot links as they are given made-up names.
User avatar
Krishty
Site Admin
Posts: 1271
Joined: 2022-Jan-09, 00:59

Re: The 'Windows Help' system

Post by Krishty »

I get it now. This may be related to the problem of the game internally using integers to identify chapters, while CHM does not seem to support anything like that (instead relying on strings).
mikew
Data Genius
Posts: 559
Joined: 2022-Jan-09, 20:21

Re: The 'Windows Help' system

Post by mikew »

Yes, the .hlp file is compiled in what was intended to be a one way process.
The .chm can at least be decompiled.
With some tricks, Win10 can be made to run the .hlp reader, so I can see what super_ef.hlp originally looked like and compare it with the .chm version. While I'm at it, I might as well repeat the process for ADF and TAW which also used the Win95 help system.
In the picture, the upper row is .hlp, the lower .chm:
helps.PNG
helps.PNG (78.98 KiB) Viewed 2963 times
The .chm work quite well, but the lack of .shg file handling is a big problem, particularly for EF2000, which uses them extensively.

This site goes onto more detail, and it seems things can be done to improve matters if one is prepared to put in the effort.
https://www.help-info.de/de/Help_Info_W ... erting.htm
...and probably even more useful if you can read German. :)
User avatar
Krishty
Site Admin
Posts: 1271
Joined: 2022-Jan-09, 00:59

Re: The 'Windows Help' system

Post by Krishty »

Sorry, I’m lagging a few steps behind!
mikew wrote: 2022-Jul-30, 18:19the Windows compressed HTML generation tool available here:
https://docs.microsoft.com/en-us/previo ... -downloads
This is great. Not the tool or the broken link specifically, but it can be automated! This means you can add the HTML files to source control rather than the CHM blob, and can add it to the normal build process. Here’s how for later reference:

Adding a CHM to Your Build Process

Download Microsoft HTML Help Workshop. The official link is broken because the program hasn’t been maintained since 1999 or so, but there are other sources on the internet.

Verify the publisher. Since Microsoft being a pile of shit forced you to download the setup from shady sites, you want to make sure it’s not a virus. Microsoft at least used code signing, so right-click htmlhelp.exe > Properties > Digital Signatures. It should be signed by Microsoft (with MD5, LOL).

Open htmlhelp.exe with 7-Zip. This allows you to extract individual files without installing the whole thing. If you have 7-Zip installed, right-click htmlhelp.exe and choose 7-Zip > Open archive.

Extract hha.dll and hhc.exe. You can drag & drop them from the 7-Zip File Manager to anywhere you like.
image.png
image.png (5.13 KiB) Viewed 2960 times
These are the only files you need to run the CHM compiler; no setup required. Actually, you also need to extract itcc.dll and run regsvr32 itcc.dll from an administrator command prompt. Else, you’ll eventually get:

  HHC6003: Error: The file Itircl.dll has not been registered correctly.

Sorry.

Use a wrapper script. hhc.exe seems to have been written by a twelve year old. Make it less worse by placing the following batch script as hhc.cmd in the same directory:

Code: Select all

@echo off

rem  This script wraps the Microsoft HTML Help Compiler, which has a *terrible* interface:
rem    1. on success, it returns 1 instead of 0
rem    2. you cannot specify an output directory or name; it always compiles to the same directory and same name as your project file
rem    3. it has no “quiet” switch and does not separate stderr from stdout

"%~dp0hhc.exe" %1
if %errorlevel% NEQ 1 exit /B 1

move /y "%~dpn1.chm" %2 >nul
Call it from your build system. To compile the project file foo/bar.hhp to buz/lol.chm, call hhc.cmd foo/bar.hhp buz/lol.chm. Use quotation marks where necessary. It returns zero on success, which is compatible with Make/Ninja and all other build systems.

A sample Ninja rule may look like this:

Code: Select all

# Compiles a Microsoft HTML Help project to Compiled HTML Help (CHM).
rule hhp
  command = cmd.exe /c "hhc.cmd ${in} ${out}"
  description = compiling HTML help ${out} ...
…
build f22help.chm : hhp ADF/HELP/f22help.hhp | ADF/HELP/f22help.hhc ADF/HELP/f22help.hhk
User avatar
Krishty
Site Admin
Posts: 1271
Joined: 2022-Jan-09, 00:59

Re: The 'Windows Help' system

Post by Krishty »

mikew wrote: 2022-Jul-31, 19:56This site goes onto more detail, and it seems things can be done to improve matters if one is prepared to put in the effort.
https://www.help-info.de/de/Help_Info_W ... erting.htm
...and probably even more useful if you can read German. :)
Well, only the introduction is in German :)

If we put in that much effort, I recommend we just fix the HTML manually and go for a HTML-based solution.

Maybe compare the decompiled output of a few tools to choose the one that throws away the least information.

Here’s a few ADF help problems for reference:
Broken text flow around image.
Broken text flow around image.
image.png (26.5 KiB) Viewed 2956 times
Missing images in several places
Missing images in several places
image.png (8.71 KiB) Viewed 2956 times

The missing images may hit hard because we can’t access their sources. Or maybe if it’s just bullet points or question marks it doesn’t matter because we can solve it better in HTML anyway …
mikew
Data Genius
Posts: 559
Joined: 2022-Jan-09, 20:21

Re: The 'Windows Help' system

Post by mikew »

Sorry, I’m lagging a few steps behind!
I'd say you've caught up. :D

That missing image is the Windows logo, so no great loss.

Hardly any of the formatting from the original .hlp file is preserved..,
msadf.PNG
msadf.PNG (18.09 KiB) Viewed 2953 times
Post Reply