[英]Is WiX Burn 3.8 failing to set the NTSuitePersonal built-in variable correctly?
WiX 3.8 Burn 內置變量包括一些描述操作系統版本的值。 NTSuitePersonal
是其中之一。 在我希望它返回非零值的操作系統上,此變量設置為零。 這使我無法定義應用程序的安裝條件。
我編寫了一個C#命令行小程序來調用GetVersionEx並檢索帶有相關標志的OSVERSIONINFOEX結構 。 我在兩台機器上運行它。 如果我檢查第一台計算機,則“系統信息”對話框將OS名稱顯示為“ Microsoft Windows 8.1 Enterprise N”。 命令行輸出如下:
wSuiteMask & VER_SUITE_PERSONAL: 0x00000100 & 0x00000200 = 0x00000000
wSuiteMask & VER_SUITE_SINGLEUSERTS: 0x00000100 & 0x00000100 = 0x00000100
第二台計算機將操作系統名稱顯示為“ Microsoft Windows 8.1”,並且具有以下輸出:
wSuiteMask & VER_SUITE_PERSONAL: 0x00000300 & 0x00000200 = 0x00000200
wSuiteMask & VER_SUITE_SINGLEUSERTS: 0x00000300 & 0x00000100 = 0x00000100
基於此,我希望NTSuitePersonal
WiX Burn內置變量在第二台計算機上為非零,但在兩者上均設置為零。 這是我在日志文件中看到的內容:
Variable: NTSuitePersonal = 0
我是否忽略了某些內容,或者這是Burn的缺陷?
作為參考,我的命令行應用程序的全文如下:
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();
}
}
}
請提交錯誤。 好像沒有正確檢查面罩。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.