static boolean isWindows7() method in ij.IJ.java?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

static boolean isWindows7() method in ij.IJ.java?

Bill Mohler
I have found a way in which Windows7 handles command line calls to
"netuse" differently than do previous Windows versions (including Vista,
I believe).  I would love to have my macro detect if a user is running 7
rather than something earlier, so I can modify my command line to the OS
specifically in each case.  Would it be possible to add a static boolean
isWindows7() method in ij.IJ.java?  I see that isVista() currently
accepts Windows7 for true, but I think that will break my functionality
with any users still running Vista.

Many thanks,
Bill
Reply | Threaded
Open this post in threaded view
|

Re: static boolean isWindows7() method in ij.IJ.java?

dscho
Hi,

On Mon, 17 Jan 2011, Bill Mohler wrote:

> I would love to have my macro detect if a user is running 7 rather than
> something earlier

What does

        print(call("java.lang.System.getProperty", "os.version"));

show? If it starts with "7.", you could use the startsWith() function to
test for Windows 7 (according to a quick web search, Windows Vista
returns something starting with "6.").

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: static boolean isWindows7() method in ij.IJ.java?

Bill Mohler
Sounds like a good solution.  I'll give it a try...

On 1/17/11 5:41 PM, Johannes Schindelin wrote:
> print(call("java.lang.System.getProperty", "os.version"));
>