Re: Checking the host OS

2019-09-01 Thread JB via use-livecode
On OS X in the terminal you can type:  sysctl hw.machine
and it will display the machine architecture.

I don’t use the shell commands much but it looks like you
can get the info without compiling code by using the code
below.

on mouseUp
   put shell( "sysctl hw.machine" ) into pData
   put pData
end mouseUp

JB


> On Aug 30, 2019, at 8:41 PM, Devin Asay via use-livecode 
>  wrote:
> 
> On Aug 30, 2019, at 9:10 PM, Mark Wieder via use-livecode 
>  wrote:
>> 
>>> On 8/30/19 12:22 PM, Devin Asay via use-livecode wrote:
>>> 
>>> Now that we can build both 32 and 64 bit applications for Windows, it’s 
>>> important to be able to tell whether the host OS is 32 or 64 bit.
>> 
>> Why? If the 64-bit application won't run on the 32-bit system you won't get 
>> as far as your scripted test. Am I missing something?
> 
> No, I’m just toying with the idea of having a 32-bit launcher that would 
> examine the host OS, then launch the proper executable based on whether it is 
> 32 or 64 bit. Sort of like a poor man’s universal app like we used to create 
> for MacOS. It’s possible I’m use way overthinking this. 
> 
> -D
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-31 Thread Mark Waddingham via use-livecode

On 2019-08-31 04:41, Devin Asay via use-livecode wrote:

No, I’m just toying with the idea of having a 32-bit launcher that
would examine the host OS, then launch the proper executable based on
whether it is 32 or 64 bit. Sort of like a poor man’s universal app
like we used to create for MacOS. It’s possible I’m use way
overthinking this.


I think you might be overthinking this...

The Windows world is different from mac because the former don't have 
the

idea of multi-architecture binaries.

Obviously on mac this isn't something you have to worry about - 
especially
since versions of macOS going back many years have supported 64-bit as 
have

the machines it runs on.

On Windows it is usual for the user to choose whether they want 32-bit 
or
64-bit versions of the apps they download and install. This is usually 
guided
by the webpages which offer downloads as you can usually assume that if 
the user
is on a 64-bit windows machine, then the browser they are running will 
be 64-bit
which means that you can tell from the UserAgent string what 
architecture their

machine has and so you can guide the user to the right choice.

In an end-user setting, you could always have a dialog which pops up 
when running
the 32-bit version on a 64-bit machine (by using Dar's suggestion) on 
first run
to suggest the user might want to download the 64-bit version - however, 
you then
have to ask yourself whether your app actually benefits from being 
64-bit enough

to justify this extra complexity.

In an organizational setting then one would hope that the IT department 
would
know what to do when presented with the choice of both a 32-bit and a 
64-bit

build of a Windows app... In reality this may or may not be the case ;)

So my suggestion (in general - obviously specific circumstances always 
apply) is
don't worry about it. Offer two downloads explicitly named and marked - 
one as
32-bit one as 64-bit and then, if you can, guide the user to the right 
choice
online by offering the appropriate build (which Chrome does, for 
example, adding
further weight to being able to rely on the bitness of the browser 
accessing your

download site).

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread JB via use-livecode
Below is some c code that will return the architecture on
OS X.

/*  Determine the machine name, e.g. "x86_64". */

#include 
#include 
#include 
#include 

int main(int argc, const char * argv[]) {
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);  // Get size of data to 
be returned.
char *name = malloc(size);
sysctlbyname("hw.machine", name, &size, NULL, 0);

// Do stuff...
printf("%s\n", name);
free(name);

return 0;
}


/*
 Output:
 
 x86_64
 Program ended with exit code: 0
*/

Compile the above code and access it with a shell command.

JB


> On Aug 30, 2019, at 8:41 PM, Devin Asay via use-livecode 
>  wrote:
> 
> On Aug 30, 2019, at 9:10 PM, Mark Wieder via use-livecode 
>  wrote:
>> 
>>> On 8/30/19 12:22 PM, Devin Asay via use-livecode wrote:
>>> 
>>> Now that we can build both 32 and 64 bit applications for Windows, it’s 
>>> important to be able to tell whether the host OS is 32 or 64 bit.
>> 
>> Why? If the 64-bit application won't run on the 32-bit system you won't get 
>> as far as your scripted test. Am I missing something?
> 
> No, I’m just toying with the idea of having a 32-bit launcher that would 
> examine the host OS, then launch the proper executable based on whether it is 
> 32 or 64 bit. Sort of like a poor man’s universal app like we used to create 
> for MacOS. It’s possible I’m use way overthinking this. 
> 
> -D
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Mark Wieder via use-livecode

On 8/30/19 8:41 PM, Devin Asay via use-livecode wrote:


No, I’m just toying with the idea of having a 32-bit launcher that would 
examine the host OS, then launch the proper executable based on whether it is 
32 or 64 bit. Sort of like a poor man’s universal app like we used to create 
for MacOS. It’s possible I’m use way overthinking this.


OK. I'm with Dar on this then.
Check for the existence of folder "C:/Windows/SysWOW64".
If it exists then you're on a 64-bit machine.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Mark Wieder via use-livecode

On 8/30/19 8:41 PM, Tom Glod via use-livecode wrote:


on win32 i will run out of ram and lock up if not hard crash before
it even gets to it..and if i can test the standalone bitness I can
decline to attempt an impossible feat.


Ah. OK - so you're deploying a 32-bit application possibly onto a 64-bit 
machine. It makes sense to avoid the crash/lockup that way.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Tom Glod via use-livecode
I have personal experience with trying to create a graphic that is 32,000 x
32,000 and exporting it.

on win32 i will run out of ram and lock up if not hard crash before
it even gets to it..and if i can test the standalone bitness I can
decline to attempt an impossible feat.

on win64 i could try it and if the system has enough ram, then it should
succeed.  I also have to increase the cache size to huge amounts to try to
create huge images.

I think the highest i succeeded in a 32 bit standalone was like 14k x
14kit was 3 years ago where i did those testsand don't remember the
details only that i was hitting the 32 bit memory wall.

thats one example of when asking the engine if its 32bit or 64 bit would
help.

On Fri, Aug 30, 2019 at 11:10 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 8/30/19 12:22 PM, Devin Asay via use-livecode wrote:
>
> > Now that we can build both 32 and 64 bit applications for Windows, it’s
> important to be able to tell whether the host OS is 32 or 64 bit.
>
> Why? If the 64-bit application won't run on the 32-bit system you won't
> get as far as your scripted test. Am I missing something?
>
> --
>   Mark Wieder
>   ahsoftw...@gmail.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Devin Asay via use-livecode
On Aug 30, 2019, at 9:10 PM, Mark Wieder via use-livecode 
 wrote:
> 
>> On 8/30/19 12:22 PM, Devin Asay via use-livecode wrote:
>> 
>> Now that we can build both 32 and 64 bit applications for Windows, it’s 
>> important to be able to tell whether the host OS is 32 or 64 bit.
> 
> Why? If the 64-bit application won't run on the 32-bit system you won't get 
> as far as your scripted test. Am I missing something?

No, I’m just toying with the idea of having a 32-bit launcher that would 
examine the host OS, then launch the proper executable based on whether it is 
32 or 64 bit. Sort of like a poor man’s universal app like we used to create 
for MacOS. It’s possible I’m use way overthinking this. 

-D
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Mark Wieder via use-livecode

On 8/30/19 12:22 PM, Devin Asay via use-livecode wrote:


Now that we can build both 32 and 64 bit applications for Windows, it’s 
important to be able to tell whether the host OS is 32 or 64 bit.


Why? If the 64-bit application won't run on the 32-bit system you won't 
get as far as your scripted test. Am I missing something?


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Dar Scott Consulting via use-livecode
Oh...

1. Yes, one way is to parse the exe. (offset, offset, check for "PE\0\0", next 
two bytes)

2. Check for WoW64 redirection. (I'm not sure how, though.)

> On Aug 30, 2019, at 6:10 PM, Tom Glod via use-livecode 
>  wrote:
> 
> I think he is asking to find out if the BUILD is 32 or 64 bit.  In that
> case the platform() function really has to be updated. but there is
> porobably a way by reading the magic (file header) bytes of the
> standalone.  But can't be sure.
> 
> On Fri, Aug 30, 2019 at 5:43 PM Dar Scott Consulting via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> 1. Check for files and folders that are are required on one or do not
>> exist on one.
>> 
>> Program Files (x86)
>> SysWOW64
>> 
>> 2. systeminfo
>> 
>> 
>> 
>>> On Aug 30, 2019, at 1:22 PM, Devin Asay via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> I know we can get all manner of information about the host system our
>> stack or application is running on, including platform(), processor(), and
>> machine() but is there a way to check to see whether the host OS is 32 or
>> 64 bit? The platform function on Windows always returns Win32 regardless of
>> which version of Windows is running, and the processor reports x86_32 or
>> x86_64, depending on the host machine’s CPU.
>>> 
>>> Now that we can build both 32 and 64 bit applications for Windows, it’s
>> important to be able to tell whether the host OS is 32 or 64 bit. But I
>> can’t work out if these functions let us get that information. For
>> instance, on my Windows 10 64-bit system I get:
>>> 
>>> The platform: Win32
>>> The processor: x86_64
>>> The machine: x86_64
>>> 
>>> But I just had a user report that they were unable to run a new build of
>> one of my Windows applications, which I had built as 64 bit. I’m sending
>> them a 32-bit build, but I got to thinking, would there be a way to check
>> that from within LiveCode?
>>> 
>>> Any ideas?
>>> 
>>> Devin
>>> 
>>> Devin Asay
>>> Brigham Young University
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Tom Glod via use-livecode
I think he is asking to find out if the BUILD is 32 or 64 bit.  In that
case the platform() function really has to be updated. but there is
porobably a way by reading the magic (file header) bytes of the
standalone.  But can't be sure.

On Fri, Aug 30, 2019 at 5:43 PM Dar Scott Consulting via use-livecode <
use-livecode@lists.runrev.com> wrote:

> 1. Check for files and folders that are are required on one or do not
> exist on one.
>
> Program Files (x86)
> SysWOW64
>
> 2. systeminfo
>
>
>
> > On Aug 30, 2019, at 1:22 PM, Devin Asay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi all,
> >
> > I know we can get all manner of information about the host system our
> stack or application is running on, including platform(), processor(), and
> machine() but is there a way to check to see whether the host OS is 32 or
> 64 bit? The platform function on Windows always returns Win32 regardless of
> which version of Windows is running, and the processor reports x86_32 or
> x86_64, depending on the host machine’s CPU.
> >
> > Now that we can build both 32 and 64 bit applications for Windows, it’s
> important to be able to tell whether the host OS is 32 or 64 bit. But I
> can’t work out if these functions let us get that information. For
> instance, on my Windows 10 64-bit system I get:
> >
> > The platform: Win32
> > The processor: x86_64
> > The machine: x86_64
> >
> > But I just had a user report that they were unable to run a new build of
> one of my Windows applications, which I had built as 64 bit. I’m sending
> them a 32-bit build, but I got to thinking, would there be a way to check
> that from within LiveCode?
> >
> > Any ideas?
> >
> > Devin
> >
> > Devin Asay
> > Brigham Young University
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Checking the host OS

2019-08-30 Thread Dar Scott Consulting via use-livecode
1. Check for files and folders that are are required on one or do not exist on 
one. 

Program Files (x86)
SysWOW64

2. systeminfo



> On Aug 30, 2019, at 1:22 PM, Devin Asay via use-livecode 
>  wrote:
> 
> Hi all,
> 
> I know we can get all manner of information about the host system our stack 
> or application is running on, including platform(), processor(), and 
> machine() but is there a way to check to see whether the host OS is 32 or 64 
> bit? The platform function on Windows always returns Win32 regardless of 
> which version of Windows is running, and the processor reports x86_32 or 
> x86_64, depending on the host machine’s CPU.
> 
> Now that we can build both 32 and 64 bit applications for Windows, it’s 
> important to be able to tell whether the host OS is 32 or 64 bit. But I can’t 
> work out if these functions let us get that information. For instance, on my 
> Windows 10 64-bit system I get:
> 
> The platform: Win32
> The processor: x86_64
> The machine: x86_64
> 
> But I just had a user report that they were unable to run a new build of one 
> of my Windows applications, which I had built as 64 bit. I’m sending them a 
> 32-bit build, but I got to thinking, would there be a way to check that from 
> within LiveCode?
> 
> Any ideas?
> 
> Devin
> 
> Devin Asay
> Brigham Young University
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Checking the host OS

2019-08-30 Thread Devin Asay via use-livecode
Hi all,

I know we can get all manner of information about the host system our stack or 
application is running on, including platform(), processor(), and machine() but 
is there a way to check to see whether the host OS is 32 or 64 bit? The 
platform function on Windows always returns Win32 regardless of which version 
of Windows is running, and the processor reports x86_32 or x86_64, depending on 
the host machine’s CPU.

Now that we can build both 32 and 64 bit applications for Windows, it’s 
important to be able to tell whether the host OS is 32 or 64 bit. But I can’t 
work out if these functions let us get that information. For instance, on my 
Windows 10 64-bit system I get:

The platform: Win32
The processor: x86_64
The machine: x86_64

But I just had a user report that they were unable to run a new build of one of 
my Windows applications, which I had built as 64 bit. I’m sending them a 32-bit 
build, but I got to thinking, would there be a way to check that from within 
LiveCode?

Any ideas?

Devin

Devin Asay
Brigham Young University
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode