简体   繁体   中英

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

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.

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>

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