Detect Operating System
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Detect Operating System
Hello,
I am looking to develop an app that will do something based on what system its runing on .. ie. if this is a Windows machine do this, or if Mac do soemthing else.. ALso like this can be installed on a Android but not iphone
I am looking to develop an app that will do something based on what system its runing on .. ie. if this is a Windows machine do this, or if Mac do soemthing else.. ALso like this can be installed on a Android but not iphone
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Detect Operating System
read 'SystemVersion' in the dictionary....
Re: Detect Operating System
Ok thanks.. does not really help as I dont know how to write code for it
thanks
thanks
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Detect Operating System
for example...
Code: Select all
on openCard
put the systemVersion into temp
if temp = "10.9.0" then
answer "This Mac is running 'Mavericks'"
end if
end openCard
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Detect Operating System
The systemVersion will tell you the OS version number. To know which platform your app is running on see the platform function, e.g.:
Code: Select all
switch the platform
case "MacOS"
DoMacStuff
break
case "Win32"
DoWinStuff
break
case "Linux"
DoLinuxStuff
break
end switch
Sometimes the folks who help here in the forums will have the spare time to write example code for you, but many times they'll just help you identify the tokens needed - at that point you'll want to use the Dictionary included in LiveCode to learn about how the token works, see examples of its usage, and review the related "See Also" items.Ok thanks.. does not really help as I dont know how to write code for it
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9476
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Detect Operating System
"Win32" on any version of Windows
"Linux" on all Linux distributions
"MacOS" on any version of Mac OS X
"iphone" on iPhones, iPads and other iOS devices
"android" on smartphones, tablets and other Android devices
"HTML5" when running in a web browser
Well, Yes, But . . .
How does one differentiate between 32-bit and 64-bit variants of Windows?
How does one differentiate between 32-bit and 64-bit variants of Linux?
How does one differentiate between 32-bit and 64-bit variants of MacOS? [and before anyone makes a noise,
a pre-10.15 MacOS version while being 64-bit can run a 32-bit program].
MacOS 10.7.5 < 32 or 64-bit apps < MacOS 10.15.0
How does one detect that one is running a Windows standalone on WINE?
How does one detect ReactOS? [OK, OK, OK; I just bunged this one in to be snotty].
"Linux" on all Linux distributions
"MacOS" on any version of Mac OS X
"iphone" on iPhones, iPads and other iOS devices
"android" on smartphones, tablets and other Android devices
"HTML5" when running in a web browser
Well, Yes, But . . .
How does one differentiate between 32-bit and 64-bit variants of Windows?
How does one differentiate between 32-bit and 64-bit variants of Linux?
How does one differentiate between 32-bit and 64-bit variants of MacOS? [and before anyone makes a noise,
a pre-10.15 MacOS version while being 64-bit can run a 32-bit program].
MacOS 10.7.5 < 32 or 64-bit apps < MacOS 10.15.0
How does one detect that one is running a Windows standalone on WINE?
How does one detect ReactOS? [OK, OK, OK; I just bunged this one in to be snotty].
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Detect Operating System
To distinguish processors use the processors function.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Detect Operating System
I guess neither of you remember the thread that Richmond already brought this up in, where it was discovered that no variation of commands in Lc will tell you any of that, short of dropping to the shell (if available).
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Detect Operating System
I remember it well. I was as surprised as you were that this thread was necromanced with a question so thoroughly addressed so much more recently.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9476
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Detect Operating System
Is that a fact?so thoroughly addressed so much more recently
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Detect Operating System
Why do you imagine I might have both time and interest to mislead you in a way that would be so easily disproven with a quick search?richmond62 wrote: ↑Wed Apr 22, 2020 5:53 pmIs that a fact?so thoroughly addressed so much more recently
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Detect Operating System
A search for "systemVersion" shows this thread as the first result, a conversation from Feb 21 through March 3, covering nearly every aspect of system profiling information included in LC, and many using external tools:
https://forums.livecode.com/viewtopic.php?f=6&t=33707
With a quick skim it looks like you posted half a dozen contributions to that four-page thread.
https://forums.livecode.com/viewtopic.php?f=6&t=33707
With a quick skim it looks like you posted half a dozen contributions to that four-page thread.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Detect Operating System
Well, it was only 4 pages after all
-
- Livecode Opensource Backer
- Posts: 9476
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Detect Operating System
I would not just suppose anyone on this list would want to mislead me: the word I took issue
with was "thoroughly" which is a highly subjective term.
with was "thoroughly" which is a highly subjective term.
Re: Detect Operating System
On the other side of that, the answer(s) given were pretty definitive, your not going to get that information from Lc, and the reasons why. You can, in desktop cases anyway, get the information by directly interrogating the OS, Lc just isn't going to build in a way to get it through the language.