Is there a way to find out if my program is running on XP embedded? I've tried .NET System.Environment.OSVersion, but the version information looks like that of a "normal" Windows XP, except for the minor version number, and relying on that seems to fragile to me.
A Microsoft eMVP (Bing Chen) on Egg Head Cafe suggests GetVersionEx and a particular version registry key...
1. Call API
BOOL GetVersionEx(LPOSVERSIONINFO lpVersionInfo);
OSVERSIONINFOEX
structure (which is the output of this call)One of the members is
wSuiteMask
(a WORD variable).Check the
VER_SUITE_EMBEDDEDNT
(0x00000040) flag in this variable.2. Query value in Registry
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Product-Options] Key Name: ProductSuite Type:(In XP Pro, it seems that no content in this key)
MULTI_SZ Value: EmbeddedNT
While Helen Elcock suggests looking for the FBA registry value:
I check for for the DWORD registery value
[HKEY_LOCAL_MACHINE\SYSTEM\FBA]
You only get first boot assistant on embedded.
GetVersionEx seems like the more stable approach, because someone might remove the FBA key in an effort to save another couple bytes, but I'm not sure if removing that key would cause the FBA to run again anyway. You'll probably be fine with either approach.