2

I am writing a simple code to install a file in the Program Files folder, NOT Program Files (x86)

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFiles64Folder">
            <Directory Id="INSTALLFOLDER" Name="Del">
                <Directory Id="MyFolder" Name="MyFolder"/>
            </Directory>
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <Component Id="Component1" Directory="MyFolder" Win64="yes">
       <File Id="FirstFile.txt"/>
    </Component>
</Fragment>

Basically it should create a folder del in Program Files and in it, it should create folder MyFolder which would contain FirstFile.txt

If I do it for Id = ProgramFilesFolder , it works by installing in Program Files (x86)

Changing it to ProgramFiles64Folder gives the following error

ICE80: This package contains 64 bit component 'Component1' but the Template Summary Property does not contain Intel64 or x64.   

My Question is from where or how can I change the Template Summary property ?

Thanks in Advance

Lelouch
  • 37
  • 4

2 Answers2

1

From https://www.joyofsetup.com/2010/05/14/working-hard-or-hardly-working/#manually-marking-package-and-component-bitness:

Specify the -arch switch at the candle.exe command line or the InstallerPlatform property in a .wixproj MSBuild project. When you specify x64 or intel64, Candle automatically sets the package and components in the file being compiled as 64-bit.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
1

Arnson's Approach: Do check out the answer from Bob Arnson. Here is an extract from his blog: "It’s typical to want to produce both 32-bit and 64-bit packages from the same WiX source, so a common approach is to make the @Win64 attribute value a preprocessor variable." Hence he uses a compiler switch to compile either x32 or x64-bit version MSI files from the same source.

And no: you can not support both with architectures with one MSI. See this blog from Heath Stewart: Different Packages are Required for Different Processor Architectures.


"Hard Coded" Way: Here is an old sample you can try: https://github.com/glytzhkof/WiXBitnessX64

Some extracts:

Package element:

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

Component element:

<Component Feature="ProductFeature" Win64="yes">
  <File Source="$(env.SystemRoot)\notepad.exe" />
</Component>
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164