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 @   2012  阅读(4394)  评论(3编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示