Search code examples
dockerhtml-help-workshop

How do you compile a HTML Help Workshop project inside a Docker container?


I get this error when I try to compile a HTML Help Workshop project, in a mcr.microsoft.com/windows/servercore:1809 container with Visual Studio Build Tools installed.

PS C:\> & 'C:\Program Files (x86)\HTML Help Workshop\hhc.exe' test.hhp
HHC5010: Error: Cannot open "c:\test.chm". Compilation stopped.

Even this minimal test project fails to compile, and outputs the same error.

[OPTIONS]
Compiled file=C:\test.chm

[FILES]

I noticed that Build Tools doesn't install all files ls 'C:\Program Files (x86)\HTML Help Workshop' so I also tried replacing that with my version of HTML Help Workshop on my desktop but this also did not work.

I want to know if there is a way to compile HTML Help Workshop projects in Docker.


Solution

  • I can't believe it!!!! I got it to work with mcr.microsoft.com/windows:1903! So in conclusion, HTML Help Workshop does not work in Windows Servercore but does work in a Windows container.

    Here's an example of a dockerfile if you want to use HTML Help Workshop:

    FROM mcr.microsoft.com/windows:1903
    
    ADD https://aka.ms/vs/16/release/vs_buildtools.exe vs_buildtools.exe
    RUN .\vs_buildtools.exe --quiet --norestart --nocache --wait \
        --add Microsoft.VisualStudio.Component.VC.ATLMFC
    RUN del vs_buildtools.exe
    

    Inside a container use this command to compile a help project:

    "C:\Program Files (x86)\HTML Help Workshop\hhc.exe" path\toProject.hhp
    

    Note: This only works for English language help files. Unlike Servercore, Microsoft does not publish containers with localized versions of Windows, and I haven't found a way to change system locale in a Docker container. Using the above method for help projects in other languages will result in incorrect encodings.