未通过WiX正确安装Outlook 2010加载项

时间:2014-04-24 02:50:45

标签: c# wix outlook-addin outlook-2010 wix3

我是第一次尝试WiX 3.8,尝试为简单的Outlook 2010加载项创建设置。除了其他内容外,加载项还需要在Compose上创建一个功能区选项卡。我想我在Product.wxs中遗漏了一些东西。当我从VS 2013 IDE执行加载项时,它在Outlook中正确显示,但是从WiX安装时,功能区不会显示在“撰写”模式下,而是仅显示在Outlook资源管理器中。我想我在Product.wxs中遗漏了一些东西。

 <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="dummyAppSetup" Language="1033" Version="1.0.0.0" Manufacturer="Saurabh Kumar" UpgradeCode="46461820-CDEB-48E7-A975-1ABB1C307EE6">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="NoReplyAll" Level="1">
  <ComponentRef Id="CMP_AddIn"/>
  <ComponentRef Id="CMP_DllManifest"/>
  <ComponentRef Id="CMP_zipdll"/>
  <ComponentRef Id="CMP_VstoManifest"/>
  <ComponentRef Id="CMP_ToolsCommon"/>
  <ComponentRef Id="CMP_ToolsOutlook"/>
</Feature>
<UIRef Id="WixUI_Minimal"/>
<PropertyRef Id="NETFRAMEWORK40CLIENT"/>
<Condition Message="This product requires the .NET Framework 4.0 or higher version installed.">
  <![CDATA[Installed OR (NETFRAMEWORK40CLIENT OR NETFRAMEWORK40FULL)]]>
</Condition>
 </Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLFOLDER" Name="dummyApp">
      <Component Id="CMP_AddIn" Guid="*">
        <File Id="FILE_AddIn" Source="$(var.dummyApp.TargetPath)" KeyPath="yes"/>
        <RemoveFile Id="PurgeFILE_AddIn" Name="*.*" On="uninstall"/>
      </Component>
      <Component Id="CMP_DllManifest" Guid="*">
        <File Id="FILE_DllManifest" Source="$(var.dummyApp.TargetPath).manifest" KeyPath="yes"/>
      </Component>
      <Component Id="CMP_VstoManifest" Guid="*">
        <File Id="FILE_VstoManifest" Source="$(var.dummyApp.TargetDir)$(var.dummyApp.TargetName).vsto" KeyPath="yes"/>
        <RegistryKey Root="HKLM" Key="Software\Microsoft\Office\Outlook\Addins\dummyApp">
          <RegistryValue Name="Description" Value="dummyApp Add-In" Type="string" Action="write"/>
          <RegistryValue Name="FriendlyName" Value="dummyApp" Type="string" Action="write"/>
          <RegistryValue Name="LoadBehavior" Value="3" Type="integer" Action="write"/>
          <RegistryValue Name="Manifest" Value="[#FILE_VstoManifest]|vstolocal" Type="string" Action="write"/>
        </RegistryKey>
        <RemoveRegistryKey Root="HKLM" Key="Software\Microsoft\Office\Outlook\Addins\dummyApp" Action="removeOnUninstall"/>
      </Component>
      <Component Id="CMP_ToolsCommon">
        <File Id="FILE_ToolsCommon" Source="$(var.dummyApp.TargetDir)Microsoft.Office.Tools.Common.v4.0.Utilities.dll" KeyPath="yes"/>
      </Component>
      <Component Id="CMP_ToolsOutlook">
        <File Id="FILE_ToolsOutlook" Source="$(var.dummyApp.TargetDir)Microsoft.Office.Tools.Outlook.v4.0.Utilities.dll" KeyPath="yes"/>
      </Component>
    </Directory>
  </Directory>
</Directory>
</Fragment>
</Wix>

进一步的调查显示,实际上在功能区上加载Outlook会产生异常:

**调用函数'GetVisible'时出现异常

配置系统无法初始化**

尝试检索我的某个应用设置时似乎正在发生这种情况:

    <?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="dummyApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <userSettings>
    <AutoZip2010.Properties.Settings>
      <setting name="chkEnabled" serializeAs="String">
        <value>True</value>
      </setting>
      <setting name="chkPreview" serializeAs="String">
        <value>False</value>
      </setting>
      <setting name="chkLog" serializeAs="String">
        <value>False</value>
      </setting>
    </AutoZip2010.Properties.Settings>
  </userSettings>
</configuration>

奇怪的是,在Outlook中通过IDE进行调试时,它可以完美加载。但是从Wix发布安装后,当我启动outlook时会出现此异常。

1 个答案:

答案 0 :(得分:2)

如果加载项完全出现在Outlook中,则安装程序可能没问题 - 如果文件或注册表值丢失,我希望加载项根本不显示。我建议检查&#34;显示加载项用户界面错误&#34; Outlook中的“高级设置”框,可能会提醒您出现功能区问题...也许......