Here is an extension method that determines the bitness of Windows for pre .NET 4.0 code (.NET 4.0 has this built in). Thanks to the posters on Stack Overflow for the info.

public static class OperatingSystemExtensions
{
    [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
    [return: MarshalAs(UnmanagedType.Bool)]
    private static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool lpSystemInfo);

    public static bool Is64Bit(this OperatingSystem os)
    {
        Func<Process,bool> x32Onx64 = p =>
            { bool retVal; IsWow64Process(p.Handle, out retVal); return retVal; };

        return IntPtr.Size == 8 || (IntPtr.Size == 4 && x32Onx64(Process.GetCurrentProcess()));
    }
}

Used as follows:

if (Environment.OSVersion.Is64Bit()) ...