cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

SYSINFO wrong value?

I'm using SYSINFO.WINNT.bWin7_Server2008R2 and SYSINFO.WINNT.bWinVista_Server2008 to determine if the OS is Windows 7 or Vista. I've tested it on a Win7 machine, yet it gets false for the bWin7 check and true for bWinVista. I double checked this by getting the VersionNT64 value and it's 601, which is the correct Windows 7 code. Is there a bug with SYSINFO that is giving me the incorrect operating system?
Labels (1)
0 Kudos
5 Replies
anom217
Level 8

Has anyone even used SYSINFO?
0 Kudos
anom217
Level 8

Does anyone else with Windows 7 or Vista encounter a problem when using SYSINFO to check the operating system in use?
0 Kudos
GetExp
Level 6

I feel there is a problem in the comparison. instead of SYSINFO you can use the registries to get the OS value or Getsysteminfo or some other API's
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

If you are running this InstallScript code as part of a custom action in an MSI project, the cause of this behavior is the AppCompat layer on Windows is lying about the OS version to the msiexec.exe process that hosts the custom action. The following article contains some additional information:
Why Custom Actions get a Windows Vista Version Lie on Windows 7

Unfortunately, we have no way to resolve this for InstallScript custom actions since the OS is causing the behavior. The best solution is to read the VersionNT/VersionNT64 properties to obtain the correct OS version.
0 Kudos
anom217
Level 8

Strange, I didn't know that about Windows 7. And yes I did end up switching to VersionNT/VersionNT64 to get the correct version. Thanks.
0 Kudos