簡體   English   中英

使用Wix安裝程序安裝后,無法讀取配置文件

[英]Trouble reading from the configuration file after installing it with Wix installer

在我的Excel加載項項目中,我正在從app.config文件(重命名為iFMExcelAddIn.dll.config)中讀取一些數據,但是在通過Wix安裝數據時,我的加載項並未從配置文件中讀取數據,甚至雖然我正在與安裝程序一起安裝配置文件。 我不知道我在這里想念的是什么。 我沒有使用Wix Installer的豐富經驗,並且所有的谷歌搜索都沒有取得豐碩的成果。

我想這與我安裝配置文件的方式有關。以下是我用來添加配置文件的代碼。 它是組件組中的倒數第二個組件。 AddinFILe的路徑也是../iFMExcelAddIn/$(Configuration)/。 我希望這些信息能使我知道是否需要更多信息。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>

<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

<Component Id="iFMExcelAddIn_vsto_Component">
    <File Id="iFMExcelAddIn_vsto" KeyPath="yes"
          Name="iFMExcelAddIn.vsto" Source="$(var.AddinFiles)"></File>
</Component>

<Component Id="iFMExcelAddIn_dll_manifest_Component">
   <File Id="iFMExcelAddIn_dll_manifest" KeyPath="yes"
          Name="iFMExcelAddIn.dll.manifest" Source="$(var.AddinFiles)">     </File>
  </Component>

  <Component Id="MSOfficeToolsCommon_dll_Component">
    <File Id="MSOfficeToolsCommon_dll" KeyPath="yes"
          Name="Microsoft.Office.Tools.Common.v4.0.Utilities.dll"
          Source="$(var.AddinFiles)"></File>
  </Component>

  <Component Id="MSOfficeToolsExcel_dll_Component">
    <File Id="MSOfficeToolsExcel_dll" KeyPath="yes"
          Name="Microsoft.Office.Tools.Excel.dll"
          Source="$(var.AddinFiles)"></File>
  </Component>

  <Component Id="iFMExcelAddIn_dll_Component" >
    <File Id="iFMExcelAddIn_dll" KeyPath="yes"
          Name="iFMExcelAddIn.dll" Source="$(var.AddinFiles)" />
  </Component>


  <Component Id="iFMExcelAddIn_dll_Config_Component" >
    <File Id="iFMExcelAddIn_dll_Config" KeyPath="yes"
          Name="iFMExcelAddIn.dll.config" Source="$(var.AddinFiles)" />
  </Component>

  <Component Id="iFMServiceDll_Component">
    <File Id="iFMServiceDll" Name="IFM.Service.dll" Source="$(var.AddinFiles)" SelfRegCost="1">
    </File>
  </Component>

</ComponentGroup>

經過近兩天的搜索並了解了app.config的工作原理,我找到了解決該問題的方法。 實際上,在部署excel加載項后,我發現它試圖從路徑---> Install Drive>:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE.config讀取app.config文件。 我什至想到將配置條目放入excel.exe.config文件中以使其正常工作,但是由於這不是正確的方法,我發現我們需要在指定vsto加載項路徑的地方更改注冊表項。 改變似乎很愚蠢

清單注冊表項需要以file:///.ie開頭,而不是“ [TARGETDIR] ExcelAddIn.vsto | vstolocal”:我們需要使用“ file:/// [TARGETDIR] ExcelAddIn.vsto | vstolocal”:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM