If you haven't released yet: <Component Id="C_Component" Guid="*" Win64="$(var.Win64)"> <File Id="File.dll" Name="File.dll" Source="$(var.Source)File.dll" KeyPath="yes" /> </Component>
The only preprocessor "magic" you would need would be to ensure that your component's directory lives under a 64-bit directory for 64-bit builds. If you have released then the above won't work because your guid won't match whatever you currently have been using. -----Original Message----- From: MikeR [mailto:michael.ru...@gmail.com] Sent: Friday, January 22, 2010 6:50 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] WiX syntax for GUIDs for 32-bit/64-bit components Currently I have some WiX projects that build both an x86 and x64 MSI. Many of our components contain .NET assemblies that target Any CPU so the fact that the components differ at all is just to properly support Windows Installer method of managing x86/x64 components based on the target OS. Now, according what I've found all components installed in a such a fashion, should have a separate GUID for the x86 vs the x64 component, everything else is the same so I ended up with a component syntax like this for such components. <?if $(var.Platform)="x64" ?> <?define ComponentName.Guid="PUT-GUID-HERE" ?> <?else ?> <?define ComponentName.Guid="PUT-GUID-HERE" ?> <?endif ?> <Component Id="C_Component" Guid="$(var.ComponentName.Guid)" Win64="$(var.Win64)"> <File Id="File.dll" Name="File.dll" Source="$(var.Source)File.dll" KeyPath="yes" /> </Component> The Platform variable is handled by Votive through the default VS platform value and the Win64 variables is one I handle in a common include that checks the value of Platform and sets it to yes/no accordingly. So, two things... First, is there a better way to handle the syntax for this currently in WiX that I'm just missing? I'm using almost as much space with preprocessor logic just to get the GUID set for both platforms as I am for the component itself. I realize I could have one if/else block with all my component GUIDs but I wanted to keep all the information for each component together. Secondly, it would be really nice if there was just an additional attribute on the Component node for an x64 GUID and the compiler could use the proper GUID based on the Win64 attribute value. I'm not sure what the best implementation would be but it seems like there should be a better way of handling this scenario in the syntax that doesn't require use of preprocessor logic. Since there is currently interest on the WiX dev team to make the syntax more flexible and concise I thought I'd make this suggestion. Thanks, Mike -- View this message in context: http://n2.nabble.com/WiX-syntax-for-GUIDs-for-32-bit-64-bit-components-tp444 0404p4440404.html Sent from the wix-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users