使用帮助库管理器和WiX安装帮助 [英] Installing Help with Help Library Manager and WiX

查看:80
本文介绍了使用帮助库管理器和WiX安装帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过使用WiX运行Sandcastle帮助文件生成器在构建Sandcastle项目后创建的HelpLibraryManagerLauncher,将自己的帮助文件添加到Visual Studio 2010的帮助库中.

I am trying to add my own help file to Visual Studio 2010's Help Library by using WiX to run the HelpLibraryManagerLauncher that the Sandcastle Help File Builder creates after it builds my Sandcastle project.

我正在使用WiX的QuietExec自定义操作来运行以下命令:

I am using WiX's QuietExec custom action to run the following command:

HelpLibraryManagerLauncher.exe
  /product "VS"
  /version "100"
  /locale en-us 
  /silent 
  /brandingPackage Dev10.mshc 
  /sourceMedia MyClassLibraryHelp.msha

但是,MSI安装程序失败,并显示以下内容:

However, the MSI installer fails with the following:

Action 00:00:00: InstallVS2010Help.
CAQuietExec:  Help Library Manager Launcher, version 1.0.0.0
CAQuietExec:  Copyright c 2010, Eric Woodruff, All Rights Reserved
CAQuietExec:  E-Mail: Eric@EWoodruff.us
CAQuietExec:  
CAQuietExec:  Running Help Library Manager to perform the requested action.  Please wait...
CAQuietExec:  
CAQuietExec:  ERROR: The requested operation could not be performed.
CAQuietExec:  Details: The Help Library Manager returned the exit code 401: The installation of content failed.  Detailed information can be found in the event log and in the installation log.
CAQuietExec:  Error 0x80070191: Command line returned an error.
CAQuietExec:  Error 0x80070191: CAQuietExec Failed
CustomAction InstallVS2010Help returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

检查EventLog,记录以下错误:

Checking the EventLog, the following error is recorded:

An error occurred while updating local content: Microsoft.Help.CacheLib.CacheLibUnsignedInstallRefusedException: Exception of type 'Microsoft.Help.CacheLib.CacheLibUnsignedInstallRefusedException' was thrown.
 at Microsoft.Help.CacheLib.DocumentationCache.VerifyAndExtractPackages(VendorName vendorName, ChangeDescription change, StatusCallback`1 statusCallback, CertificateCheckCallback certCheckCallback)
 at Microsoft.Help.CacheLib.DocumentationCache.IntegrateChange(VendorName vendorName, ChangeDescription change, StatusCallback`1 statusCallback, CertificateCheckCallback certCheckCallback)
 at Microsoft.Help.CacheLib.DocumentationCache.Update(VendorName vendorName, Boolean checkForOnlineUpdates, StatusCallback`1 statusCallback, CertificateCheckCallback certCheckCallback)
 at Microsoft.Help.CacheLib.CacheManager.<>c__DisplayClass24.<UpdateAsync>b__23()
 at Microsoft.Help.CacheLib.AsyncOperationRunner.Run(Object state)

这是我的WiX代码:

<CustomAction Id="InstallVS2010Help" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" />
<CustomAction Id="SetPropertiesForInstallVS2010Help"
              Property="InstallVS2010Help"
              Value="&quot;HelpLibraryManagerLauncher.exe&quot; /product &quot;VS&quot; /version &quot;100&quot; /locale en-us /silent /brandingPackage Dev10.mshc /sourceMedia MyClassLibraryHelp.msha"
              Execute="immediate" />
.
.
.
<InstallExecuteSequence>
  <Custom Action="SetPropertiesForInstallVS2010Help" Before="InstallInitialize">NOT INSTALLED</Custom>
  <Custom Action="InstallVS2010Help" Before="InstallFinalize">(NOT INSTALLED) AND (NOT UPGRADINGPRODUCTCODE) AND (NOT REMOVE="ALL")</Custom>
<InstallExecuteSequence>

如果我从命令提示符处运行HelpLibraryManagerLauncher,它表示操作已成功完成但是,当我检查帮助库"时,未安装我的帮助库.

If I run the HelpLibraryManagerLauncher from a command prompt, it says that the operation completed successfully but when I check the Help Library, my help library isn't installed.

但是,如果删除/silent开关,则会弹出通常的帮助库管理器"窗口,并且列出了我的帮助库.

If I remove the /silent switch however, the usual Help Library Manager window pops up and my help library is listed.

很显然,我希望能够从WiX自动安装我的帮助文件,而不必与帮助库管理器的GUI进行交互,但是我必须缺少一些东西.是否无法通过命令提示符或WiX静默安装帮助文件? (不过,通过命令提示符以静默方式卸载仍然可以,但是).

Obviously, I want to be able to automatically install my help file from WiX without having to interact with the Help Library Manager's GUI, but I must be missing something. Is it not possible to silently install a help file, either through the command prompt or through WiX? (Uninstalling silently through the command prompt works just fine, though).

CacheLibUnsignedInstallRefusedException也是一个问题.即使未签名,如何获取WiX(和我的MSI)来安装我的帮助文件?

The CacheLibUnsignedInstallRefusedException is also a concern. How do I get WiX (and my MSI) to install my help file even though it isn't signed?

我正在使用WiX v3.5.2415,Sandcastle v2.610621.1和Sandcastle帮助文件生成器v1.9.1.0. Sandcastle帮助文件生成器使用的Help 2.0编译器和HTML帮助工作室hhc可执行文件来自Visual Studio 2008 SDK.

I am using WiX v3.5.2415, Sandcastle v2.610621.1, and Sandcastle Help File Builder v1.9.1.0. The Help 2.0 Compiler and HTML Help Workshop hhc executable that Sandcastle Help File Builder uses are from the Visual Studio 2008 SDK.

任何帮助将不胜感激.

推荐答案

HelpLibManager.exe确实允许静默安装帮助集合.但是,要求之一是必须将帮助集合包含在已签名的cab文件中.这意味着您不能使用.mshc文件进行静默安装.

HelpLibManager.exe does allow silent installation of help collections. However, one of the requirements is that the help collection must be contained in a signed cab file. This means that you cannot use the .mshc file for silent installation.

您需要做的第一件事就是获得代码签名证书.如果您还没有,则可以从VeriSign购买一.

First thing you need to do is acquire a Code Signing Certificate. If you don't already have one, you can purchase one from VeriSign.

一旦有了代码签名证书,就需要将mshc文件转换为cab文件.您可以在命令行上使用makecab命令来实现此目的.

Once you have a code signing certificate, you need to convert your mshc file into a cab file. You can achieve this using the makecab command on the command line.

makecab myhelp.mshc myhelp.cab

然后,您需要使用代码签名证书对cab文件进行数字签名.您可以通过在命令行上使用signtool命令来实现此目的.

Then you need to use your code signing certificate to digitally sign the cab file. You can achieve this by using the signtool command on the command line.

signtool sign /f your-purchased-signing-certificate.pfx /p password /d "My Help Collection" myhelp.cab

一旦您的.cab文件签名,就可以在无提示帮助安装中使用它,而不是.mshc文件.确保将您的msha文件更新为指向.cab文件而不是.mshc文件.

Once your .cab file is signed, it can be used in a silent help installation instead of the .mshc file. Be sure to update your msha file to point to the .cab file instead of the .mshc file.

/brandingPackage开关不是必需的.我还建议将/content开关添加到您的自定义操作中

The /brandingPackage switch is not necessary. I also suggest adding the /content switch to your custom action

/content "[CommonAppDataFolder]Microsoft\HelpLibrary"

因为如果用户尚未为本地帮助集合设置默认存储,则无提示帮助安装将失败.如果用户已经设置了默认存储,则此开关将被忽略,因此始终使用它不会有任何危害.

because a silent help installation will fail if the user has not yet set up the default store for local help collections. This switch gets ignored if the user has already set up his default store, so there is no harm in always using it.

这是我用于静默帮助安装的wix代码.请注意,我正在使用所有文件的完整路径.

This is the wix code I'm using for silent help installations. Note that I'm using full paths to all files.

首先,设置一个属性,该属性的路径为HelpLibManager.

First, set a property with the path to HelpLibManager.

<SetProperty Id="HELPLIBMANAGER"
             Value="[ProgramFilesFolder]Microsoft Help Viewer\v1.0\HelpLibManager.exe"
             After="InstallInitialize"/>

接下来,声明将使用我们刚刚设置的HELPLIBMANAGER属性的自定义操作.请注意,在ExeCommand中使用了单引号('),以便我们可以在文件路径中使用双引号().

Next, declare the custom actions that will use the HELPLIBMANAGER property we just set. Note the use of single quotes (') in the ExeCommand so that we can use double quotes (") to surround the file paths.

<CustomAction Id="InstallHelp"
              Directory="YourHelpDir"
              ExeCommand='"[HELPLIBMANAGER]" /product VS /version 100 /locale en-us /silent /content "[CommonAppDataFolder]Microsoft\HelpLibrary" /sourceMedia "[#filekey.msha]"'
              Execute="deferred"/>
<CustomAction Id="RollbackInstallHelp"
              Directory="YourHelpDir"
              ExeCommand='"[HELPLIBMANAGER]" /product VS /version 100 /locale en-us /silent /uninstall /vendor "YourVendorName" /productName "YourProductName" /mediaBookList "YourMediaBookList"'
              Execute="rollback"/>

最后,安排自定义操作:

Finally, schedule the custom actions:

<Custom Action="RollbackInstallHelp" After="InstallFiles">NOT REMOVE="ALL"</Custom>
<Custom Action="InstallHelp" After="RollbackInstallHelp>NOT REMOVE="ALL"</Custom>

卸载操作几乎相同,应该很容易确定.另请注意,这仅适用于32位OS.如果您还希望支持64位OS,那么您将需要执行一些其他自定义操作才能为HelpLibManager设置正确的路径,因为32位和64位OS之间的路径是不同的.

The uninstall actions are pretty much the same and should be fairly easy to figure out. Also be aware that this only works for a 32-bit OS. If you want to also support 64-bit OS, then you're going to need a couple more custom actions to set the correct path to HelpLibManager because the paths are different between 32 and 64 bit OS.

这篇关于使用帮助库管理器和WiX安装帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆