Search code examples
c#winformslaunch-condition

Check if OS is 32 bit or 64 bit before application install in C# windows application


I want to validate a 32 bit application install on a 64 bit machine where I need to show some information to the user before installing the application. Is this possible?

I am using the launch condition (Not VersionNT64) for 32 bit and (VersionNT64) for 64 bit but that is not working properly!


Solution

  • I'm not quite sure I understand your issue, but if I assume that you have two different installers, one for 32bits and one for 64 bits, you would have to make a small executable that will wrap the two installers and select the correct MSI file.

    Environment.Is64BitOperatingSystem
    

    will show you what kind of OS you are currently on.