Nope. Here's my code:
#include registry.h
local oRegistry, lnVals, lcClass
oRegistry= newobject("Registry","Registry.prg")
dimension taVals[1,2]
lnVals=oRegistry.GetEnumKeys(@taVals,HKEY_LOCAL_MACHINE, ;
"Software\Adobe\Acrobat Distiller")
do case
case ascan(taVals,"5.0") > 0
lcClass = "wwPDF50"
case ascan(taVals,"4.0") > 0
lcClass = "wwPDF40"
otherwise
lcClass = ""
endcase
>On my PC at work I've Acrobat 5.0 and PDFWriter 4.0 installed. Your check certenly will fail in this case.
>
>>I used a similar algorithm (see my reply to Steve in another thread). However, machine can not have Adobe Acrobat at all, so your method is not complete. I looked through the registry yesterday and since Distiller was at the top, I just decided to use it.
>>
>>Thanks anyway. My code worked in several tests, we conducted on few machines and my manager is going to migrate it to Live today.
>>
>>>Nadya,
>>>
>>>I've PDFWriter 5.0 installed on my PC and there is PDFWriter item with value 1 under HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat\5.0\Uninstall registry key. I think you can check for it to determine if PDFWriter 5.0 is installed. Using Rick's registry class
>>>#DEFINE HKEY_LOCAL_MACHINE 2147483646
>>>oReg = NEWOBJECT("Registry", "Registry.prg")
>>>lcRegKey = "SOFTWARE\Adobe\Acrobat\5.0\Uninstall"
>>>lnValue = oReg.ReadRegistryInt(HKEY_LOCAL_MACHINE,lcRegKey, "PDFWriter")
>>>IF NOT ISNULL(lnValue) AND lnValue = 1
>>> * PDFWriter 5.0 is installed
>>>ELSE
>>> * Assume that PDFWriter 4.0 is installed
>>>ENDIF
>>>
>>>
>>>>Hi everybody,
>>>>
>>>>Most computers in our office have Adobe Acrobat Writer 4 installed. My manager's computer has Adobe 5. I was trying to use wwPDF class from west-wind.com wwPDF50 doesn't work on my machine (with Adobe 4 installed) and wwPDF40 refers to IsWinNT function, which is not included into the wwPDF archive. In any case, I need to know, which Adobe version is installed to use the correct class.
>>>>
>>>>What can you suggest in this situation? Any other simple solutions, which would not require a 3rd party product?
>>>>
>>>>Thanks a lot in advance.
If it's not broken, fix it until it is.
My Blog