VSTO WIX安装后,Excel无法启动

时间:2018-09-04 13:43:44

标签: excel wix vsto

我想创建我的第一个WIX安装程序,但是我遇到了问题。我已经为Excel创建了VSTO插件。当我从Visual Studio启动它时,插件在所有配置中都能正常工作。当我从MSI文件安装它时,excel无法启动。我只看到绿色飞溅(几秒钟)。在事件查看器中,我只有:

  

应用程序:EXCEL.EXE框架版本:v4.0.30319说明:   进程由于未处理的异常而终止。异常信息:   System.NullReferenceException在   Optigraf.Excel.OptigrafRibbon.Dispose(Boolean)在   System.ComponentModel.Component.Finalize()

我的wxs文件:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="aaa" Language="1045" Codepage="1250" Version="1.0.0.1" Manufacturer="aaa" UpgradeCode="344fb829-504e-4743-ba83-3288900986a3">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" />

        <MajorUpgrade DowngradeErrorMessage="Najnowsza wersja [ProductName] jest już zainstalowana." />
        <MediaTemplate EmbedCab="yes" />

        <Feature Id="ProductFeature" Title="Setup" Level="1">
          <ComponentGroupRef Id="ProductComponents" />
          <ComponentRef Id="Registry_FriendlyName" />
          <ComponentRef Id="Registry_Description" />
          <ComponentRef Id="Registry_Manifest" />
          <ComponentRef Id="Registry_LoadBehavior" />
        </Feature>
    </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="aaa" Name="aaa">
          <Directory Id="INSTALLFOLDER" Name="Optigraf">
          </Directory>
          <Component Id="Registry_FriendlyName">
            <RegistryValue Id="RegKey_FriendlyName" Root="HKCU"
                           Key="Software\Microsoft\Office\Excel\Addins\Optigraf"
                           Name="FriendlyName"
                           Value="aaa"
                           Type="string" KeyPath="yes" />
          </Component>        
          <Component Id="Registry_Description">
            <RegistryValue Id="RegKey_Description" Root="HKCU"
                           Key="Software\Microsoft\Office\Excel\Addins\Optigraf"
                           Name="Description"
                           Value="aaa"
                           Type="string" KeyPath="yes" />
          </Component>
          <Component Id="Registry_Manifest">
            <RegistryValue Id="RegKey_Manifest" Root="HKCU"
                           Key="Software\Microsoft\Office\Excel\Addins\Optigraf"
                           Name="Manifest" Value="[INSTALLFOLDER]Optigraf.vsto|vstolocal"
                           Type="string" KeyPath="yes" />
          </Component>
          <Component Id="Registry_LoadBehavior">
            <RegistryValue Id="RegKey_LoadBehavior" Root="HKCU"
                           Key="Software\Microsoft\Office\Excel\Addins\Optigraf"
                           Name="LoadBehavior" Value="3"
                           Type="integer" KeyPath="yes" />
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <Component Id="Optigraf_Files" Guid="e621aec0-c2ef-4020-bd74-504cd2637ee5">
        <RemoveFolder Id="ProgramMenuDir" On="uninstall" />
        <File Source="$(var.AddinFiles)" Name="CUK.Auth.dll"  />
        <File Source="$(var.AddinFiles)" Name="CUK.Core.dll"  />
        <File Source="$(var.AddinFiles)" Name="EntityFramework.dll"  />
        <File Source="$(var.AddinFiles)" Name="EntityFramework.SqlServer.dll"  />
        <File Source="$(var.AddinFiles)" Name="EntityFramework.SqlServer.xml"  />
        <File Source="$(var.AddinFiles)" Name="EntityFramework.xml"  />
        <File Source="$(var.AddinFiles)" Name="Ical.Net.dll"  />
        <File Source="$(var.AddinFiles)" Name="Ical.Net.xml"  />
        <File Source="$(var.AddinFiles)" Name="Ical.Net.pdb"  />
        <File Source="$(var.AddinFiles)" Name="ICSharpCode.SharpZipLib.dll"  />
        <File Source="$(var.AddinFiles)" Name="log4net.dll"  />
        <File Source="$(var.AddinFiles)" Name="log4net.ElasticSearch.dll"  />
        <File Source="$(var.AddinFiles)" Name="log4net.ElasticSearch.pdb"  />
        <File Source="$(var.AddinFiles)" Name="log4net.xml"  />
        <File Source="$(var.AddinFiles)" Name="Microsoft.Office.Tools.Common.v4.0.Utilities.dll"  />
        <File Source="$(var.AddinFiles)" Name="MySql.Data.dll"  />
        <File Source="$(var.AddinFiles)" Name="MySql.Data.Entity.EF6.dll"  />
        <File Source="$(var.AddinFiles)" Name="Newtonsoft.Json.dll"  />
        <File Source="$(var.AddinFiles)" Name="Newtonsoft.Json.xml"  />
        <File Source="$(var.AddinFiles)" Name="NodaTime.dll"  />
        <File Source="$(var.AddinFiles)" Name="NodaTime.xml"  />
        <File Source="$(var.AddinFiles)" Name="NodaTime.pdb"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.DTO.dll"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.DTO.pdb"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.DTO.dll.config"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.dll"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.pdb"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.dll.config"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.dll.manifest"  />
        <File Source="$(var.AddinFiles)" Name="Optigraf.vsto"  />
        <File Source="$(var.AddinFiles)" Name="RestSharp.dll"  />
        <File Source="$(var.AddinFiles)" Name="SeafClient.dll"  />
        <File Source="$(var.AddinFiles)" Name="System.Reflection.TypeExtensions.dll"  />
        <File Source="$(var.AddinFiles)" Name="System.Runtime.Serialization.Primitives.dll"  />
      </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

我无法调试它,因为在VS中一切正常。如果我通过双击VSTO文件安装插件,则效果很好。 请帮我。我在做什么错了?

0 个答案:

没有答案