Re: [Lazarus] Determining OS
Debian Lenny on Slug: no cat /etc/*-release, no lsb-release, , no lsb_release -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
here, on a "sligthly" old Fedora 7: cat /etc/*-release gives the following: Fedora release 7 (Moonshine) and lsb_release -a (of course, we ask for "-a" to have a handful of information...) gives: LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: Fedora Description:Fedora release 7 (Moonshine) Release:7 Codename: Moonshine both installed by default. And we are talking about something at least 3.5 years old... go figure. Just my 2c. Cheers, A. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Michael Schneider wrote: Am Monday 01 August 2011 11:58:33 schrieb Mark Morgan Lloyd: Taking that into account, I thought it worth taking a closer look at a number of systems. Slackware x86 8.1 with desktop: neither lsb_release nor xdg-open. Slackware x86 13.37 with desktop: no lsb_release, does have xdg-open. Debian armel Lenny headless: neither lsb_release nor xdg-open. Debian armel Lenny with desktop: neither lsb_release nor xdg-open. Debian armel Squeeze with desktop: has lsb_release, no xdg-open. Debian mipsel Squeeze with desktop: has lsb_release, no xdg-open. Debian zSeries Lenny with desktop: neither lsb_release nor xdg-open. Debian x86 Lenny with desktop: neither lsb_release nor xdg-open. Debian x86 Squeeze with desktop: both lsb_release and xdg-open. Debian SPARC Etch with desktop: both lsb_release and xdg-open. Debian SPARC Lenny with desktop: both lsb_release and xdg-open. Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. Same probably applies to BSD. just out of curiosity is cat /etc/*-release working? On e.g. x86 Lenny, no. Sorry I can't test in much more detail right now- gto problems. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
We motivate our customers to use Ubuntu if they decide to go the Linux route. (2) 2011/8/1 Graeme Geldenhuys > On 08/01/2011 12:49 PM, Marco van de Voort wrote: > > > > Of course, due to Linux' fragmentation, the standards are most needed on > > Linux too :-) > > Very true, and I see Linux fragmentation become more and more of a > problem. Many people would like to move off Windows for all kinds of > reasons, it's just that the thousands of Linux distros just don't seem > to want that business. Go figure! > > Luckily we are in a franchising business, so we can control out > deployment OS with some control. We motivate our franchisees to use > Ubuntu if they decide to go the Linux route. At least that way our > support staff can help them for free. > > > > Linux unification is IMHO further away then in the 1997-2000 timeframe. > > I agree. Some things have improved, but others have not. And with every > Tom, Dick and Harry wanting his own "distro" doesn't help the cause much. > > -- Atenciosamente, Alexsander da Rosa http://rednaxel.com -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 08/01/2011 03:01 PM, Michael Schneider wrote: is cat /etc/*-release working? Suse: yep. I can contribute this: Angstom (ARM distribution) no cat /etc/*-release, no lsb-release, but root@da850-omapl138-evm:~# lsb_release -a Distributor ID: Angstrom Description:Angstrom GNU/Linux 2011.03 (Dureza) Release:2011.03 Codename: Dureza -Michel -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 08/01/2011 03:01 PM, Michael Schneider wrote: > just out of curiosity > is > cat /etc/*-release > > working? $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS" Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Am Monday 01 August 2011 11:58:33 schrieb Mark Morgan Lloyd: > Taking that into account, I thought it worth taking a closer > look at a number of systems. > > Slackware x86 8.1 with desktop: neither lsb_release nor xdg-open. > > Slackware x86 13.37 with desktop: no lsb_release, does have xdg-open. > > Debian armel Lenny headless: neither lsb_release nor xdg-open. > > Debian armel Lenny with desktop: neither lsb_release nor xdg-open. > > Debian armel Squeeze with desktop: has lsb_release, no xdg-open. > > Debian mipsel Squeeze with desktop: has lsb_release, no xdg-open. > > Debian zSeries Lenny with desktop: neither lsb_release nor xdg-open. > > Debian x86 Lenny with desktop: neither lsb_release nor xdg-open. > > Debian x86 Squeeze with desktop: both lsb_release and xdg-open. > > Debian SPARC Etch with desktop: both lsb_release and xdg-open. > > Debian SPARC Lenny with desktop: both lsb_release and xdg-open. > > Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. > Same probably applies to BSD. just out of curiosity is cat /etc/*-release working? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 08/01/2011 01:32 PM, Michael Van Canneyt wrote: > > Funny to hear this from someone who rolls his own GUI toolkit instead > of using the LCL :-) Yeah, yeah. :) I think we can safely say there is a huge difference in project scale. "whole OS" vs "gui toolkit". Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On Mon, 1 Aug 2011, Graeme Geldenhuys wrote: Linux unification is IMHO further away then in the 1997-2000 timeframe. I agree. Some things have improved, but others have not. And with every Tom, Dick and Harry wanting his own "distro" doesn't help the cause much. Funny to hear this from someone who rolls his own GUI toolkit instead of using the LCL :-) Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Marco van de Voort wrote: On Mon, Aug 01, 2011 at 12:16:15PM +0200, Graeme Geldenhuys wrote: On 08/01/2011 11:58 AM, Mark Morgan Lloyd wrote: Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. Same probably applies to BSD. :-) That doesn't come as a surprise considering that they are "Linux" Standards Base. These parts are not terribly linux specific, and deal with desktop systems that are commonly used on BSD too. The "Linux" part is more branding between the big commercial desktops than that it is about operating systems. It's particularly disappointing in the case of the xdg* utilities, which are supposed to be applicable to any unix system with a mainstream desktop. Hell, they could even be shimmed onto Windows. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 08/01/2011 12:49 PM, Marco van de Voort wrote: > > Of course, due to Linux' fragmentation, the standards are most needed on > Linux too :-) Very true, and I see Linux fragmentation become more and more of a problem. Many people would like to move off Windows for all kinds of reasons, it's just that the thousands of Linux distros just don't seem to want that business. Go figure! Luckily we are in a franchising business, so we can control out deployment OS with some control. We motivate our franchisees to use Ubuntu if they decide to go the Linux route. At least that way our support staff can help them for free. > Linux unification is IMHO further away then in the 1997-2000 timeframe. I agree. Some things have improved, but others have not. And with every Tom, Dick and Harry wanting his own "distro" doesn't help the cause much. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On Mon, Aug 01, 2011 at 12:16:15PM +0200, Graeme Geldenhuys wrote: > On 08/01/2011 11:58 AM, Mark Morgan Lloyd wrote: > > > > Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. > > Same probably applies to BSD. > > :-) That doesn't come as a surprise considering that they are "Linux" > Standards Base. These parts are not terribly linux specific, and deal with desktop systems that are commonly used on BSD too. The "Linux" part is more branding between the big commercial desktops than that it is about operating systems. Of course, due to Linux' fragmentation, the standards are most needed on Linux too :-) > > xdg-open in the past, on the assumption that since it had appeared in > > some distreax and versions it would fairly rapidly be adopted by all. > > Mea culpa. > > +1 > I can't believe that distros in today's time still make it so hard for > ISV's to write common (as in distro) desktop applications. Clearly Linux > based system just don't want to compete with the likes of Mac OSX and > Windows. Maybe we should all jump ship to Haiku. Linux unification is IMHO further away then in the 1997-2000 timeframe. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Graeme Geldenhuys wrote: Can somebody confirm this for Ubuntu? Are there comparable files for other distreax? Both my Ubuntu 8.04.4 and Ubuntu 10.04.3 systems have the lsb_release and the xdg-open commands available. So I guess that's +1 to Canonical for at least trying to be helpful! Yes, but for cases where lsb_release might not work- e.g. an older release- does apt/sources.list refer to a section of their repository by name or simply as "stable" etc.? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Marco van de Voort wrote: On Sun, Jul 31, 2011 at 04:43:44PM +0200, Graeme Geldenhuys wrote: 2011/7/31 ik : Please note that system.d is Fedora implementation (v15) so for Linux you need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used. Not installed by default on Fedora 15: [marcov@atlas ~]$ lsb_release bash: lsb_release: command not found... so you can't really rely on it. Apparently the standard is optional. I've just come across its being announced on the Debian ML, circa 2000. Somebody immediately pointed out that it was curious that the copyright had been assigned to the FSF rather than to the LSB project itself. So it looks as though lsb_release is potentially a useful tool, but is not actually part of the LSB standard. http://lists.debian.org/lsb-discuss/2000/09/msg4.html -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 08/01/2011 11:58 AM, Mark Morgan Lloyd wrote: > > Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. > Same probably applies to BSD. :-) That doesn't come as a surprise considering that they are "Linux" Standards Base. > xdg-open in the past, on the assumption that since it had appeared in > some distreax and versions it would fairly rapidly be adopted by all. > Mea culpa. +1 I can't believe that distros in today's time still make it so hard for ISV's to write common (as in distro) desktop applications. Clearly Linux based system just don't want to compete with the likes of Mac OSX and Windows. Maybe we should all jump ship to Haiku. > Can somebody confirm this for Ubuntu? Are there comparable files for > other distreax? Both my Ubuntu 8.04.4 and Ubuntu 10.04.3 systems have the lsb_release and the xdg-open commands available. So I guess that's +1 to Canonical for at least trying to be helpful! Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Graeme Geldenhuys wrote: On 31 July 2011 23:10, Marco van de Voort wrote:>> Any distro worth using should support the LSB standards. With that>> being said, you can use the 'lsb_release' command to find out exactly>> what distribution and version is being used.>> Not installed by default on Fedora 15: I did say "a distro worth using". ;-) Just kidding. But thanks to all that replied regarding the lsb command. Clearly thevarious Linux distros still need to work on "standardization". Noting your earlier comments on both lsb_release and xdg-open, the first thing I'd say is that it strikes me that xdg-open is specifically a desktop-related program, i.e. it might not be installed on "headless" systems. Taking that into account, I thought it worth taking a closer look at a number of systems. Slackware x86 8.1 with desktop: neither lsb_release nor xdg-open. Slackware x86 13.37 with desktop: no lsb_release, does have xdg-open. Debian armel Lenny headless: neither lsb_release nor xdg-open. Debian armel Lenny with desktop: neither lsb_release nor xdg-open. Debian armel Squeeze with desktop: has lsb_release, no xdg-open. Debian mipsel Squeeze with desktop: has lsb_release, no xdg-open. Debian zSeries Lenny with desktop: neither lsb_release nor xdg-open. Debian x86 Lenny with desktop: neither lsb_release nor xdg-open. Debian x86 Squeeze with desktop: both lsb_release and xdg-open. Debian SPARC Etch with desktop: both lsb_release and xdg-open. Debian SPARC Lenny with desktop: both lsb_release and xdg-open. Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. Same probably applies to BSD. I find this particularly disappointing since I've used and recommended xdg-open in the past, on the assumption that since it had appeared in some distreax and versions it would fairly rapidly be adopted by all. Mea culpa. Debian can be recognised by the presence of /etc/apt/sources.list, and any version that's likely to be encountered will have the release name in the URLs it contains (older ones referenced 'stable' etc.). Can somebody confirm this for Ubuntu? Are there comparable files for other distreax? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 08/01/2011 10:17 AM, Felipe Monteiro de Carvalho wrote: It works in Mandriva Linux: [felipe@localhost fpvectorial]$ lsb_release -a Of course lsb_release -a does work with Suse as well, only without a parameter it issues a n/a. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
It works in Mandriva Linux: [felipe@localhost fpvectorial]$ lsb_release -a LSB Version: lsb-4.0-ia32:lsb-4.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch:cxx-3.2-ia32:cxx-3.2-noarch:graphics-3.2-ia32:graphics-3.2-noarch:lsb-3.0-ia32:lsb-3.0-noarch:lsb-3.2-ia32:lsb-3.2-noarch:lsb-4.0-ia32:lsb-4.0-noarch Distributor ID: MandrivaLinux Description:Mandriva Linux 2010.1 Release:2010.1 Codename: Henry_Farman -- Felipe Monteiro de Carvalho -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 07/31/2011 04:55 PM, ik wrote: I'm using Arch Linux and that is my output: $ lsb_release LSB Version:n/a same with Suse. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On 31 July 2011 23:10, Marco van de Voort wrote: >> Any distro worth using should support the LSB standards. With that >> being said, you can use the 'lsb_release' command to find out exactly >> what distribution and version is being used. > > Not installed by default on Fedora 15: I did say "a distro worth using". ;-) Just kidding. But thanks to all that replied regarding the lsb command. Clearly the various Linux distros still need to work on "standardization". -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On Sun, Jul 31, 2011 at 04:43:44PM +0200, Graeme Geldenhuys wrote: > 2011/7/31 ik : > > Please note that system.d is Fedora implementation (v15) so for Linux you > > need to detect also the Linux distro, and that's a bit more complicated. > > Any distro worth using should support the LSB standards. With that > being said, you can use the 'lsb_release' command to find out exactly > what distribution and version is being used. Not installed by default on Fedora 15: [marcov@atlas ~]$ lsb_release bash: lsb_release: command not found... so you can't really rely on it. Apparently the standard is optional. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Graeme Geldenhuys wrote: The LSB (Linux Standards Base) and the FreeDesktop.org standards aretrying to make all distros more compliant with a set of standards -making the life of any ISV and lone software developer MUCH easier.LSB and FreeDesktop.org are supported by most mainstream distros (foryears already). If your distro doesn't, use something better, or emailthe maintainers of that distro and demand better standardization. An older servo distro we've got around here has neither lsb_release nor the xdg utilities, I've not checked either of the Solaris systems. Looking at machines in my workroom, all of the Debians currently running have both, except for one Lenny which doesn't have lsb_release- other Lennies have it. So while the utilities are undoubtedly useful and underused, it's clearly important to have some sort of fallback if they turn out not to be available. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
2011/7/31 Chris Kelling : > > $ lsb_release seems to give good information, my Fedora 15 machine returns > > LSB Version: :core-4.0-ia32:core-4,0-noarch Specify some of the other parameters in the 'lsb_release' command and you will get the exact information your are looking for, on any distro that supports LSB standard. > Say what you will about the windows registry, but at least there’s a common > place to look for and put information. Well yes, it's very easy if you own the OS and there is just one or two controlled version of that OS. This applies both to Microsoft and Apple. The benefit of closed source OS's. If you want to apply the same principle, then you need to compare various Ubuntu releases to each other. The LSB (Linux Standards Base) and the FreeDesktop.org standards are trying to make all distros more compliant with a set of standards - making the life of any ISV and lone software developer MUCH easier. LSB and FreeDesktop.org are supported by most mainstream distros (for years already). If your distro doesn't, use something better, or email the maintainers of that distro and demand better standardization. -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
2011/7/31 ik : > > I'm using Arch Linux and that is my output: > > > $ lsb_release > LSB Version: n/a > Under Ubuntu 8.04 the 'lsb_release' command on it's own doesn't give any usable output either. You need to specify a parameter. eg: $ lsb_release -a See 'lsb_release --help' for more available options. As shown below: >> -- >> $ lsb_release --help >> Usage: lsb_release [options] >> >> Options: >> -h, --help show this help message and exit >> -v, --version show LSB modules this system supports >> -i, --id show distributor ID >> -d, --description show description of this distribution >> -r, --release show release number of this distribution >> -c, --codename show code name of this distribution >> -a, --all show all of the above information >> -s, --short show all of the above information in short format >> >> $ lsb_release -a >> No LSB modules are available. >> Distributor ID: Ubuntu >> Description: Ubuntu 8.04.4 LTS >> Release: 8.04 >> Codename: hardy >> >> -- -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
Thank you for the suggestions so far - $ lsb_release seems to give good information, my Fedora 15 machine returns LSB Version: :core-4.0-ia32:core-4,0-noarch In addition, I did a ls of the /etc directory and found a file called system-release-cpe, Looking in it says cpe:/o:fedoraproject:fedora:15 Now, this may be unique to fedora (isn't open source wonderful?), but if all distros have that file, I think that may be the solution, I've got an ubuntu machine running, too - I should look to see what it has. Say what you will about the windows registry, but at least there's a common place to look for and put information. And no, I don't want to start a war over the merits of one OS over another, just trying to make my program portable to the most machines with the least effort for the end user. _ From: ik [mailto:ido...@gmail.com] Sent: Sunday, July 31, 2011 10:55 To: Lazarus mailing list Subject: Re: [Lazarus] Determining OS On Sun, Jul 31, 2011 at 17:43, Graeme Geldenhuys wrote: 2011/7/31 ik : > Please note that system.d is Fedora implementation (v15) so for Linux you > need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used. I'm using Arch Linux and that is my output: $ lsb_release LSB Version:n/a $ - But I have the following file: /etc/arch-release I think that looking for /etc/*release is more reliable at the moment for distros. BTW The TRegistry class is cross platform. On Windows it uses Registry, and on other OS, it uses INI files. -- $ lsb_release --help Usage: lsb_release [options] Options: -h, --help show this help message and exit -v, --version show LSB modules this system supports -i, --id show distributor ID -d, --description show description of this distribution -r, --release show release number of this distribution -c, --codename show code name of this distribution -a, --all show all of the above information -s, --shortshow all of the above information in short format $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:Ubuntu 8.04.4 LTS Release:8.04 Codename: hardy -- -- Regards, - Graeme - Ido ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
On Sun, Jul 31, 2011 at 17:43, Graeme Geldenhuys wrote: > 2011/7/31 ik : > > Please note that system.d is Fedora implementation (v15) so for Linux you > > need to detect also the Linux distro, and that's a bit more complicated. > > Any distro worth using should support the LSB standards. With that > being said, you can use the 'lsb_release' command to find out exactly > what distribution and version is being used. > I'm using Arch Linux and that is my output: $ lsb_release LSB Version:n/a $ - But I have the following file: /etc/arch-release I think that looking for /etc/*release is more reliable at the moment for distros. BTW The TRegistry class is cross platform. On Windows it uses Registry, and on other OS, it uses INI files. > > > -- > $ lsb_release --help > Usage: lsb_release [options] > > Options: > -h, --help show this help message and exit > -v, --version show LSB modules this system supports > -i, --id show distributor ID > -d, --description show description of this distribution > -r, --release show release number of this distribution > -c, --codename show code name of this distribution > -a, --all show all of the above information > -s, --shortshow all of the above information in short format > > $ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description:Ubuntu 8.04.4 LTS > Release:8.04 > Codename: hardy > > -- > > > -- > Regards, > - Graeme - > Ido > > > ___ > fpGUI - a cross-platform Free Pascal GUI toolkit > http://fpgui.sourceforge.net > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
2011/7/31 ik : > Please note that system.d is Fedora implementation (v15) so for Linux you > need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used. -- $ lsb_release --help Usage: lsb_release [options] Options: -h, --help show this help message and exit -v, --version show LSB modules this system supports -i, --id show distributor ID -d, --description show description of this distribution -r, --release show release number of this distribution -c, --codename show code name of this distribution -a, --all show all of the above information -s, --shortshow all of the above information in short format $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:Ubuntu 8.04.4 LTS Release:8.04 Codename: hardy -- -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determining OS
2011/7/31 Chris Kelling > I’m writing a generic installer for a project, and want to set up things > like the registry or system.d depending on the OS type. Is there an > environment string, or a function to report what OS the system being hosted > on, or do I need to write different versions specifically for the OS? > you have the macros of WINDOWS, UNIX, LINUX etc... {$IFDEF WINDOWS} ... Please note that system.d is Fedora implementation (v15) so for Linux you need to detect also the Linux distro, and that's a bit more complicated. /etc/issue Can help, but also /etc/redhat /etc/debian etc.. can also help you to figure out what distro it is, but that will work only on specific distro's as well. > > > ** ** > > -Chris > Ido > > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Determining OS
I'm writing a generic installer for a project, and want to set up things like the registry or system.d depending on the OS type. Is there an environment string, or a function to report what OS the system being hosted on, or do I need to write different versions specifically for the OS? -Chris -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus