【问题标题】:VSTO Addin for Outlook install via WIX通过 WIX 安装 Outlook 的 VSTO 插件
【发布时间】:2021-04-10 04:45:04
【问题描述】:

我的目标是为本地 PC 上的所有用户而不是当前用户安装 VSTO Outlook 插件。我使用了 Visual Studio 中的 Publish 方法,结果是 exe 文件,这意味着 ClickOnce 方法。 (不适用于所有人安装)

我开始研究我发现Wix

我的第一个问题是,当我从 VSTO 插件从 Visual Studio 创建 Build 时,我有 2 个目录和 20 个文件,是否可以在 WIX 目录参考中的 product.wxs 文件中分配目录?

第二个问题,当文件和目录“安装”到目标目录时,(例如程序文件)如何将 VSTO 分配给 Outlook?是因为将 VSTO 添加到注册表HKLM

我问我是否离我的目标更近了

【问题讨论】:

    标签: wix windows-installer registry vsto


    【解决方案1】:

    不确定我是否理解您的第一个问题,但无论如何我都会尝试回答。您必须带到用户 PC 的唯一文件是位于 bin/Release 文件夹下的文件,扩展名为 *.pdb 的文件除外。有两种方法可以将它们添加到安装中:

    • 第一种方法是手动将您想要包含在安装中的每个文件添加为Product.wxs 中的文件组件。你可以在他们的官方tutorial 中找到一个很好的例子。
    • 第二种方法是使用来自 Wix 工具集的harvest tool (Heat)。此工具可以在构建期间自动生成组件列表。

    关于你的第二个问题。要让 Word 或 Outlook 看到您的加载项,您必须在安装期间在 Windows 注册表中创建一个条目。例如,对于 Microsoft Word,您必须使用以下条目创建一个新键 HKLM\Software\Microsoft\Office\Word\Addins\MySuperAddOn

    Entry Type Value
    Description REG_SZ Required. A brief description of the VSTO Add-in. This description is displayed when the user selects the VSTO Add-in in the Add-Ins pane of the Options dialog box in the Microsoft Office application.
    FriendlyName REG_SZ Required. A descriptive name of the VSTO Add-in that is displayed in the COM Add-Ins dialog box in the Microsoft Office application. The default value is the VSTO Add-in ID.
    LoadBehavior REG_DWORD Required. A value that specifies when the application attempts to load the VSTO Add-in and the current state of the VSTO Add-in (loaded or unloaded). By default, this entry is set to 3, which specifies that the VSTO Add-in is loaded at startup. For more information, see LoadBehavior values. Note: If a user disables the VSTO Add-in, that action modifies LoadBehavior value in the HKEY_CURRENT_USER registry hive. For each user, the value of the LoadBehavior value in the HKEY_CURRENT_USER hive overrides the default LoadBehavior defined in the HKEY_LOCAL_MACHINE hive.
    Manifest REG_SZ Required. The full path of the deployment manifest for the VSTO Add-in. The path can be a location on the local computer, a network share (UNC), or a Web server (HTTP). If you use Windows Installer to deploy the solution, you must add the prefix file:/// to the manifest path. You must also append the string |vstolocal (that is, the pipe character | followed by vstolocal) to the end of this path. This ensures that your solution is loaded from the installation folder, rather than the ClickOnce cache. For more information, see Deploy an Office solution by using Windows Installer. Note: When you build a VSTO Add-in on the development computer, Visual Studio automatically appends the

    您可能需要阅读official documentation 以了解更多详情。

    Wix 工具集也允许这样做。您必须在 Product.wxs 中声明 RegistryKey 组件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-11
      • 2012-10-15
      • 2022-06-15
      • 2019-10-21
      • 2016-02-09
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      相关资源
      最近更新 更多