I\'m using WixUI_Advanced sequence to allow users pick per-machine or per-user installation and change destination folder. My WiX project is i
I think you need to set the Win64
property to Yes
for one of the nodes.
Something like this would probably do the trick:
<MajorUpgrade AllowSameVersionUpgrades="yes"
DowngradeErrorMessage="Can't downgrade."
Schedule="afterInstallInitialize" />
<Property Id="APPLICATIONFOLDER" Secure="yes">
<RegistrySearch Id="FindInstallLocation"
Root="HKLM"
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[WIX_UPGRADE_DETECTED]"
Name="InstallLocation"
Type="raw"
Win64="yes" />
</Property>
<CustomAction Id="Overwrite_WixSetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[ProgramFiles64Folder][ApplicationFolderName]" Execute="immediate" />
<InstallUISequence>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallExecuteSequence>
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" />
UPDATE: SetDirectory
schedules the action prior to WixSetDefaultPerMachineFolder
- code updated for manually scheduled elements to schedule between WixSetDefaultPerMachineFolder
and WixSetPerMachineFolder
. Tested OK with OP sample code under Win7 x64
UPDATE2: Added action to set ARPINSTALLOCATION
as http://robmensching.com/blog/posts/2011/1/14/ARPINSTALLLOCATION-and-how-to-set-it-with-the-WiX-toolset
I had to change two things to make WIX put my 64-bit app in the Program Files folder:
A. In the WIX Package element, add 'Platform="x64"':
‹Package Description="desc..." Manufacturer="company..." InstallerVersion="200" Platform="x64" Compressed="yes" /›
B. In the Directory element for the top folder, change ProgramFilesFolder to ProgramFiles64Folder:
‹Directory Id="ProgramFiles64Folder" Name="PFiles"›
(I also had to include the ‹program name› .exe.config file in the folder for the program to work correctly)