Topic
8 replies Latest Post - ‏2008-09-12T13:16:11Z by SystemAdmin
SystemAdmin
SystemAdmin
2808 Posts
ACCEPTED ANSWER

Pinned topic Singular expression refers to nonexistent object

‏2008-09-10T14:17:27Z |
Greetings.

We're writing an analysis that determines if the Google Desktop Search Engine is installed, and if so, is it currently indexing user email. Here's what we're using:

if (exists key "HKLM\Software\Google\Desktop" of registry) then (if (exists file (value "data_dir" of key "HKEY_CURRENT_USER\Software\Google\Google Desktop" of registry as string & "\outlook_data")) then ("Google Desktop installed. Outlook Index = YES") else ("Google Desktop installed. Outlook Index = NO")) else ("No Google Desktop")

On machines where the index file exists, the result is <error> - Singular expression refers to nonexistent object. We can manually verify that the file is, in fact, there. When we run this relevance through QnA, local to the machine that has the index file, it works just fine. It only appears to fail when we deploy it through BigFix as an analysis.

Everything else seems to work fine - It will report if the GDSE does not exist, and will report where it does exist but the index is not present.

Any help is greatly appreciated.
Updated on 2008-09-12T13:16:11Z at 2008-09-12T13:16:11Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2808 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-10T16:08:18Z  in response to SystemAdmin
    Hey Mike,

    It seems like you are checking two different registry keys, the first and second key paths don't match:

    1. exists key "HKLM\Software\Google\Desktop" of registry

    2. value "data_dir" of key "HKEY_CURRENT_USER\Software\Google\Google Desktop" of registry

    I would do the existence check like this:

    exists key "HKEY_CURRENT_USER\Software\Google\Google Desktop" whose (exists value "data_dir" of it) of registry
  • SystemAdmin
    SystemAdmin
    2808 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-10T17:07:03Z  in response to SystemAdmin
    I considered that, but I thought that since the second "if" was nested, it wouldn't matter. It's an easy enough change to make, and test. Right now, I'm more inclined to think that this has something to do with the fact that I'm looking at HKCU. The "sticky" at the top of the Fixlet Authoring forum discusses this, and it sounds like it could be an issue.
  • SystemAdmin
    SystemAdmin
    2808 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-10T17:50:25Z  in response to SystemAdmin
    Oh yeah, I missed that! See the sticky for how to inspect the HKCU branch
  • SystemAdmin
    SystemAdmin
    2808 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-10T18:21:34Z  in response to SystemAdmin
    Ok. I tried that. (or think I did.)

    if (exists key "HKLM\Software\Google\Desktop" of registry) then (if (exists file (value "data_dir" of keys "HKEY_CURRENT_USER\Software\Google\Google Desktop" of current user keys (logged on users) of registry as string & "\outlook_data")) then ("Google Desktop installed. Outlook Index = YES") else ("Google Desktop installed. Outlook Index = NO")) else ("No Google Desktop")

    Now it errors on both the YES and NO machines.
  • BenKus
    BenKus
    1408 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-11T05:21:34Z  in response to SystemAdmin
    Hey Mike,

    What error are you getting?

    Ben
  • SystemAdmin
    SystemAdmin
    2808 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-11T12:36:02Z  in response to SystemAdmin
    While I have not looked at each and every one, it still appears to be Singular expression refers to nonexistent object.
  • jessewk
    jessewk
    536 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-11T21:29:39Z  in response to SystemAdmin
    plurality is your friend... also you are still querying HKCU directly which won't work because the client runs in system context.

    Try this:

    if (exists key "HKLM\Software\Google\Desktop" of registry) then (if (exists files (values "data_dir" of keys "Software\Google\Google Desktop\outlook_data" of current user keys (logged on users) of registry)) then ("Google Desktop installed. Outlook Index = YES") else ("Google Desktop installed. Outlook Index = NO")) else ("No Google Desktop")
  • SystemAdmin
    SystemAdmin
    2808 Posts
    ACCEPTED ANSWER

    Re: Singular expression refers to nonexistent object

    ‏2008-09-12T13:16:11Z  in response to SystemAdmin
    I don't think that will work. "outlook_data" is the name of a file. Because the location of this file will be different for every user, with Google creating a randomly named folder, I'm pulling the location from the registry key. So the key in your relevance doesn't exist.