簡體   English   中英

是什么使MSI目錄為“ 32位”或“ 64位”?

[英]What is it that makes a MSI directory “32-bit” or “64-bit”?

當我嘗試在VS2010中的WiX安裝程序項目中使用合並模塊時,收到來自light.exe的以下警告,我感到非常沮喪:

ICE80: This 64BitComponent F_AdaptersInGac.5AE08CC6_EB8E_4F10_AB7B_CEFD0CB0F832 
       uses 32BitDirectory GAC.5AE08CC6_EB8E_4F10_AB7B_CEFD0CB0F832

(對於合並模塊中的每個文件重復)。

合並模塊和產品WiX文件都是同一VS2010解決方案的一部分。 合並模塊和產品都包含一個<Package>元素,該元素指定Platform =“ x64”。 合並模塊.wxs文件中的片段如下所示:

<Package Id="{5AE08CC6-EB8E-4F10-AB7B-CEFD0CB0F832}" InstallerVersion="200" Languages="1033" Manufacturer="Yoyodyne Propulsion Systems" Platform="x64" />
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFiles64Folder">

    <!-- Assemblies that go in the GAC -->
    <Directory Id="GAC" SourceName="GAC">
       <Component Id="C_AdaptersInGac" Guid="{C1C7D6F8-197D-874E-79B9-EBFEBDDCB65A}" Win64="yes">
         <File Id="F_AdaptersInGac" Name="ERPLink.Adapters.SharePoint.dll" KeyPath="yes" Assembly=".net" Source="..\Internal\Adapters\Release\Contoso.Adapters.dll" />
      </Component>
    </Directory>
  </Directory>
</Directory>

由於我什至將我的component元素放在ProgramFiles64Folder目錄中,並且將平台標記為“ x64”,所以為什么會出現此錯誤? WiX軟件包文件中還有哪些其他地方控制目錄的64位?

合並模塊應該具有諸如MergeRedirectFolder之類的抽象,以便在安裝程序中使用它們時,可以使用Directory和Merge元素將MergeRedirectFolder與實際的[ProgramFiles] Company \\ Product目標相關聯。

同樣,如果這些文件是要放入GAC的,則有一個名為GlobalAssemblyCache的特殊文件夾標識符可以實現此目的。

以下僅對我有用:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?define ComponentRules="OneToOne"?>
  <!-- SourceDir instructs IsWiX the location of the directory that contains files for this merge module -->
  <?define SourceDir="..\Deploy"?>
  <Module Id="StrongNameMM" Language="1033" Version="1.0.0.0">
    <Package Id="0085d1f6-e7cf-413e-ae3c-cd1a1e0afb1b" Manufacturer="StrongNameMM" InstallerVersion="200" Platform="x64" />
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="MergeRedirectFolder">
        <Component Id="owc457F6083DF7B557CCA84E132209AC321" Guid="9ab7d95e-7841-3ff9-ffac-87a6b7633636" Win64="yes">
          <File Id="owf457F6083DF7B557CCA84E132209AC321" Source="$(var.SourceDir)\ClassLibrary1.dll" KeyPath="yes" Assembly=".net"/>
        </Component>
      </Directory>
    </Directory>
  </Module>
</Wix>

然后在主安裝程序中:

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

    <FeatureGroup Id="features">
      <Feature Id="StrongName" Title="StrongName" Description="Installs all the files needed for StrongName" Level="1" AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION">
        <MergeRef Id="StrongNameMM"/>
      </Feature>
    </FeatureGroup>

    <!-- Content -->
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFiles64Folder">
        <Directory Id="CompanyFolder" Name="My Company">
          <Directory Id="INSTALLLOCATION" Name="StrongName">
            <Merge Id="StrongNameMM" SourceFile="$(var.StrongNameMM.TargetPath)" DiskId="1" Language="1033"/>
          </Directory>
        </Directory>
      </Directory>
    </Directory>

  </Fragment>
</Wix>

最后:

 <Package InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Platform="x64" />

暫無
暫無

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

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