Is WiX Burn 3.8 failing to set the NTSuitePersonal built-in variable correctly?

0

The WiX 3.8 Burn built-in variables include some values that describe the operating system edition. One of these is NTSuitePersonal. This variable is set to zero on an operating system where I would expect it to return as non-zero. This is preventing me from defining installation conditions for my application.

I wrote a little C# command line app to call GetVersionEx and retrieve an OSVERSIONINFOEX structure with the relevant flags. I'm running it on two machines. If I check the first machine, the System Information dialog shows the OS Name as "Microsoft Windows 8.1 Enterprise N". The command line output is as follows:

wSuiteMask & VER_SUITE_PERSONAL: 0x00000100 & 0x00000200 = 0x00000000
wSuiteMask & VER_SUITE_SINGLEUSERTS: 0x00000100 & 0x00000100 = 0x00000100

The second machine shows the OS Name as "Microsoft Windows 8.1", and it has the following output:

wSuiteMask & VER_SUITE_PERSONAL: 0x00000300 & 0x00000200 = 0x00000200
wSuiteMask & VER_SUITE_SINGLEUSERTS: 0x00000300 & 0x00000100 = 0x00000100

Based on this, I would expect the NTSuitePersonal WiX Burn built-in variable to be non-zero on the second machine, but it is set to zero on both. Here is what I see in my log file:

Variable: NTSuitePersonal = 0

Have I overlooked something, or is this a defect in Burn?

For reference, the full text of my command line app follows:

using System;
using System.Runtime.InteropServices;

namespace OperatingSystemInfoSandbox
{
    class Program
    {
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public class OSVERSIONINFOEX
        {
            public int dwOSVersionInfoSize;
            public int dwMajorVersion;
            public int dwMinorVersion;
            public int dwBuildNumber;
            public int dwPlatformId;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
            public string szCSDVersion;
            public UInt16 wServicePackMajor;
            public UInt16 wServicePackMinor;
            public UInt16 wSuiteMask;
            public byte wProductType;
            public byte wReserved;
            public OSVERSIONINFOEX()
            {
                this.dwOSVersionInfoSize = (int)Marshal.SizeOf(typeof(OSVERSIONINFOEX));
            }
        }

        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern bool GetVersionEx([In, Out] OSVERSIONINFOEX osvi);

        public const UInt16 VER_SUITE_PERSONAL = 0x00000200;
        public const UInt16 VER_SUITE_SINGLEUSERTS = 0x00000100;

        static void Main(string[] args)
        {
            var osvi = new OSVERSIONINFOEX();
            GetVersionEx(osvi);
            Console.WriteLine("wSuiteMask & VER_SUITE_PERSONAL: 0x{0:x8} & 0x{1:x8} = 0x{2:x8}",
                osvi.wSuiteMask, VER_SUITE_PERSONAL, osvi.wSuiteMask & VER_SUITE_PERSONAL);
            Console.WriteLine("wSuiteMask & VER_SUITE_SINGLEUSERTS: 0x{0:x8} & 0x{1:x8} = 0x{2:x8}",
                osvi.wSuiteMask, VER_SUITE_SINGLEUSERTS, osvi.wSuiteMask & VER_SUITE_SINGLEUSERTS);
            Console.ReadKey();
        }        
    }
}
windows
wix
burn
wix3.8
asked on Stack Overflow Nov 3, 2014 by Dan Jagnow

1 Answer

1

Please file a bug. Looks like it doesn't properly check the mask.

answered on Stack Overflow Nov 3, 2014 by Bob Arnson

User contributions licensed under CC BY-SA 3.0