As Setup Factory has not seen an update for some time, there are some situations where you can run into unexpected issues when working on operating platforms released after the version 9.5.3.0. For example, when you use System.GetOSName() on Windows 11, the action will retrieve the name of the previous version.
This is understandable, Microsoft also did not update the ProductName and CurrentVersion strings in the operating system - they still show "Windows 10" and "6.3" respectively. Microsoft also repeatedly mention in their developer documentation that one should not need to check the operating system name and version if the application is properly designed, but here we are - there were questions from customers how to know if the host is running Windows 10 or 11 to take action / make decisions in their installers.
The Lua code attached in this post contains a backward compatible approach to retrieve the operating system name. If you call System.GetOSNameEx() for retrieving the operating system name to show in a dialog, you might get an output like shown in these samples:

A simple way to use this action would be adding the script to the project resources:

In this manner, you can update the external script if needed, like when a new build of Windows is released and further editions are published. In this case, just update the script, and rebuild the setup(s). You will not need to update each setup individually if you use shared code.
It should work for Windows Server as well. This code is provided as-is, I believe it works fine but I do not guarantee that it is error free and will work in all situations. This code is also not endorsed by Indigo Rose, it is just an attempt to help.
Ulrich
This is understandable, Microsoft also did not update the ProductName and CurrentVersion strings in the operating system - they still show "Windows 10" and "6.3" respectively. Microsoft also repeatedly mention in their developer documentation that one should not need to check the operating system name and version if the application is properly designed, but here we are - there were questions from customers how to know if the host is running Windows 10 or 11 to take action / make decisions in their installers.
The Lua code attached in this post contains a backward compatible approach to retrieve the operating system name. If you call System.GetOSNameEx() for retrieving the operating system name to show in a dialog, you might get an output like shown in these samples:
A simple way to use this action would be adding the script to the project resources:
In this manner, you can update the external script if needed, like when a new build of Windows is released and further editions are published. In this case, just update the script, and rebuild the setup(s). You will not need to update each setup individually if you use shared code.
It should work for Windows Server as well. This code is provided as-is, I believe it works fine but I do not guarantee that it is error free and will work in all situations. This code is also not endorsed by Indigo Rose, it is just an attempt to help.
Ulrich
Comment