Page 1 of 1
Checking for an application?
Posted: Sun Nov 28, 2010 7:23 am
by peter.s
Hi there,
I am trying to write a code for my project which, when the user (of the final standalone) activates a button, will initiate a check of the computer's system to see if a particular application is installed. If it can't find the application, it will return a message saying so.
I remember reading somewhere in the Rev resource material a way of doing this, but I've just spent about an hour looking for it and simply can't find it any longer.
Can someone please give me a suggestion of how to do this or where to find the information?
Cheers,
Peter
Re: Checking for an application?
Posted: Sun Nov 28, 2010 12:10 pm
by WaltBrown
For Windows, I found a VBScript that looks at the Registry for Uninstall keys, and returns a list:
http://billsway.com/vbspage/
Also for Windows, psinfo -s works well. Look for it at
www.sysinternals.com.
Walt
Re: Checking for an application?
Posted: Sun Nov 28, 2010 5:08 pm
by Mark
Hi Peter,
This should do what you want:
Code: Select all
function programs
if the platform is "MacOS" then -- only OSX!
put shell("ps -xcw") into myList
put offset("COMMAND",myList) into myColPos
repeat for each line myLine in myList
put char myColPos to -1 of myLine & cr after myNewList
end repeat
filter myNewList without "(*"
return line 2 to -1 of myNewList
else if the platform is "Win32" then
put line 4 to -1 of shell("tasklist") into myList
repeat for each line myLine in myList
put word 1 of myLine & cr after myNewList
end repeat
return line 1 to -2 of myNewList
else
return empty
end if
end programs
It should be easy to adjust this for Linux, if needed.
Best regards,
Mark
Re: Checking for an application?
Posted: Mon Nov 29, 2010 1:11 pm
by peter.s
Since posting my original message I have discovered another way of doing what I want (see below). But I'm a little confused about something.
I want the end user to click a button which will check if QuickTime is installed on the computer. If it isn't installed then a dialogue box will appear with a message instructing the user to install QuickTime.
I'm thinking of using this:
Code: Select all
on mouseUp
if the QTVersion = 0.0 then show field "DialogueBox"
else go to card 2
end mouseUp
But then I read this in the Rev dictionary:
Tip: It can take Revolution a second or two to load the code needed to use QuickTime, depending on the machine speed. Since this code is only loaded into memory once per session, you can speed up the first occurrence of a QuickTime-related action by calling the QTVersionfunction during otherwise dead time--for example, during startup of your application--to preload the code.
What does "calling the QTVersionfunction" mean in real terms?
Thanks Mark for your response. I tried the code with some success, but thought the above code is simpler - provided it works cross platform.
Cheers,
Peter
Re: Checking for an application?
Posted: Mon Nov 29, 2010 1:27 pm
by Mark
Hi Peter,
Calling a function is synonymous to "using" or "executing" that function. Your script is calling and loads QT if it is available. It is often the best solution to do this while your splash screen is showing.
Kind regards,
Mark
Re: Checking for an application?
Posted: Mon Nov 29, 2010 4:22 pm
by WaltBrown
I was limiting myself to the original inquiry: "see if a particular application is installed", "Application" and "Installed" being the operative words, not exactly the same as "see if a particular process is running".
Best, Walt
Re: Checking for an application?
Posted: Tue Nov 30, 2010 8:28 am
by peter.s
Walt - I can see how my original inquiry was misleading, thanks for the feedback it helps me understand why sometimes when I ask a question on this forum I get mixed responses.
Kind regards,
Peter