dc_regquery()

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

dc_regquery()

#1 Post by c-tec »

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
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_regquery()

#2 Post by rdonnay »

I don't have Ghostscript installed on this computer.
What does the actual key look like in the registry?
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dc_regquery()

#3 Post by c-tec »

Hello Roger,
attached a screenshot, also "Image" instead of "image" does not help.
regards
Rudolf
Attachments
reg.jpg
reg.jpg (24.05 KiB) Viewed 9764 times
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dc_regquery()

#4 Post by skiman »

Hi Rudolf,

Code: Select all

"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript
In your screenshot there is local_USER instead of local_MACHINE? Maybe this the cause?
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dc_regquery()

#5 Post by Tom »

Hi, Rudolf.

Your syntax:

Code: Select all

dc_regquery("Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript","")
is wrong. It should be:

Code: Select all

DC_RegQuery(HKEY_LOCAL_MACHINE,"SOFTWARE\GPL Ghostscript",<cKey>)
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):

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."

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dc_regquery()

#6 Post by c-tec »

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
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dc_regquery()

#7 Post by Tom »

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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply