[Gambas-user] check 4 Gambas Runtime files?
mikeB
mb at code-it.com
Thu Dec 14 18:18:43 CET 2017
mikeB here again (i'm sure that most folks think i should just go away &
figure it out myself- but just maybe others have these same questions?
amd i'm having a heck of a time 'figuring it out myself' ;-(
*******************************************************
In comparing a setup file (VB6 to Gambas):
VB6 INSTALL = the script of almost all M$ Windows install files includes
at the very beginning the current VB runtime files (at least in any
setup I ever created) to make sure the end users' system is up to date
with the software being installed.
GAMBAS INSTALL = if an app is developed using Gambas version 3.10 and
the end users system has v3.8 runtime files installed (or none) the
program (end user app) will not install - comes back with the message
that v.10 runtime files are required. Not a peep on how to get them or
offer to do it automatically.
********************************************************
So - my question is = would there be a way to include the v.10 runtime
files in the install script - to upgrade if needed - just like a VB6
install? And if so, would that cause any unforeseen problems?
For the somewhat advanced Linux user - none of this matters much
cuz they are use to handling these issues - but my concern is the
person that just switched from Wins 10 to Linux 3 days ago - as I have
a large following that I'm trying to help make the switch not only to
Linux but to Gambas programming;-) I want the end user to have NO
problems installing a Gambas programmed app - just double click the file
(to install) like they are use to. Not having to check v or anything
else - just double click the file.
Sorry for the long post as some of it was prob unnecessary,
have a GREAT day,
mikeB
On 12/13/2017 02:22 PM, Gianluigi wrote:
> Right, not only the runtime is not installed, nothing is installed.
>
> Regards
> Gianluigi
>
> 2017-12-13 20:25 GMT+01:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
>
>> That does not install anything. It just adds the repo and updates.
>>
>>
>> Jussi
>>
>> On Wed, Dec 13, 2017 at 8:58 PM, Gianluigi <bagonergi at gmail.com> wrote:
>>
>>> Sorry maybe I'm wrong, but I know this:
>>>> sudo add-apt-repository ppa:gambas-team/gambas3
>>>> sudo apt-get update
>>> It does not install the runtime but only the libraries and therefore what
>>> we are saying here is useless.
>>>
>>> Regards
>>> Gianluigi
>>>
>>> 2017-12-13 19:25 GMT+01:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
>>>
>>>> There is standard for exit codes.
>>>> http://www.tldp.org/LDP/abs/html/exitcodes.html
>>>>
>>>>
>>>> Jussi
>>>>
>>>> On Wed, Dec 13, 2017 at 8:02 PM, T Lee Davidson <
>>>> t.lee.davidson at gmail.com> wrote:
>>>>
>>>>> [shell-script]
>>>>> #!/bin/bash
>>>>>
>>>>> which gbx3 &>/dev/null
>>>>> if [ $? -ne 0 ]; then
>>>>> echo "Gambas runtime (gbx3) not found in path. Cannot continue."
>>>>> exit 1 # arbitrary exit code of your choice
>>>>> fi
>>>>>
>>>>> if [[ $(gbx3 -e 'Comp(System.FullVersion, "3.10", gb.Natural) >= 0') ==
>>>>> "False" ]]; then
>>>>> echo "So sorry."
>>>>> exit 2 # also an arbitrary exit code
>>>>> fi
>>>>>
>>>>> # Great, do Gambas stuff now
>>>>> [/shell-script]
>>>>>
>>>>> The line under the "which" statement basically says, "If the exit code
>>>>> from the 'which' command is not equal to zero, then..."
>>>>>
>>>>>
>>>>> Strangely on my system, this prints, "So sorry," even though my package
>>>>> manager says version 3.10.0 of gambas-runtime is
>>>>> installed. I have to assume that's an issue with the packager.
>>>>>
>>>>>
>>>>> --
>>>>> Lee
>>>>>
>>>>> On 12/13/2017 12:33 PM, mikeB wrote:
>>>>>> OKAY then - I'll try that (what Tobi wrote). I just didn't really
>>>>> understand it but I will after hack'n at it for awhile;-)
>>>>>> THANKS - we can put this subject to bed unless someone has
>>>>>> something else,
>>>>>> mikeB
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 12/13/2017 08:44 AM, Karl Reinl wrote:
>>>>>>> Am Mittwoch, den 13.12.2017, 08:26 -0700 schrieb mikeB:
>>>>>>>> thats what i was thinking (works only if Gambas is installed) but
>>>>> wasn't
>>>>>>>> sure.
>>>>>>>>
>>>>>>>> I really would prefer NOT to force the end user to install Gambas
>>>>> but
>>>>>>>> only the v10 runtime files that are required to run the Gambas
>>>>> developed
>>>>>>>> software/ program. A terminal command to just check if the v10
>>>>> runtime
>>>>>>>> files are installed is really what I was looking for;-)
>>>>>>>>
>>>>>>>> thanks to all that have taken to time to respond -
>>>>>>>> it's highly APPRECIATED! Have learned something from every post.
>>>>>>>> mikeB
>>>>>>>>
>>>>>>>> On 12/13/2017 07:43 AM, PICCORO McKAY Lenz wrote:
>>>>>>>>> the suggestin from tobias are the best for check a specific
>>>>> version string,
>>>>>>>>> due return a exact result, not an interpretative result
>>>>>>>>>
>>>>>>>>> good, but only works if gambas are installed, if not return
>>>>> "commando not
>>>>>>>>> found"
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Lenz McKAY Gerardo (PICCORO)
>>>>>>>>> http://qgqlochekone.blogspot.com
>>>>>>>>>
>>>>>>>>> 2017-12-13 9:21 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at gmail.com
>>>>>> :
>>>>>>>>>
>>>>>>>>>> gbx3 -V
>>>>>>>>>> or
>>>>>>>>>> gbx3 --version
>>>>>>>>>>
>>>>>>>>>> Works also...
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Jussi
>>>>>>>>>>
>>>>>>>>>> On Wed, Dec 13, 2017 at 9:54 AM, Tobias Boege <taboege at gmail.com>
>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> On Tue, 12 Dec 2017, mikeB wrote:
>>>>>>>>>>>> On my web site, that I offer software programmed using Gambas,
>>>>> I have a
>>>>>>>>>>>> notice :
>>>>>>>>>>>> ************************************************************
>>>>> ***********
>>>>>>>>>>>> VERY IMPORTANT: before installing this app you will need to
>>>>> install
>>>>>>>>>>> Gambas
>>>>>>>>>>>> Runtime v10 files - most systems will not have these very new
>>>>> files
>>>>>>>>>>>> installed yet.
>>>>>>>>>>>>
>>>>>>>>>>>> Do so via the terminal commands:
>>>>>>>>>>>> sudo add-apt-repository ppa:gambas-team/gambas3
>>>>>>>>>>>> sudo apt-get update
>>>>>>>>>>>> ************************************************************
>>>>> ***********
>>>>>>>>>>>> Now that Gambas runtime 10 files are more common - being
>>>>> install by the
>>>>>>>>>>>> Distro - is there a way for the user (terminal command) to
>>>>> check if
>>>>>>>>>>> they are
>>>>>>>>>>>> installed?
>>>>>>>>>>>>
>>>>>>>>>>>> This is a real newbie question I'm sure but hey.. I'm a newbie!
>>>>>>>>>>>> Thanks for any all help on this matter and have a GREAT day,
>>>>>>>>>>>> mikeB
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> First check if the interpreter gbx3 is found in PATH, using the
>>>>> "which"
>>>>>>>>>>> utility. If not, I wouldn't call Gambas properly installed
>>>>> (although
>>>>>>>>>>> some people might disagree -- it's their computer -- but then
>>>>> they will
>>>>>>>>>>> be able to figure their Gambas version out themselves).
>>>>>>>>>>>
>>>>>>>>>>> Once you have that, the System class has FullVersion which gives
>>>>> you the
>>>>>>>>>>> Gambas version as a string and you can compare it like this:
>>>>>>>>>>>
>>>>>>>>>>> $ gbx3 -e 'Comp(System.FullVersion, "3.10", gb.Natural) >= 0'
>>>>>>>>>>>
>>>>>>>>>>> Comp will return the sign (-1, 0 or 1) of subtracting the
>>>>> version 3.10
>>>>>>>>>>> from your Gambas version. You want the comparison to yield 0 or
>>>>> 1.
>>>>>>>>>>> With the above line, you will see either the string "True" or
>>>>> "False"
>>>>>>>>>>> printed to the terminal; you can make the output fancier.
>>>>>>>>>>>
>>>>>>>>>>> NOTE: gb.Natural makes the comparison by natural sort, which is
>>>>>>>>>>> appropriate
>>>>>>>>>>> to compare version numbers. Observe:
>>>>>>>>>>>
>>>>>>>>>>> $ gbx3 -e 'Comp("3.2", "3.10")'
>>>>>>>>>>> 1
>>>>>>>>>>> $ gbx3 -e 'Comp("3.2", "3.10", gb.Natural)'
>>>>>>>>>>> -1
>>>>>>>>>>>
>>>>>>>>>>> Because "2" comes before "1" in the alphabet, the default
>>>>> lexicographic
>>>>>>>>>>> comparison mode declares the string "3.2" to be greater than
>>>>> "3.10",
>>>>>>>>>>> but gb.Natural gets it right.
>>>>>>>>>>>
>>>>>>>>>>> Also never coerce the string version into a float for easier
>>>>> comparison
>>>>>>>>>>> because you'll run into nasty bugs caused by float roundoff.
>>>>>>>>>>>
>>>>>>>>>>> Regards,
>>>>>>>>>>> Tobi
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> "There's an old saying: Don't change anything... ever!" -- Mr.
>>>>> Monk
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>
>>>>>>> Salut mikeB,
>>>>>>>
>>>>>>> reread what Tobi wrote: "which" is the magic command for that.
>>>>>>>
>>>>>>
>>>>>> --------------------------------------------------
>>>>>>
>>>>>> This is the Gambas Mailing List
>>>>>> https://lists.gambas-basic.org/listinfo/user
>>>>>>
>>>>>> Hosted by https://www.hostsharing.net
>>>>>
>>>>> --------------------------------------------------
>>>>>
>>>>> This is the Gambas Mailing List
>>>>> https://lists.gambas-basic.org/listinfo/user
>>>>>
>>>>> Hosted by https://www.hostsharing.net
>>>>>
>>>>
>>>>
>>>>
>>>> --------------------------------------------------
>>>>
>>>> This is the Gambas Mailing List
>>>> https://lists.gambas-basic.org/listinfo/user
>>>>
>>>> Hosted by https://www.hostsharing.net
>>>>
>>>>
>>>
>>>
>>> --------------------------------------------------
>>>
>>> This is the Gambas Mailing List
>>> https://lists.gambas-basic.org/listinfo/user
>>>
>>> Hosted by https://www.hostsharing.net
>>>
>>>
>>
>>
>> --------------------------------------------------
>>
>> This is the Gambas Mailing List
>> https://lists.gambas-basic.org/listinfo/user
>>
>> Hosted by https://www.hostsharing.net
>>
>>
>
>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
More information about the User
mailing list