Thanks Jacob, Btw, I’m using WiX 3.9 R2, hoping to go to 3.10 when it is stable.
Your solution appears to work, but I have 4 questions about it: 1. The log is strange when I upgrade. I installed version 1.1.4 of my app, then built version 1.1.5, and installed it. In the log for the upgrade, the pertinent lines (I think) are, after detect begin: Setting version variable 'VCInstalledx86 ' to value ’12.0.21005.0' and a few lines down: Plan begin, 3 packages, action: Install Condition 'NOT VCInstalledx86' evaluates to true. I would have expected it to evaluate to false - so I’m not sure what’s going on? 2. In ProductSearch, I’m using the ProductCode attribute. However, I notice in the WiX Toolset documentation<http://wixtoolset.org/documentation/manual/v3/xsd/wix/productsearch.html>, there is no ProductCode attribute for ProductSearch. There is a required UpgradeCode. Yet your solution works, so I assume the documentation is wrong? If so, should that be reported to someone? 3. I’m not clear what ProductCodes to use. I’m using the 2013 versions. I found this site, which for 2013 lists 2 guids for x64 and 2 for x86. How can there be 2 product codes each? What do I really need to check? 4. According to a comment on this post, it sounds like I don’t need to check at all - just run the appropriate vcredist, and it will do its own checking to see if it’s already there. Is that true? Also, in case it is useful to others, a few things I did to get this solution to build: 1. add attribute xmlns:util="http://schemas.microsoft.com/wix/UtilExtension” to the WiX element 2. delete the spaces in <? else ?> 3. create an identical if..else at the same level as <Chain> for the ProductSearch’s, to get around this error: error CNDL0203 : The Chain element contains an unsupported extension element 'util:ProductSearch'. The Chain element does not currently support extension elements. Is the util:ProductSearch element using the correct XML Namespace? So in my Bundle element I have: <?if $(var.Platform) = "x86" ?> <util:ProductSearch Variable="VCInstalledx86 " ProductCode="{13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}"/> <?else?> <util:ProductSearch Variable="VCInstalledx64 " ProductCode="{929FBD26-9020-399B-9A7A-751D61F0B942}"/> <?endif?> <Chain> <?if $(var.Platform) = "x86" ?> <ExePackage SourceFile="$(var.KarteDir)\install\win\vcredist_x86.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="NOT VCInstalledx86"/> <?else?> <ExePackage SourceFile="$(var.KarteDir)\install\win\vcredist_x64.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="NOT VCInstalledx64" /> <?endif?> Thanks, David On Jul 1, 2015, at 5:49 PM, Hoover, Jacob <jacob.hoo...@greenheck.com<mailto:jacob.hoo...@greenheck.com>> wrote: You could use a preprocessor condition. IE: <?if $(var.Bitness) = "x86" ?> <util:ProductSearch Variable="VCInstalled " ProductCode="{????}"/> <ExePackage SourceFile="$(var.KarteDir)\install\win\vcredist_x86.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="NOT VCInstalled"/> <? else ?> <util:ProductSearch Variable="VCInstalled " ProductCode="{????}"/> <ExePackage SourceFile="$(var.KarteDir)\install\win\vcredist_x64.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="NOT VCInstalled" /> <?endif?> -----Original Message----- From: David Burson [mailto:david_bur...@ntm.org] Sent: Wednesday, July 01, 2015 2:37 PM To: General discussion about the WiX toolset. Subject: [WiX-users] how can I set InstallCondition based on whether my bundle is 32 or 64 bit? Hi, I have a single bundle.wxs I use when I’m creating either a 64-bit and a 32-bit installer for my app. In my Chain, I have: <ExePackage SourceFile="$(var.KarteDir)\install\win\vcredist_x64.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="VersionNT64"/> <ExePackage SourceFile="$(var.KarteDir)\install\win\vcredist_x86.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="NOT VersionNT64"/> So, the InstallCondition is checking the hardware my users are installing on to see which vcredist to install. Instead, I want the InstallCondition to decide which vcredist to install based on whether the installer is build as 32 or 64 bit. That way my users can install the 32-bit version of my app on a 64-bit OS if they want. I have a variable I pass in to the bundle that is set to either “x86” or “x64”. But I can’t figure out the syntax for how to use that variable in the InstallCondition for the vcredist’s, or how to create a boolean variable (e.g., Bundle_is_x64) that I can set based on the value of the string variable I pass in. Can someone point me in the right direction? Or maybe there’s a better way than using my own variable? Thanks David ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users