【发布时间】:2014-04-24 02:50:45
【问题描述】:
我第一次尝试 WiX 3.8,尝试为简单的 Outlook 2010 加载项创建设置。除了其他东西外,该加载项还需要在 Compose 上创建一个功能区选项卡。我想我的 Product.wxs 中缺少一些东西。当我从 VS 2013 IDE 执行加载项时,它会在 Outlook 中正确显示,但从 WiX 安装时,功能区不会在 Compose 模式下显示,而仅在 Outlook Explorer 中显示。我想我在 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 时会出现此异常。
【问题讨论】:
标签: c# wix outlook-addin outlook-2010 wix3