How can I check if the user have full acrobat installed and not only Acrobat Reader?
How can I check if the user have full acrobat installed and not only Acrobat Reader?
I have only the reader, and it would seem to me that this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader
should exist on computers with the reader installed. You should probably use the key that the full version uses, though, just in case they are both installed.
I have the full package. You could see if under the UNINSTALL folder in the registry if DISTILLER is installed...
Thanks,
But how can I check in the registry if the key exist?
Search for Registry or similar. You'll find thousands of posts on it ;)
Yepp, I found many of them, but not any code there I could check
if the registry key exist.
Something like this:
If HKEY_CURRENT_USER, "SOFTWARE\Adobe\Acrobat Distiller\"= True Then ...
Just found this code: {I tweaked it a hair}
VB Code:
Const MAX_FILENAME_LEN = 260 Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long Private Sub Form_Load() 'KPD-Team 1999 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] 'Tweaked by Lou Dim i As Integer Dim s2 As String Dim MyFile As String MyFile = App.Path & "asdftemp.pdf" Dim MyF As Integer MyF = FreeFile Open MyFile For Output As #MyF Close MyF 'Check if the file exists If Dir(MyFile) = "" Or MyFile = "" Then MsgBox "File not found!", vbCritical Exit Sub End If 'Create a buffer s2 = String(MAX_FILENAME_LEN, 32) 'Retrieve the name and handle of the executable, associated with this file i = FindExecutable(MyFile, vbNullString, s2) If i > 32 Then MsgBox Left$(s2, InStr(s2, Chr$(0)) - 1) Else MsgBox "No association found !" End If End Sub
It returns:
Now, looking up reader on my machine, its exe is:Quote:
C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe
Therefore, if the string ends with Acrobat.exe, then its not the reader.Quote:
"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe"
Of course, if ".pdf" is not registered to either Acrobat or Reader, then the return won't be either.
;)
-Lou
That will not work for determining if the workstation has Acrobat
Approval installed. Approval is a limited version of the full version
Acrobat. They both use the same name for their executables.
So, with this method you cannot determine if the user has
Acrobat Approval or Acrobat full version.
Do you know whether the registry key is the same for Approval as it is for either of the other two versions?
True. However, besidesn the 30 days, whats the diff between Approval and regular Acrobat?Quote:
Originally posted by RobDog888
That will not work for determining if the workstation has Acrobat
Approval installed. Approval is a limited version of the full version
Acrobat. They both use the same name for their executables.
So, with this method you cannot determine if the user has
Acrobat Approval or Acrobat full version.
-Lou
The difference between Approval and Reader is that you can save
forms in pdf format. The difference between Approval and Full
Acrobat is Approval does not have the JavaScript console and
some other features. I can't do it justice so look here.
And how can I check if the user have Full Acrobat installed?
You will probably have to check the registry still. That code
posted above can not distinguish between Full and Approval
since the default install path is the same.
"Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe" for either one.
Let me check the registry and see if there is a difference.
Ok, RobDog888!
I guess you can solve this for me...;)
It looks like the only way is to enumerate the registry sub keys
under the Adobe key - [HKEY_LOCAL_MACHINE\SOFTWARE\Adobe
If Distiller found then = full version and if Approval also found
then Approval was overwritten by full version.
If Approval is found and no Distiller found then only Approval.
If Reader is found then Reader version in addition to either case above.
Also, there is another version that Adobe calls "Business Tools".
I don't know what it is but may need to allow for this fourth case.
HTH.
Ok Thanks again!
How does the code, to enumerate the registry sub keys
under the Adobe key - [HKEY_LOCAL_MACHINE\SOFTWARE\Adobe if destiller exist, look like?
Here is a sample on enumerating the registry keys.
Just modify it to enumerate the hive you need.VB Code:
Const ERROR_NO_MORE_ITEMS = 259& Const HKEY_CURRENT_CONFIG = &H80000005 Const HKEY_LOCAL_MACHINE = &H80000002 Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Private Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As Any) As Long Private Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long Private Sub Form_Load() 'KPD-Team 2001 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] Dim hKey As Long, Cnt As Long, sName As String, sData As String, Ret As Long, RetData As Long Const BUFFER_SIZE As Long = 255 'Set the forms graphics mode to persistent Me.AutoRedraw = True Me.Print "RegEnumKeyEx" Ret = BUFFER_SIZE 'Open the registry key If RegOpenKey(HKEY_LOCAL_MACHINE, "Hardware", hKey) = 0 Then 'Create a buffer sName = Space(BUFFER_SIZE) 'Enumerate the keys While RegEnumKeyEx(hKey, Cnt, sName, Ret, ByVal 0&, vbNullString, ByVal 0&, ByVal 0& <> ERROR_NO_MORE_ITEMS 'Show the enumerated key Me.Print " " + Left$(sName, Ret) 'prepare for the next key Cnt = Cnt + 1 sName = Space(BUFFER_SIZE) Ret = BUFFER_SIZE Wend 'close the registry key RegCloseKey hKey Else Me.Print " Error while calling RegOpenKey" End If Me.Print vbCrLf + "RegEnumValue" Cnt = 0 'Open a registry key If RegOpenKey(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion", hKey) = 0 Then 'initialize sName = Space(BUFFER_SIZE) sData = Space(BUFFER_SIZE) Ret = BUFFER_SIZE RetData = BUFFER_SIZE 'enumerate the values While RegEnumValue(hKey, Cnt, sName, Ret, 0, ByVal 0&, ByVal sData, RetData) <> ERROR_NO_MORE_ITEMS 'show data If RetData > 0 Then Me.Print " " + Left$(sName, Ret) + "=" + Left$(sData, RetData - 1) 'prepare for next value Cnt = Cnt + 1 sName = Space(BUFFER_SIZE) sData = Space(BUFFER_SIZE) Ret = BUFFER_SIZE RetData = BUFFER_SIZE Wend 'Close the registry key RegCloseKey hKey Else Me.Print " Error while calling RegOpenKey" End If End Sub
Are you sure Approval is a seperate from Full Acrobat?Quote:
Originally posted by RobDog888
If Distiller found then = full version and if Approval also found
then Approval was overwritten by full version.
If Approval is found and no Distiller found then only Approval.
If Reader is found then Reader version in addition to either case above.
It seems to be only a patch, and if so, does it matter if you have approval patched into Acrobat?
It surely doesn't destroy the existing functionality of the parent program, does it?
I mean, Acrobat.exe is still the full Acrobat, wether it has this patch or not?
If its not a patch, then why does the install screens title say "Patch".
-Just wondering
-Lou
http://www.vbforums.com/attachment.p...postid=1544414
Because what you have IS the patch for Approval. It patches Approval version 5.0.5.
Attached is the splash screen for Approval 5 that I have installed
on my laptop.
If you had the Full Acrobat at:
C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe
Where does approvals exe install itself?
If its the same install path, then what happens to Your full Acrobat?
-Lou
BTW, the Screenshot came from partially running the download from:
http://www.versiontracker.com/php/dl...x/A505AFP1.exe
Approval has a check in it to determine if Full Acrobat is installed
or not. If it is then Approval aborts the installation, since Adobe
thinks that you would not want to downgrade your Acrobat.
They both install to the same path and exe name.
Gotcha!
Thanks!
:)
No prob. Glad to help.
:)
RobDog888,
I tried your sample on enumerating the registry keys but I can't understand how I can do a function as Boolean of it.
If it's true, then full acrobat is installed. Can you show me that?
Ya, but I don't have time until tonight.
;)
Ok, I'll wait...:cool:
RobDog888...where are you...:)
Here I am. I had a busy weekend.
You will need to loop through the array of sub keys (from GetAllKeys function) to determine if the Distiller key is present or not.VB Code:
'Put this code into a module. Option Explicit Public Const HKEY_CLASSES_ROOT = &H80000000 Public Const HKEY_CURRENT_USER = &H80000001 Public Const HKEY_LOCAL_MACHINE = &H80000002 Public Const HKEY_USERS = &H80000003 Public Const HKEY_PERFORMANCE_DATA = &H80000004 Public Const HKEY_CURRENT_CONFIG = &H80000005 Public Const HKEY_DYN_DATA = &H80000006 Public Const REG_SZ = 1 ' Unicode nul terminated string Public Const REG_BINARY = 3 ' Free form binary Public Const REG_DWORD = 4 ' 32-bit number Public Const ERROR_SUCCESS = 0& Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, _ phkResult As Long) As Long Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long Public Declare Function RegEnumKey Lib "advapi32.dll" Alias "RegEnumKeyA" (ByVal hKey As Long, ByVal dwIndex As Long, _ ByVal lpName As String, ByVal cbName As Long) As Long Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, _ ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long Public Function GetAllKeys(hKey As Long, strPath As String) As Variant ' Returns: an array in a variant of strings Dim lRegResult As Long Dim lCounter As Long Dim hCurKey As Long Dim strBuffer As String Dim lDataBufferSize As Long Dim strNames() As String Dim intZeroPos As Integer lCounter = 0 lRegResult = RegOpenKey(hKey, strPath, hCurKey) Do 'initialise buffers (longest possible length=255) lDataBufferSize = 255 strBuffer = String(lDataBufferSize, " ") lRegResult = RegEnumKey(hCurKey, lCounter, strBuffer, lDataBufferSize) If lRegResult = ERROR_SUCCESS Then 'tidy up string and save it ReDim Preserve strNames(lCounter) As String intZeroPos = InStr(strBuffer, Chr$(0)) If intZeroPos > 0 Then strNames(UBound(strNames)) = Left$(strBuffer, intZeroPos - 1) Else strNames(UBound(strNames)) = strBuffer End If lCounter = lCounter + 1 Else Exit Do End If Loop GetAllKeys = strNames End Function Public Function GetSettingString(hKey As Long, strPath As String, strValue As String, Optional Default As String) As String Dim hCurKey As Long Dim lValueType As Long Dim strBuffer As String Dim lDataBufferSize As Long Dim intZeroPos As Integer Dim lRegResult As Long ' Set up default value If Not IsEmpty(Default) Then GetSettingString = Default Else GetSettingString = "" End If ' Open the key and get length of string lRegResult = RegOpenKey(hKey, strPath, hCurKey) lRegResult = RegQueryValueEx(hCurKey, strValue, 0&, lValueType, ByVal 0&, lDataBufferSize) If lRegResult = ERROR_SUCCESS Then If lValueType = [color=red]REG_SZ[/color] Then 'change to the type of value you are looking for (REG_SZ,REG_DWORD,REG_BINARY) ' initialise string buffer and retrieve string strBuffer = String(lDataBufferSize, " ") lRegResult = RegQueryValueEx(hCurKey, strValue, 0&, 0&, ByVal strBuffer, lDataBufferSize) ' format string intZeroPos = InStr(strBuffer, Chr$(0)) If intZeroPos > 0 Then GetSettingString = Left$(strBuffer, intZeroPos - 1) Else GetSettingString = strBuffer End If End If Else ' there is a problem End If lRegResult = RegCloseKey(hCurKey) End Function
Then you can use the second function to get the value if you need it.
:)
Thanks again RobDog888!
I can still not get it working. What exactly do you mean that I should do?