Results 1 to 22 of 22

Thread: [RESOLVED] detecting an install

  1. #1

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Resolved [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..

  2. #2
    Member
    Join Date
    Feb 2006
    Posts
    48

    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.

  3. #3

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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.

  4. #4
    Member
    Join Date
    Feb 2006
    Posts
    48

    Re: detecting an install

    Google?

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

    Quote 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?

  6. #6

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

    Then you don't need to mess with the registry. Use this
    VB Code:
    1. Private Sub Command3_Click()
    2. Dim MyPrinters As Printer
    3. If VB.Printers.Count > 0 Then
    4.   For Each MyPrinters In Printers
    5.     If MyPrinters.DeviceName = "CutePDF Writer" Then
    6.        MsgBox "CutePDF installed"
    7.        Exit For
    8.     End If
    9.   Next
    10. End If
    11. 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.

  8. #8

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

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

  10. #10
    Member
    Join Date
    Feb 2006
    Posts
    48

    Re: detecting an install

    Have you tried PDFTK?

    It's a completely free (and very good) app that converts to pdf.

    Find it here.

  11. #11
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160

    Re: detecting an install

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

  12. #12

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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

  13. #13
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

    Quote Originally Posted by litlewiki
    hack i need some example code for the query u answered
    VB Code:
    1. Private Declare Function SearchTreeForFile Lib "imagehlp" _
    2. (ByVal RootPath As String, ByVal InputPathName As String, _
    3. ByVal OutputPathBuffer As String) As Long
    4.  
    5. Private Const MAX_PATH = 260
    6.  
    7. Private Sub Command1_Click()
    8.     Dim tempStr As String, Ret As Long
    9.     'create a buffer string
    10.     tempStr = String(MAX_PATH, 0)
    11.     'returns 1 when successfull, 0 when failed
    12.     Ret = SearchTreeForFile("c:\", "YourPDFExecutableFileName.exe", tempStr)
    13.     If Ret <> 0 Then
    14.         MsgBox "Located file at " + Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1)
    15.     Else
    16.         MsgBox "File not found!"
    17.     End If
    18. End Sub

  14. #14

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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??

  15. #15
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

    Quote 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

  16. #16

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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

  17. #17
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

    Quote 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.......??????

  18. #18

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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!!

  19. #19
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

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

  20. #20

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

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

  21. #21
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting an install

    Quote 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.)

  22. #22

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: detecting an install

    sure hack !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width