Detecting x86/x64 and installing correct .msi

11,096

Solution 1

The easiest way I have found to detect a 64-bit operating system is to use the VersionNT64 property. This property can be used in conditions for components or custom actions (eg. the condition Not VersionNT64 will only be true for 32-bit operating systems).

As for installing other MSI packages during your installation, that is a little trickier. Windows Installer will only allow one MSI to be running the Execute Sequence at a time. This means that you must either install your Crystal Reports MSI during the UI Sequence using a custom action (be careful if you do this, the UI Sequence is skipped if the MSI is run in silent mode), or create some kind of bootstrapper program that will run both the Crystal Reports MSI and your own in sequence.

I have never created my own bootstrapper, but InstallShield has a bootstrapper program built into their setup.exe; they call packages installed this way prerequisites.

Solution 2

Just googled it: If you have an MSI project you could check the properties like described here.

For further information about detecting process and OS architecture you might want to read this MSDN blog about "HOWTO: Detect Process Bitness".

Solution 3

You can trigger the Crystal Reports MSI with a custom action that executes [SystemFolder]msiexec. Just specify "/i [YourFolderWithCRMSI]msiname.msi" as the arguments.

Share:
11,096
Jeremy Sena
Author by

Jeremy Sena

Sysrepublic

Updated on June 04, 2022

Comments

  • Jeremy Sena
    Jeremy Sena almost 2 years

    I am finalizing an application that will soon be submitted for Windows Logo Program validation. One of the requirements is x64 compatibility. Specifically, Crystal Reports 2008 must work under x64.

    My problem is that Crystal Reports basic 2008 (the one packaged with Visual Studio 2008) has no merge modules and must be installed using the provided .msi installers. They offer separate installers for x86 and x64.

    So how would I detect x86 and x64 during install and then run the appropriate Crystal msi? Is this even possible without merge modules?

    EDIT:

    This:

    IF PROCESSOR_ARCHITECTURE == x86 AND
       PROCESSOR_ARCHITEW6432 NOT DEFINED THEN
       // OS is 32bit
    ELSE
       // OS is 64bit
    END IF
    

    seems to tell me how to detect it (thanks MicSim). But how do I perform this in an MSI? Is it a custom action? And then how do I trigger different required msi's for the x32 and x64 crystal reports?

    And why doesn't the x86 crystal installer work under WOW64? You have to install x64 Crystal to work with your WOW64 x86 app. Frustrating...

    EDIT 2:

    Okay, so detecting x86/x64 seems to be covered here. Now how about manually triggering an msi of your choosing?

  • Andrew Shepherd
    Andrew Shepherd almost 15 years
    You might also want to add /q as a parameter, so that it doesn't bother the customer.
  • KargWare
    KargWare about 4 years
    VersionNT64 is supported with Windows Installer v4. Msix64 is supported since Windows Installer v3.1, see stackoverflow.com/questions/2458550/…