Hello,
I would like to check if Ghostscript is installed on a computer. So I check the key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript in the registry. But how can I check if the key is present ? Using dc_regquery("Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript","") does not work, also dc_regquery(,"Computer\HKEY_CURRENT_USER\Software\GPL Ghostscript","image") . I always get back 2, the same value like keys that are not existing.
regards
Rudolf
dc_regquery()
Re: dc_regquery()
I don't have Ghostscript installed on this computer.
What does the actual key look like in the registry?
What does the actual key look like in the registry?
The eXpress train is coming - and it has more cars.
Re: dc_regquery()
Hello Roger,
attached a screenshot, also "Image" instead of "image" does not help.
regards
Rudolf
attached a screenshot, also "Image" instead of "image" does not help.
regards
Rudolf
- Attachments
-
- reg.jpg (24.05 KiB) Viewed 9758 times
Re: dc_regquery()
Hi Rudolf,
In your screenshot there is local_USER instead of local_MACHINE? Maybe this the cause?
Code: Select all
"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript
Re: dc_regquery()
Hi, Rudolf.
Your syntax:
is wrong. It should be:
Ghostscript creates a key section "GPL Ghostscript" and subsections (folders) with the version number, like "9.04". To be honest, I can't access any keys in HKEY_LOCAL_MACHINE using DC_RegQuery, while HKEY_CURRENT_USER seems to work perfect. I checked for rights, but even an app running with admin rights always returns "2" when doing this.
This works (returns 0, if a key folder exists, and 2 if not):
Your syntax:
Code: Select all
dc_regquery("Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript","")
Code: Select all
DC_RegQuery(HKEY_LOCAL_MACHINE,"SOFTWARE\GPL Ghostscript",<cKey>)
This works (returns 0, if a key folder exists, and 2 if not):
Code: Select all
DC_RegQuery(HKEY_CURRENT_USER,"SOFTWARE\Microsoft") -> 0
DC_RegQuery(HKEY_CURRENT_USER,"SOFTWARE\Verymicrosoft") -> 2
DC_RegQuery(HKEY_CURRENT_USER,"SOFTWARE\HyCARE") -> 0
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: dc_regquery()
Hello Tom,
thank you, whe I use now dc_regquery( HKEY_CURRENT_USER ,"Software\GPL Ghostscript","") it works now to get 0 if Ghostscript is installed and 2 if not.
regards
Rudolf
thank you, whe I use now dc_regquery( HKEY_CURRENT_USER ,"Software\GPL Ghostscript","") it works now to get 0 if Ghostscript is installed and 2 if not.
regards
Rudolf
Re: dc_regquery()
Hi, Rudolf.
Excellent.
But it won't work if Ghostscript was installed for all users by the admin. Then, the Ghostscript section resides in HKEY_LOCAL_MACHINE. DC_RegQuery does not return "0" in that situation.
Excellent.

But it won't work if Ghostscript was installed for all users by the admin. Then, the Ghostscript section resides in HKEY_LOCAL_MACHINE. DC_RegQuery does not return "0" in that situation.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."