Is SHFB portable?

Topics: User Forum
Nov 9, 2014 at 3:22 AM
I usually run SHFB from the command line, e.g. MSBuild.exe MyProject.shfbproj. I check-in the .shfbproj file into source control so I and others can build, but that requires SHFB to be installed.

Do you think it's possible to have a SHFB distribution and can be just downloaded and saved into a project's folder, to be referenced by the .shfbproj file, without depending on any other external state? Perhaps distributed as a NuGet package.

BTW, I'm only interested in Website (HTML) output, not CHM or any other.
Nov 9, 2014 at 5:43 PM
Yes, the latest release is portable. In fact, I just got a request to look into distributing SHFB in a NuGet package. Somebody has published one but the requester would prefer it to come from this actual project and be maintained with each new release. I'm going to look into it.

The latest release will run without SHFBROOT defined as an environment variable. In such cases, the tools will default to using the assembly location to locate the other tools and supporting files. You will need to add a property to the project to define SHFBROOT so that the targets file can find the build tasks though as noted in the linked topic above.

As you mentioned, this would only be useful for website builds although MS Help Viewer builds would work too as there are no external tool dependencies for them. Help 1 may work on development PCs since the Help 1 compiler seems to be there in most cases. That may not be true of build servers though. Help 2 is most likely out of the question since those components are unique to Visual Studio 2005/2008. However, since its an older format, it may not be in use much so may be a non-issue.

The other downside to not installing it using the guided installer is that there would be no Visual Studio integration via the NuGet package and you'd have to locate and run the standalone GUI from the downloaded package folder. If the primary goal is to run it for builds, they probably are not issues either.

Marked as answer by maxtoroq on 11/9/2014 at 11:45 AM
Nov 9, 2014 at 6:46 PM
I think I found the nuget package you were talking about:

I tried it and after setting SHFBROOT everything worked. The package is not as large as I expected (34 MB), I bet it can be trimmed down further, although it's fine. The nuspec is so simple it's funny:

Keep up the good work, and I hope there's an official nuget package in the future.
Nov 13, 2014 at 4:41 PM

I'd love to use SHFB in a hosted build server environment with git. In those scenarios checking in SHFB isn't an option and neither is installing it. I'd love to see an officially supported NuGet package.

As far as the limitations go: do you need to install Help 1 or is the problem only that you can't redist it?
Nov 13, 2014 at 7:47 PM
I've created the .nuspec file so I can publish the package effective with the next release.

Regarding Help 1, it's Microsoft's so I'm pretty sure I can't redistribute it. That's why the guided installer just links to the download page if you need it. Even if I could, I'm pretty sure there are some COM components involved so they'd need to be registered in order to be usable. It's not required unless you will be producing Help 1 files. Likewise for the Help 2 components.
In those scenarios checking in SHFB isn't an option and neither is installing it
Okay, I get not being able to install it but by not being able to check it in, doesn't that negate the effectiveness of a NuGet package or am I missing something? How else would it work if neither of those options were available?