Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 883
Lelouch Avatar asked Sep 06 '25 00:09

Lelouch


2 Answers

For Wix 4.0.2:

Add this to your .wixproj file:

<PropertyGroup>
   <InstallerPlatform>x64</InstallerPlatform>
 </PropertyGroup>

Make sure you have set <StandardDirectory Id="ProgramFiles64Folder"> and Component.Bitness=always64 for all components

like image 191
Assaf S. Avatar answered Sep 10 '25 02:09

Assaf S.


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>
like image 42
Stein Åsmul Avatar answered Sep 10 '25 00:09

Stein Åsmul