Retrieved Property displaying "error"

(imported topic written by SystemAdmin)


I find that when I use relevance similiar to below for application properties I can get back different results on the “Not Installed”. I will get back systems that fall into the relevance with real version numbers - but then I also can get back a lot of “errors” and “not installed”. Shouldn’t they all fall under “not installed” - if the app does not exist?

The same property looking for a different application can result in different returns also. For instance Number 1 (below) returns no systems as “not installed” - but all as “error” (if app is not installed). Number 2 reports back with “not installed” systems - but also way more with “error”.

Any reason why both would have different results? And why would they report back as “error” and not just “not installed”? Thanks for the help.

Also if the same check is done as a regapp then it does all report properly - with no errors. But in these 2 cases - the apps are not registered properly in the registry to do a regapp check.


Number 1

if (exists file “natspeak.exe” of folder “C:\Program Files\scansoft\NaturallySpeaking8\Program”) then (version of file “natspeak.exe” of folder “C:\Program Files\scansoft\NaturallySpeaking8\Program” as string) else “Not Installed”

Number 2

if (exists file “mikeapp.exe” of folder “C:\Program Files\Philips Speech\SpeechMike”) then (version of file “mikeapp.exe” of folder “C:\Program Files\Philips Speech\SpeechMike” as string) else “Not Installed”

(imported comment written by jessewk)

Your initial if clause is the cause of the errors.

Try this on a machine that doesn’t have the software installed: exists file “natspeak.exe” of folder “C:\Program Files\scansoft\NaturallySpeaking8\Program”

You’ll find you get a 'Singular expression refers to non-existent object" error. That’s because the folder doesn’t exist but your relevance clause is assuming it does.

You can fix it easily. One way is to make the folders expression plural. Non-existence for a plural object does not cause an error:

exists file “natspeak.exe” of folders “C:\Program Files\scansoft\NaturallySpeaking8\Program”

The other way is to check that the folder exists before checking for the file:

exists folder “C:\Program Files\scansoft\NaturallySpeaking8\Program” whose (exists file “natspeak.exe” of it)


(imported comment written by SystemAdmin)

Sweet! That appears to be doing the trick. Thank you so much for that. That will really clean up things.