visual-studiowixwindows-installerx86-64program-files

How can I insert Intel64 or x64 in Template Summary in an MSI project of Wix Toolkit?


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


Solution

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