0

I'm trying to install help content in Visual Studio 2013's HelpViewer 2.1 and am getting intermittent errors. The help sometimes fails to install. We have an msi installer which runs the following command.

"C:\Program Files (x86)\Microsoft Help Viewer\v2.1\HlpCtntMgr.exe" /operation install /catalogname "VisualStudio12" /silent /locale en-us /sourceuri CURRENTDIR\helpcontentsetup.msha

The .msha points to a CAB file. The CAB file is signed.

If I try the command above at command prompt it always fails. The installer sometimes succeeds however.

When it fails I get a .dat file and the .cab file I'm trying to install is in the C:\ProgramData\Microsoft\HelpLibrary2\Catalogs\VisualStudio12\Incoming\Cab directory. The remedy is to repair VS2013 which repairs HelpViewer 2.1!!!!! or sometimes remove the CAB file from the directory above.

Here's the content of the .dat file:

ÿÿÿÿ          ^Microsoft.VisualStudio.Help, Version=2.1.0.0,

Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
3Microsoft.VisualStudio.Help.CacheLib.UpdateFileMove
StateIdLogFilePath _fileListFileMove+_fileList8Microsoft.VisualStudio.Help.CacheLib.UpdateFileMoveState System.Guid²System.Collections.Generic.List1[[Microsoft.VisualStudio.Help.CacheLib.MoveFile, Microsoft.VisualStudio.Help, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]²System.Collections.Generic.List1[[Microsoft.VisualStudio.Help.CacheLib.MoveFile, Microsoft.VisualStudio.Help, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]
ýÿÿÿ8Microsoft.VisualStudio.Help.CacheLib.UpdateFileMoveState
value__ üÿÿÿSystem.Guid
_a_b_c_d_e_f_g_h_i_j_k
9ëPüÎ0O‘ÏûZ9Ÿ*
fC:\ProgramData\Microsoft\HelpLibrary2\Catalogs\VisualStudio12\500eeb39-cefc-4f30-91cf-fb5a13399f2a.dat

²System.Collections.Generic.List`1[[Microsoft.VisualStudio.Help.CacheLib.MoveFile, Microsoft.VisualStudio.Help, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]] _items_size_version /Microsoft.VisualStudio.Help.CacheLib.MoveFile[]
-Microsoft.VisualStudio.Help.CacheLib.MoveFile

I've filed a Connect issue but am waiting for a satisfactory response.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
learnerplates
  • 4,257
  • 5
  • 33
  • 42

1 Answers1

1

There is a long blog post about trying to install content when the local content is not yet initialized. It may apply here:

Silent Install with Uninitialize Library

Caveat: If you run HLM in silent mode (and Library store is uninitialized), then library store initialization will fail. So your installation will fail.

For this case I see 3 options. So once you detect an unintialized Library condition you can either:

  1. Cancel setup. Inform the user they first need to complete documentation set using VS Setup & the Blue button.
  2. Open HLM without the /silent switch. Include /brandingPackage switch (see above). Once Initialization is completed you can run your silent install.
  3. Open HLM with the /silent switch. You must also use the /content switch which specifies where to create the library folder. You can specify the /brandingPackage, the /content and the /sourceMedia switches all on the same command line.

Note that for 3) you can get the default /content path by reading LocalStore= from the registry (see FAQ page).

Oh one more problem. Apparently if you use /content path on Windows XP, the path will contain spaces and will require quotes around it. However the quotes make the command fail (a bug). My only suggestion here is to use the short path name for the path segment containing the space. Programmers will know how to do this.

It also lists a few other issues such as the fact that the Help library should not be running when you are performing the installation and that adding libraries should therefore not be done in parallel.

What if Help Library manager is already running?

You should detect if HLM is already running. Programmers can do this by searching for the process (see C# code below). Don't use FindWindow() since in silent mode there is no window to find. If HLM is running you should ask the user to let the current task finish, then close HLM so that installation can continue. Since Windows usually restricts you to running one installation at a time you generally wont have a problem with multiple apps trying to run HLM at the same time.

 // Get all instances of HLM running on the local
 // computer. If you get any processes back then you know HLM is running.
 Process [] localByName = Process.GetProcessesByName("HelpLibManager");

More information available here: http://mshcmigrate.helpmvp.com/faq/install

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • thanks. could be anything in here. This help is a full time task. What is the connection between http://mshcmigrate.helpmvp.com and Visual Studio Help? Does all of this related to VS2013 HelpViewer 2.1? We had little issues with installation in VS2010 HelpViewer 1.0 !! – learnerplates May 07 '15 at 13:55
  • Yes I did this this morning, dont know where the item went to though, the connect site is a piece of cp. – learnerplates May 07 '15 at 14:22
  • I'd love to but I cant find it. didnt get an email either. Connect may not work on Chrome :O Hold the phone I found it https://connect.microsoft.com/VisualStudio/feedback/details/1310658/custom-help-intermittently-does-not-install – learnerplates May 07 '15 at 15:10