otp icon indicating copy to clipboard operation
otp copied to clipboard

os:version() gives always {6,2,9200}

Open obi458 opened this issue 3 months ago • 2 comments

Describe the bug os:version() gives always {6,2,9200} on windows higher than 8.1

To Reproduce os:version() on Windows 11, Version 25H2

Expected behavior os:version() on Windows 11, Version 25H2 should be {10,0,26200} Versionnummbers: https://www.gaijin.at/de/infos/windows-versionsnummern

Affected versions OTP Versions that support windows

Additional context

In Windows 8.1 and later, the GetVersion and GetVersionEx functions have been deprecated.

https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa

.../win32/sys.c

.....

erts_sys_pre_init(void) { erts_thr_init_data_t eid = ERTS_THR_INIT_DATA_DEF_INITER; int_os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&int_os_version);

.....

obi458 avatar Nov 12 '25 11:11 obi458

Maybe missing compatibility in Manifest.xml!?

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <!-- Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!-- Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
            <!-- Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!-- Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
            <!-- Windows 10 -->
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
        </application>
    </compatibility>

obi458 avatar Nov 13 '25 10:11 obi458

I changed the Manifest.xml resource in erl.exe and it works!

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
      </assemblyIdentity>
    </dependentAssembly>
  </dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <!-- Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!-- Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
            <!-- Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!-- Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
            <!-- Windows 10 -->
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
        </application>
    </compatibility>

 <ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
  <ms_asmv2:security>
   <ms_asmv2:requestedPrivileges>
    <ms_asmv2:requestedExecutionLevel level="AsInvoker" uiAccess="false"></ms_asmv2:requestedExecutionLevel>
   </ms_asmv2:requestedPrivileges>
  </ms_asmv2:security>
 </ms_asmv2:trustInfo>
</assembly>

obi458 avatar Nov 13 '25 16:11 obi458