NO

Author Topic: TLWHViewRE alpha  (Read 2959 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1996
TLWHViewRE alpha
« on: June 16, 2018, 08:18:28 pm »
TLWHViewRE is under development, it use richedit/msftedit.dll as viewer.

An example for a test:
Code: [Select]
SET MSHC_PATH=C:\code\MSDN-2016\msh
IndexWHelp.exe %MSHC_PATH%
echo [mshc]>TLWHViewRE.ini
echo Path=%MSHC_PATH%>>TLWHViewRE.ini
echo [mshc]>TLWHViewRE64.ini
echo Path=%MSHC_PATH%>>TLWHViewRE64.ini
TLWHViewRE.exe /Sleep
pause
HelpView.ini, in AddIns64 folder
Code: [Select]
[Settings]
Program=C:\code\bin64\TLWHViewRE64.exe

In here is enough files to test.

EDIT: 2018-09-15 a test version for latest help using title as keyword when F1 keys are missing.
EDIT: 2018-09-28 keyword parser fix.
EDIT: 2018-10-03: now use mshi with single file, if available in same folder.
EDIT: 2018-10-07: TLWHViewRE-2018-10-07_bin.zip fix some UTF8 issues.
« Last Edit: August 23, 2019, 10:14:21 am by TimoVJL »
May the source be with you

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1996
Re: TLWHViewRE alpha
« Reply #1 on: August 20, 2022, 12:44:43 pm »
Perhaps someone use md-files from https://github.com/MicrosoftDocs/win32 to make usable WDK help system.
Those md-files are simpler than html-files.
I wait, when those md-files are finally fixed.


May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #2 on: August 20, 2022, 11:45:04 pm »
Perhaps someone use md-files from https://github.com/MicrosoftDocs/win32 to make usable WDK help system.
Those md-files are simpler than html-files.
I wait, when those md-files are finally fixed.

Ummm - what format are you supporting?  I don't know what a .msch file is.  Is there a spec?

I'm finishing up a fully working Controls.chm with TOC and Index and all links (I hope) working, converted from
the GitHub MS Docs win32 repository.

I don't see a WDK directory in there? What does WDK stand for  ???  Windows Development Kit?

I was planning to post converted .chm files on SourceForge.   Hopefully MSHTML.DLL will get an update ....

John Z

P.S. Fortunately earlier in the week I cleaned out a bunch of my old attachments otherwise "no room in the upload" directory

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1996
Re: TLWHViewRE alpha
« Reply #3 on: August 21, 2022, 08:41:36 am »
.msch is MS compressed html help files in ZIP format.
WDK is Windowns Developments Kit.
If we compress that desktop-scr folders to ZIPs and index it, it might be compact system.
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #4 on: August 21, 2022, 11:40:29 am »
OK, so when I complete converting the Controls section then those HTML files can be compressed and usable with the software you created rather than using them in the .chm format?  Is an index or table of content required too?

I'll look for more information on the .mshc system/file(s) format.  I surmise the one benefit is that the viewer is not dependent on MSHTML.DLL and it's limitations, especially when linking to external web sites it looks like MSHTML identifies itself as MS IExplorer and with the campaign against IE some external sites won't transmit.

Seems to me you could actually use the .chm file itself.  It is just a ZIP of the HTML files with some added files for searching linking etc. which could be ignored. See attachment.


John Z

Update: I found it - It is the Visual studio (which I don't have) help system format.  I've also found some docs on TOC and F1 help formats.  The change doesn't look to involved - so far.....
« Last Edit: August 22, 2022, 11:13:50 pm by John Z »

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #5 on: August 23, 2022, 04:11:01 pm »
If we compress that desktop-scr folders to ZIPs and index it, it might be compact system.
Just testing one topic 'Controls': 
Completed Controls.chm file is 4,525 Megs (includes TOC and Index)
ZIP all .md files under 'Controls' is 4,356 Megs (including a TOC.yml but no F1 Keyword file)

So not much size difference at this point between raw .md and final .chm.

Normal .mshc is ALSO in XHTML format (like .chm).  The .mshc TOC looks similar to .chm HHC TOC and the F1 Keyword section looks similar to the HHK so I guess that after adding these to the file list the .mshc file size will be comparable to the .chm as well.  I may try to make a complete Controls.mshc just to see.

Using .md files directly would save a lot of work obviously not needing to convert to any HTML, just build some sort of new TOC and search index.  If the new viewer could use the TOC.yml then - well nothing needs to be done except download and zip it.  :)  The new viewer would need to support a number of things available in the compiled help file formats (links, Pictures, tables, lists, etc).  The .md files themselves still do need a lot of work however.

John Z

Update: Well I used mshcMigrate utility from HelpWareGroup to migrate the Controls.chm to .mshc and .cab file formats.
Controls.cab is 9,553 Megs
Controls.mshc is 10,859 Megs

Unfortunately I can test the conversion as I don't have MS Help 2.x runtime.  However even if fully functional the size is not favorable.
Conversion results:
Time to complete: 5 mins, 38.41 secs
   ** Errors: 5, [ ] Warnings: 8,343
   HTML files requiring attention: 2

Update again:  Using TimoVJL's  TLWHViewRE-2018-11-16_bin.ZIP file attached above I'm able to read the Controls.mshc I created.  Need more time to assess the successfulness of the conversion - but it is usable! :)
« Last Edit: August 23, 2022, 06:39:29 pm by John Z »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1996
Re: TLWHViewRE alpha
« Reply #6 on: August 24, 2022, 08:38:10 am »
TLWHViewRE source for test x64 version.
« Last Edit: August 24, 2022, 08:46:16 am by TimoVJL »
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #7 on: August 24, 2022, 12:23:40 pm »
Hi TimoVJL,

The new x64 dbg version works as well as the prior post 64 version.

In both versions the listview requires a double clicking to view the item, is there a reason single click won't be adequate?

In both versions the RTF output looks good.

In both versions search does not work showing an message about missing index.  I think this is a problem with the mshcMigrate utility from HelpWareGroup.  The .chm file has a complete TOC and Index file, but in the converted .mshc file the index seems to all be 'temp' files. I don't have any other .mshc files to test with....

Since the .cab file is just a zip of the .mshc file it seems the viewer could support .cab extension by doing a double unzip? Maybe not worth it  but might be something to consider.

Very cool.

Cheers,
John Z

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1996
Re: TLWHViewRE alpha
« Reply #8 on: August 24, 2022, 01:39:00 pm »
MS .mshc files usually comes with .mshi index files for creating final index system.
I created own index system with tinycdb, so that index have to build for it.
If you open .mshc/.mshi pair, you see collected keywords.

In this site is enough .cab files, that have .mshc/mshi file pairs.
http://services.mtps.microsoft.com/ServiceAPI/catalogs/dev15/en-us
Sadly browsers don't show page properly anymore.
Save page and replace
&lt;&#65533;  to <
&gt; to >
to see it properly.


Link for one Win API cab
v2Programming reference for Windows API_en-us__0(9da05d76-0829-4f55-8387-0ca21561d3c4).cab
MSDN-2022-cab-links.zip have tools to download and uncab msh* files to msh folder
« Last Edit: August 24, 2022, 08:50:55 pm by TimoVJL »
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #9 on: August 25, 2022, 10:39:30 am »
Using the cab file attached I get the same error message  "Missing index file" when I try to search.

Start the program TLWHViewRE64v9dbg
File Open  - Will not open the .cab
so
Unzip the cab get two files one .msch one .mshi, identical base names
Start the program TLWHViewRE64v9dbg
File Open - it opens the .msch Keyword list is there and Help Id list is there
Select Search Tab, put in 'message'  hit enter or ? button - "Missing index file" shows up
checked .mshi is in the same directory, opened it with text editor it has data about 17Megs in fact
Tried to open the .mshi file in TLWHViewRE64v9dbg, program doesn't complain, no error but still no index file recognized. No luck

Tried shortening the base name to just a.msch and a.mshi but it made no difference.

Haven't gone in to the code yet.

John Z

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1996
Re: TLWHViewRE alpha
« Reply #10 on: August 25, 2022, 02:01:24 pm »
Using the cab file attached I get the same error message  "Missing index file" when I try to search.
It uses own index system not .mshi, as those are partial index files for MS help index system.

Example TLWHView.ini
Code: [Select]
[mshc]
Path=C:\code\MSDN-2019\msh\
PathIdx=C:\code\MSDN-2019\TLWHView
Path gives path for msh* files
PathIdx gives path and basename for index files.
TLWHViewFiles      index of helpfiles
TLWHViewHelpId  index of HelpIds
TLWHViewIdx       index of keywords

IndexWHelp.exe try to make indexfiles from .mshc files.

« Last Edit: August 25, 2022, 02:03:14 pm by TimoVJL »
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #11 on: August 25, 2022, 03:45:41 pm »
OK got it working on the file extracted from the .cab file from the link
Link for one Win API cab
v2Programming reference for Windows API_en-us__0(9da05d76-0829-4f55-8387-0ca21561d3c4).cab

After unziping the .cab and then creating the ini then running the IndexWhelp.exe on the .mshc, then starting TLWHViewRE and loading the .mshc.  Search worked too although I'm not sure how to get next search.

INMHO to really be usable by the average Joe or Jane, one should just run TLWHViewRE and be able to open either a .CAB or a .mshc and all else should be done by the program.  but hey it DOES work!

Now no missing index file for the converted Controls.mshc either and Search seems to work to find the first occurrence of a word only in the current open document.

Not sure the Controls.chm or Controls.mshc are worth the effort though.  I see Controls html files still have at least 1000 links back to Microsoft web on-line site!  SO the files are not completely off-line documentation.

John Z

Offline John Z

  • Member
  • *
  • Posts: 482
Re: TLWHViewRE alpha
« Reply #12 on: August 26, 2022, 04:11:47 pm »
TLWHViewRE source for test x64 version.

Looks like the parser is missing some implied or real space characters and possibly some implied or real line feed characters.  Not a big deal in the overall scheme of things but could make reading easier.

Attached images show the same document using four different presentation programs.
View 1 Left=TLWHViewRE  2 Right=CHM
View 3 Left=PanWriter   4 Right=FireFox

Mainly notice line 1 in TLWHViewRE and 1st line under Overviews, and first line under Macros.

John Z