我创建了一个针对 2003、2007 和 2010 版本的 Outlook 的加载项。
我在我的开发机器上使用 VS2008、VSTOSE 和 PIA2003 以及 Outlook 2003 进行了此操作。我不知道这将如何扩展到办公室/文档级插件,但它可能会起作用。
但是,您需要检测每个客户端上的 Outlook/Office 版本并安装相应的 PIA。
这可以使用Component Checker 来完成。然后,您可以在每个 Bootstrapper 包中查看存在哪个版本,并仅在适用时安装该包。例如,在您将拥有的引导程序包的 product.xml 中:
<?xml version="1.0" encoding="utf-8"?>
<InstallChecks>
<ExternalCheck Property="Office2003Exists" PackageFile="ComponentCheck.exe" Arguments="{3EC1EAE0-A256-411D-B00B-016CA8376078}"/>
<ExternalCheck Property="Office2003PIAExists" PackageFile="ComponentCheck.exe" Arguments="{14D3E42A-A318-4D77-9895-A7EE585EFC3B}"/>
</InstallChecks>
<Commands Reboot="Defer">
<Command PackageFile="o2003pia.msi" Arguments="" EstimatedInstalledBytes="30000000" EstimatedInstallSeconds="60">
<InstallConditions>
<BypassIf Property="Office2003Exists" Compare="ValueNotEqualTo" Value="0" />
<BypassIf Property="Office2003PIAExists" Compare="ValueEqualTo" Value="0" />
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
2007 年的产品 ID 是:
Outlook : 0638C49D-BB8B-4CD1-B191-050E8F325736
PIA: ED569DB3-58C4-4463-971F-4AAABB6440BD
2010 年的产品 ID 是:
Outlook : CFF13DD8-6EF2-49EB-B265-E3BFC6501C1D
PIA: 1D844339-3DAE-413E-BC13-62D6A52816B2
这确实意味着您必须在安装程序包中包含先决条件,而不是允许下载,这显然会增加下载大小。
您也只能使用 2003 年的方法等。此外,您创建的任何工具栏都是基本的,因为您无法完全控制功能区。您仍然可以像在 2003 年和 2007 年一样添加按钮等。它们将在 2010 年出现在自己的功能区组中。
但是,在我的解决方案中,我为任何不与 Outlook 交互的东西创建了一个单独的程序集。这样,如果将来需求发生变化,我可以轻松地将加载项拆分为目标特定版本,而不会影响加载项的主要核心功能。