Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Oct 24, 2019 12:25 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How can I test programatically if OpenOffice.Org is installe
PostPosted: Sun Oct 16, 2011 3:01 pm 
Offline

Joined: Fri Sep 30, 2005 10:49 pm
Posts: 504
Hello,
How can I test programatically if OpenOffice.Org is installed?

I am of the opinion that it is something like this...

dim f as FolderItem
Dim r as RegistryItem
Dim ret as string

r=new RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\OpenOffice.org\.....
ret=r.DefaultValue

if lenb(ret)=0 then
msgbox "OpenOffice not found"
return

... I am missing a part.

Thanks.

Lennox


Top
 Profile  
Reply with quote  
 Post subject: Re: How can I test programatically if OpenOffice.Org is inst
PostPosted: Tue Oct 25, 2011 5:29 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
Well first off you are putting that registyItem into the user's registry, so that's not a good thing, and you probably won't have the permissions to do that in that Hive.

You need to just test to see if the Path is there

r=new RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\OpenOffice.org", False)

That won't attempt to create the folder but will throw an error if it doesn't exist. If you trap an error it's not there, if you don't it's there.

You can also find the .exe in the Program Files folder.


Top
 Profile  
Reply with quote  
 Post subject: Re: How can I test programatically if OpenOffice.Org is inst
PostPosted: Tue Oct 25, 2011 5:47 pm 
Offline

Joined: Fri Sep 30, 2005 10:49 pm
Posts: 504
Thanks, that will work most of the times when combined... I will use that for now.

What if the user deleted the exe?
r=new RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\OpenOffice.org", False) would be true

What if the user removed the folder from the Program Files folder and put it on the Desktop?

Is there a fool-proof way?

Lennox


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group