DaveO
DaveO

Reputation: 1989

$(var.Platform) giving x86 on x64 platform?

I have a WiX msi contained as a package in a Burn bundle compiled for x86. Within the msi I have this code:

  <?if $(var.Platform) = x64 ?>
  <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?else ?>
  <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
  <?endif?>

  <!-- directory structures -->
  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="$(var.PlatformProgramFilesFolder)">
        <Directory Id="INSTALLFOLDER" Name="MyApp">
          <Directory Id="MyFolder" Name="MyFolder" />
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="MyComponents" Directory="MyFolder">
      <Component Id="MyComponent">
        <File Id="MyFile" Source="file.dat" Vital="yes" KeyPath="yes"/>
      </Component>
    </ComponentGroup>
  </Fragment>

I'd expect this to install to the Program Files folder on a 64-bit system, but it's installing to Program Files (x86). Is this because the bundle is running as 32-bit? How do I test for the actual OS architecture in the MSI if that's the case?

Upvotes: 1

Views: 2216

Answers (1)

Bob Arnson
Bob Arnson

Reputation: 21886

You need a 64-bit package to write to the 64-bit portion of the file system. That's an MSI limitation.

Upvotes: 1

Related Questions