Windows 10 not detecting on installshield
Asked Answered
C

1

2

Have requirement to detect windows 10 or greater version on install time. for that I have create following function.

It gives me 603 (AS VersionNT value) in windows 10 and windows 8.1. That is wrong.

Is there any other way to achieve this?

function BOOL isWindows10OrGreater()
 STRING svWindowsValue;
 NUMBER nWindowsValue;
 NUMBER nBuffer;
begin
     try
       nBuffer = 256;
       MsiGetProperty(ISMSI_HANDLE,"VersionNT",svWindowsValue,nBuffer);
       StrToNum(nWindowsValue,svWindowsValue);
       return (nWindowsValue >= 603);
     catch
       return FALSE;
    endcatch;
 end;
Capacious answered 17/3, 2018 at 12:15 Comment(1)
The best answer depends heavily on things that aren't clearly stated in this question, including project type, InstallShield version and why you need to know if it's Windows 10. (Recent versions of InstallShield will work fine in InstallScript projects, but MSI-based projects—including InstallScript MSI—as indicated by your use of MsiGetProperty are limited by msiexec.exe's manifest.)Eonism
C
8

Windows 10 - A Version Oddity


Disclaimer: this information is to the best of my knowledge as of now (check last edit date). This issue is sort of a "moving target" - things seem to change slightly for every OS release.


This is news to me as well, but it seems detecting Windows 10 is now a rather peculiar affair due to how core Win32 calls no longer are guaranteed to report the actual Windows version - and neither do VersionNT or VersionNT64 on my box. They both report 603 (which is Win 8 SP1). The explanation is here: VersionNT value for Windows 10 and Windows Server 2016.

Manifests & Versions: Whether your application is manifested or not is crucial here. Rather than repeating the explanation, I will link to this one (essential reading): C++ How to detect Windows 10.

"Evergreen Versionlessness": On the Microsoft rationale to do this (fight version checks - link to specific comment): Getting Windows OS version programmatically. So I suppose the question is if you should do such a version check at all - or so they want use to believe.


Installshield 2015 / 2018

I don't have Installshield available to test these features:


Workarounds?

I want to emphasize that these are workarounds and nothing else. We are supposed to check functionality these days and not OS versions. Test thoroughly please. I want to cross-link a similar answer with some "intel": VersionNT MSI property on Windows 10.

  1. OS File Version: MSDN suggests getting the version of a key OS file to determine if you are on Windows 10: Getting the system version. There seems to be an implementation of this in the bottom function here (untested).

  2. WindowsBuild property: It looks like the WindowsBuild property might be useable. It reports 9600 on my Windows 10 system. MSDN documentation for WindowsBuild with the different values for different OS versions. Remember that this value will increment with new releases, so you can't do an equal compare condition. You must do equal or higher. This is all to the best of my knowledge as of now.

  3. Registry: Maybe it is also an option to read these new registry values in order to determine if you are on Window 10 or not? Heaven knows what they will do with these keys in the future though? Are they "stable"?

  4. WMI: I see suggestions to use WMI (not properly tested by me - just listing all possible options for those who have the test machines available to verify).


Links

Here are some further links. They are not recommendations, as much as a bunch of links used to assemble the above information - so they are here for "safekeeping". I will leave them as they are. There may be some inaccuracies here and there:

Chinachinaberry answered 18/3, 2018 at 2:3 Comment(1)
Beware of this issue: github.com/wixtoolset/issues/issues/5824Darbie

© 2022 - 2024 — McMap. All rights reserved.