简体   繁体   中英

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

I'm getting very frustrated at the following warnings from light.exe that I'm getting when trying to use a merge module in my WiX installer project within VS2010:

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

(repeated for each file in the merge module).

Both the merge module and the product WiX files are part of the same VS2010 solution. Both merge module and product contain a <Package> element that specifies Platform="x64". The fragment in the merge module .wxs file looks like this:

<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>

Since I even put my component element inside of the ProgramFiles64Folder directory, and I've marked the platform as "x64", why am I getting this error? What other places control the 64-bitness of a directory in a WiX package file?

A merge module should have an abstraction such as MergeRedirectFolder so that when you consume them in the installer you associate MergeRedirectFolder with the actual [ProgramFiles]Company\\Product target using the Directory and Merge elements.

Also if these files are meant to go into the GAC, there is a special folder identifier called GlobalAssemblyCache that can achieve this.

The following just worked for me:

<?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>

Then in the main installer:

<?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>

Finally:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM