Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: OS.get_version to get OS version string #31895

Closed
fogine opened this issue Sep 2, 2019 · 10 comments
Closed

Feature: OS.get_version to get OS version string #31895

fogine opened this issue Sep 2, 2019 · 10 comments

Comments

@fogine
Copy link
Contributor

fogine commented Sep 2, 2019

Godot version:

3.1.1

Issue description:

There should be a way to get platform specific OS version...

Proposed API:

OS.get_version()

There seem to be no workaround for iOS devices (without creating a native module) as to my knowledge its only possible to access this information programmatically via Swift/Objective C..

@bojidar-bg
Copy link
Contributor

What would get_version() return? The native version string such as 4.4 for android, or something containing the platform as well (such as Android 4.4 or iOS 3.4.2)?

@fogine
Copy link
Contributor Author

fogine commented Sep 2, 2019

@bojidar-bg
I think the good idea is for it to return full version string only without platform as there is already OS.get_name method.

@akien-mga
Copy link
Member

I think the good idea is for it to return full version string only without platform as there is already OS.get_name method.

That's not really sufficient as OS.get_name() returns Linux/X11 on linux distros, so you still need to know which distro that is, e.g.:

$ cat /etc/release 
Mageia release 7 (Official) for x86_64

@bojidar-bg
Copy link
Contributor

On Linux, I would expect get_version to give me the kernel version; distribution should be listed as well though.

@fogine
Copy link
Contributor Author

fogine commented Sep 2, 2019

Some linux distros dont even have a version, like Arch Linux in that case I'd consider Arch Linux (from os_release) as a linux version.. I think, given the diversity, get_version could return strictly formated composed string eg. distro_name + version_if_any...

uname -a gives me
Linux archlaptop 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 GNU/Linux

which is not really helpful to get from higher level API in gdscript.. and the kernel version is too much low level identifier

@zaksnet
Copy link
Contributor

zaksnet commented Sep 3, 2019

On Windows, Mac, IOS and android it can just return the version number, for windows for example:

if it is Windows XP the return value should be 5.1
if it is Windows Vista, 6.0

  • Windows 7: 6.1
  • Windows 8: 6.2
  • Windows 8.1: 6.3
  • Windows 10: 10.0

You can then compare the value and do the appropriate actions depending on the OS version.

OSX:

  • El Capitan: 10.11.0

IOS:

  • 4.3, 6.1 etc.

Android:

  • Android Marshmallow: 6.0 to 6.0.1
  • Android Nougat: 7.0 to 7.1
  • Android Oreo: 8.0 to 8.1
  • Android Pie: 9.0

The returned value should be the float value of the version so that you can easily compare it.
For linux it could return an array with ["distro_name":"some_distro", "os_version":"some_version"]

EDIT: The above version numbers are actual representations of the os, version of these platforms.

@bojidar-bg
Copy link
Contributor

The returned value should be the float value

Nope. It would be better to have it similar Engine.get_version_info(), containing major, minor, and patch versions as integers.

@zaksnet
Copy link
Contributor

zaksnet commented Sep 3, 2019

The returned value should be the float value

Nope. It would be better to have it similar Engine.get_version_info(), containing major, minor, and patch versions as integers.

But, what is the point of returning the full string of the version? What is the use case of it? If for example, you want to compare it and do some action depending on the version number, you'd have to remove the text and possible do more unnecessary actions. Maybe, return an array for all platforms with os_name, os_version for windows/osx and kernel, minor, major, build for linux.

@TimHu6001
Copy link

Hi,

Is there any update on this effort?

@KoBeWi
Copy link
Member

KoBeWi commented May 25, 2020

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants