Office应用 VSTO软件的部署点滴

VSTO程序正确运行的前置条件

需要安装以下的内容

VS2008开发的组件

.net框架3.0/3.5

VSTO运行环境3.0

Office PIA安装程序[Office安装程序或独立的安装包安装,Office 2003/2007],Office2003版本需要特别注意,需要安装对应的补丁

 

VS2010开发的组件

.net框架4.0

VSTO运行环境4.0

Office PIA安装程序[Office安装程序或独立的安装包安装,Office 2007/2010版本]

 

简单的安装和注销方法

以a.vsto为例

安装

"%ProgramFiles%\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe" /i "%cd%\a.vsto"

"%ProgramFiles%\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" /i"%cd%\a.vsto"

 

卸载

"%ProgramFiles%\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe" /U "%cd%\a.vsto"

"%ProgramFiles%\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" /U "%cd%\a.vsto"

 

注册表的关联

VSTO程序安装后,在注册表HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\下有对应的组件的名称项[Word为例,Excel Outlook类同] ,其中的loadbehavior控制加载的行为,可以赋的值有:

0  Disconnected. The add-in is not loaded.

1  Connected. The add-in is loaded.

2  Load at startup. The add-in will be loaded and connected when the host application starts.

8  Load on demand. The add-in will be loaded and connected when the host application requires it (for example, when a user clicks a button that uses functionality in the add-in).

16  Connect first time. The add-in will be loaded and connected the first time the user runs the host application after registering the add-in.

一般常用的3,是1和2的或值,在组件异常后,这个值会自动变为2,此时需要手动或者程序处理设置,才能正常的看到组件的展现。

 

使用这些方法可以在一些出现问题的机器上检查组件不加载的原因

 

posted @ 2010-12-02 20:41  2012  阅读(4373)  评论(3编辑  收藏  举报