|
-
Mar 16th, 2006, 08:57 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] detecting an install
my applic uses the neevia sdk(neevia.com) to convert documents to pdf .so it is necessay to have it installed if one wants to create a pdf.
my query is that how can i detect whether neevia sdk is already installed or not.
its displayed as "docuPrinter sdk 5.2" in the control panel..
-
Mar 16th, 2006, 09:09 AM
#2
Member
Re: detecting an install
Find the registry key for this on your own machine (where it's definitely installed) then run a check in your program that looks for the same one on the user's machine. If it's not there then raise an error.
-
Mar 16th, 2006, 09:12 AM
#3
Thread Starter
Frenzied Member
Re: detecting an install
i knew it had something to do with registries .but i have never worked on registries before .are u aware of sources when i can get enough help on managing registries.
-
Mar 16th, 2006, 09:22 AM
#4
Member
-
Mar 16th, 2006, 09:46 AM
#5
Re: detecting an install
 Originally Posted by litlewiki
my applic uses the neevia sdk(neevia.com) to convert documents to pdf .so it is necessay to have it installed if one wants to create a pdf.
my query is that how can i detect whether neevia sdk is already installed or not.
its displayed as "docuPrinter sdk 5.2" in the control panel..
Is this like CutePDF that gets installed as if it were a printer?
-
Mar 16th, 2006, 09:51 AM
#6
Thread Starter
Frenzied Member
Re: detecting an install
yea and it has a wonderful documentation on how to implement its api functions.
it gets installed into all office applications.nice one though not free.
-
Mar 16th, 2006, 09:53 AM
#7
Re: detecting an install
Then you don't need to mess with the registry. Use this
VB Code:
Private Sub Command3_Click()
Dim MyPrinters As Printer
If VB.Printers.Count > 0 Then
For Each MyPrinters In Printers
If MyPrinters.DeviceName = "CutePDF Writer" Then
MsgBox "CutePDF installed"
Exit For
End If
Next
End If
End Sub
Change CutePDF Writer to the printer name you are looking for. I just tested this on my box (and I do have CutePDF), and I got the message box informing me that it was here.
-
Mar 16th, 2006, 10:05 AM
#8
Thread Starter
Frenzied Member
Re: detecting an install
that should defintely work as that was installed as a printer
what if the required application was installed as a program alone and not a printer
-
Mar 16th, 2006, 10:07 AM
#9
Re: detecting an install
 Originally Posted by litlewiki
that should defintely work as that was installed as a printer
what if the required application was installed as a program alone and not a printer
If you know the name of the .exe file, then you can use the SearchTreeForFile API to find it. If you need an example let me know.
-
Mar 16th, 2006, 10:37 AM
#10
Member
Re: detecting an install
Have you tried PDFTK?
It's a completely free (and very good) app that converts to pdf.
Find it here.
-
Mar 16th, 2006, 02:22 PM
#11
Frenzied Member
Re: detecting an install
 Originally Posted by ProMac
Have you tried PDFTK?
It's a completely free (and very good) app that converts to pdf.
Find it here.
He already has a PDF creator. Why would he want another?
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
-
Mar 16th, 2006, 03:01 PM
#12
Thread Starter
Frenzied Member
Re: detecting an install
no i would opt a free pdf converter provided it has enough documentation on using its api... specially from vb6!!. hack i need some example code for the query u answered
-
Mar 17th, 2006, 07:11 AM
#13
Re: detecting an install
 Originally Posted by litlewiki
hack i need some example code for the query u answered
VB Code:
Private Declare Function SearchTreeForFile Lib "imagehlp" _
(ByVal RootPath As String, ByVal InputPathName As String, _
ByVal OutputPathBuffer As String) As Long
Private Const MAX_PATH = 260
Private Sub Command1_Click()
Dim tempStr As String, Ret As Long
'create a buffer string
tempStr = String(MAX_PATH, 0)
'returns 1 when successfull, 0 when failed
Ret = SearchTreeForFile("c:\", "YourPDFExecutableFileName.exe", tempStr)
If Ret <> 0 Then
MsgBox "Located file at " + Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1)
Else
MsgBox "File not found!"
End If
End Sub
-
Mar 17th, 2006, 12:08 PM
#14
Thread Starter
Frenzied Member
Re: detecting an install
does this code search the entire c: in every folder whether such an executable file exists? would'nt that be a long and tedious process??
-
Mar 17th, 2006, 12:12 PM
#15
Re: detecting an install
 Originally Posted by litlewiki
does this code search the entire c: in every folder whether such an executable file exists? would'nt that be a long and tedious process??
Try it on something you know is there like WINWORD.EXE
It took roughly one second for it to return:
Located file at c:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE
-
Mar 17th, 2006, 12:17 PM
#16
Thread Starter
Frenzied Member
Re: detecting an install
i don say its a bad idea .but i thought there are other better ways to do .what if it was installed somewhere in the 4th partition on a 120 gb hdd(just an example).wouldnt that take a long time?.
p.s:i fully agree with your soln though,thanks hack
-
Mar 17th, 2006, 12:38 PM
#17
Re: detecting an install
 Originally Posted by litlewiki
i don say its a bad idea .but i thought there are other better ways to do .what if it was installed somewhere in the 4th partition on a 120 gb hdd(just an example).wouldnt that take a long time?.
Yes, and it would also take one whole heck of a lot of recursive code.
However, your alternative is.......??????
-
Mar 17th, 2006, 12:55 PM
#18
Thread Starter
Frenzied Member
Re: detecting an install
every program when installed adds itself to the control panel which means it adds itself to the registry .i made a search and found the unistall info located at hklm/software/microsoft/windows/currentversion/uninstall (replace / with \) .so may be if we could make a search here and find the value!! just an idea never played with the registry!!
-
Mar 17th, 2006, 01:02 PM
#19
Re: detecting an install
 Originally Posted by litlewiki
every program when installed adds itself to the control panel which means it adds itself to the registry .i made a search and found the unistall info located at hklm/software/microsoft/windows/currentversion/uninstall (replace / with \) .so may be if we could make a search here and find the value!! just an idea never played with the registry!!
If that works for you, then do it. There are a ton of examples on writing registry code on this forum.
-
Mar 17th, 2006, 02:21 PM
#20
Thread Starter
Frenzied Member
Re: detecting an install
hack i serached the forum got his code snippet and modified a little it searches if windows media player 10 is installed or not ..
any suggestions ,tips,tricks,tweaks???
Last edited by litlewiki; Apr 13th, 2007 at 02:02 PM.
-
Mar 17th, 2006, 02:32 PM
#21
Re: detecting an install
 Originally Posted by litlewiki
hack i serached the forum got his code snippet and modified a little it searches if windows media player 10 is installed or not ..
any suggestions ,tips,tricks,tweaks???
It looks like it works, so go for it.
The only suggestion is to make sure Option Explicit is set (which it is not in your sample project.)
-
Mar 17th, 2006, 03:19 PM
#22
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|