简体   繁体   中英

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.

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.

To get it working with servercore:1809 or ltsc2019 you have to add the dlls itss.dll and itircl.dll to the containers syswow64 folder and register it with regsrv32.

The files can be found on your windows-10 installation in the windows\\syswow64 folder.

#add missing dlls to run html help workshop on ltsc2019 container
COPY .\itss.dll C:\Windows\SysWOW64\itss.dll
COPY .\itircl.dll C:\Windows\SysWOW64\itircl.dll

RUN C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\itss.dll
RUN C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\itircl.dll

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM