<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Operating System &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/operating-system/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Wed, 23 Feb 2022 00:54:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.5</generator>
	<item>
		<title>Getting the Operating System Version Information</title>
		<link>https://blog.xojo.com/2022/02/22/getting-the-operating-system-version-information/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Wed, 23 Feb 2022 00:54:05 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=9970</guid>

					<description><![CDATA[It is useful to know the version of the operating system your app is running on. You might use this information to access a feature that is only available on certain OS versions or perhaps you want to include it in logging data to help troubleshoot. Regardless, you can fetch this information from the System.VersionData class.]]></description>
										<content:encoded><![CDATA[
<p>Sometimes it is useful to know the version of the operating system your app is running on. You might use this information to access a feature that is only available on certain OS versions or perhaps you want to include it in logging data to help troubleshoot.</p>



<p>Either way, you can fetch this information from the <a href="https://documentation.xojo.com/api/os/system.versiondata.html">System.VersionData</a> class, which you access from the System.Version method. You can get the specific MajorVersion, MinorVersion and PatchVersion numbers. For display purposes you can get the version as a string with the ToString method:</p>



<pre class="wp-block-preformatted">Label1.Text = System.Version.ToString</pre>



<p>Here is what you might see for various operating systems:</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img fetchpriority="high" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.39.53@2x.png" alt="" class="wp-image-9972" width="288" height="314" srcset="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.39.53@2x.png 624w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.39.53@2x-275x300.png 275w" sizes="(max-width: 288px) 100vw, 288px" /><figcaption>macOS</figcaption></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.41.03@2x.png" alt="" class="wp-image-9973" width="249" height="303" srcset="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.41.03@2x.png 462w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.41.03@2x-247x300.png 247w" sizes="(max-width: 249px) 100vw, 249px" /><figcaption>Linux</figcaption></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.48.21@2x.png" alt="" class="wp-image-9978" width="260" height="305" srcset="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.48.21@2x.png 458w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.48.21@2x-255x300.png 255w" sizes="(max-width: 260px) 100vw, 260px" /><figcaption><br>Windows</figcaption></figure></div>



<p></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.46.24@2x.png" alt="" class="wp-image-9977" width="411" height="180" srcset="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.46.24@2x.png 986w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.46.24@2x-300x131.png 300w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.46.24@2x-768x336.png 768w" sizes="auto, (max-width: 411px) 100vw, 411px" /><figcaption>iOS</figcaption></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.53.14@2x.png" alt="" class="wp-image-9982" width="359" height="194" srcset="https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.53.14@2x.png 934w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.53.14@2x-300x162.png 300w, https://blog.xojo.com/wp-content/uploads/2022/02/CleanShot-2022-02-04-at-11.53.14@2x-768x414.png 768w" sizes="auto, (max-width: 359px) 100vw, 359px" /><figcaption>Android</figcaption></figure></div>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p>For more on this topic see other posts: <a href="https://blog.xojo.com/2019/07/29/using-ide-and-system-version-specific-code/">Using IDE and System Version Specific Code</a> and <a href="https://blog.xojo.com/2020/01/28/tip-get-the-os-version-in-your-xojo-apps/">Tip: Get the OS version in your Xojo Apps.</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Tip: Get the OS version in your Xojo Apps</title>
		<link>https://blog.xojo.com/2020/01/28/tip-get-the-os-version-in-your-xojo-apps/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 28 Jan 2020 10:00:32 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=6557</guid>

					<description><![CDATA[In some cases it may be of interest to also get the Build Phase of the OS; so I built you a class you can use to get both the Major and Minor version of the OS as the Build Phase on macOS, Windows and iOS. In addition, you can use this class with Xojo releases previous to Xojo 2019r3.]]></description>
										<content:encoded><![CDATA[<p>Among other enhancements and new features, Xojo 2019r3 introduces the new <code>System.Version</code> method which, in combination with the <code>VersionData</code> class, lets us get (and even compare) the current version of the Operating System our Xojo app is running on (macOS, Windows, Linux and iOS).</p>
<p>In some cases it may be of interest to also get the <i>Build Phase</i> of the OS; so I built you a class you can use to get both the Major and Minor version of the OS as the Build Phase on macOS, Windows and iOS. In addition, you can use this class with Xojo releases previous to Xojo 2019r3.</p>
<p>Basically, with this class you&#8217;ll be using the same instance (Singleton Design Pattern) to get any of the provided values, or to get the composed string containing all the OS version information ready to be displayed.</p>
<p>To get the values we are interested in, this class calls the <code>GetVersionExA</code> on Windows (Kernel32 library), while the message invoked on macOS and iOS is <code>processInfo</code> from the class <code>NSProcessInfo</code> (<code>Foundation</code> Framework). In order to call the Windows function we need to provide a data structure that will be filled with the required data (among other). Also in this case, the Major and Minor values are the ones published by Microsoft for the <code>OSVersionInfoA</code> data structure.</p>
<p>So, for example, you can use the following code snippet to get the OS version values and to display the composed string:</p>
<pre>Dim majorVersion As Integer = AXOSVersion.MajorVersion
Dim minorVersion As Integer = AXOSVersion.MinorVersion
Dim buildVersion As Text = AXOSVersion.BuildVersion

MessageBox AXOSVersion.VersionString</pre>
<p>Observe that the first three lines of code shows how you can get any of the version values, while the last one will display the composed string (you may want to use MsgBox instead of MessageBox on API 1.0 Xojo Releases.)</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-6558 size-large" src="https://blog.xojo.com/wp-content/uploads/2020/01/OSVersion-1024x526.png" alt="" width="1024" height="526" srcset="https://blog.xojo.com/wp-content/uploads/2020/01/OSVersion-1024x526.png 1024w, https://blog.xojo.com/wp-content/uploads/2020/01/OSVersion-300x154.png 300w, https://blog.xojo.com/wp-content/uploads/2020/01/OSVersion-768x395.png 768w, https://blog.xojo.com/wp-content/uploads/2020/01/OSVersion-1536x789.png 1536w, https://blog.xojo.com/wp-content/uploads/2020/01/OSVersion.png 1691w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>You can download the AXOSVersion class from <a href="https://www.dropbox.com/s/b0z7txuy5a0qf2j/AXOSVersion.zip?dl=1">this link</a>.</p>
<p>Of course, if you only need to get the Major, Minor and Debug version (and also compare these values against a particular OS version string), then you just need to use <code>System.Version.ToText</code> on Xojo 2019r3 and later. For example, the following code snippet compares the OS version of the computer our app is running on against a concrete value, so we can execute a block of code or other depending on the result (among other possibilities):</p>
<pre>If System.Version &gt;= "10.14.1" Then

Else

End If</pre>
<p>To summarize, in both cases you can get better flexibility in the behaviour of your Xojo apps comparing in run-time the OS version of the computer they are running on! (Xojo 2019r3 and later even works with Linux!)</p>
<p>You can <a href="http://www.xojo.com/download">download the latest Xojo Release here</a>!</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
