2 Replies Latest reply on Oct 3, 2007 5:58 AM by Chunick

    How to check Windows for Acrobat Reader?

    tallscot Level 1
      Hello, everyone. I hope you are having a nice weekend! :)

      I'm trying to check to see if Windows XP PCs have Acrobat Reader installed on a button that launches a PDF file. This is what I have:
      on mouseUp
      set Acrobat = baFindApp( "pdf" )
      if Acrobat = "" then
      Alert "You will need to install Adobe Acrobat Reader to view the PDF documents properly."
      else
      baOpenFile(the pathName&"Data/button1.pdf","")
      end if
      end

      This launches the PDF on Windows if Acrobat is installed without errors, but when I uninstall Reader and click on the button, nothing happens. I don't get the alert and I don't get the PDF launched.

      This script actually gives me the alert on the Mac, but it's moot.

      Any ideas?

      Thanks!
        • 1. Re: How to check Windows for Acrobat Reader?
          Level 7
          There are 2 things you can do about it.

          1) Check to see what the response is from your baFindApp() command. It
          should return the path to the executable. You can then use
          baFileExists() to see if the program is really there. If the problem is
          that Acrobat Reader was installed then uninstalled, it may have left the
          registry info, so baFindApp thinks it is still installed.

          2) Check the response of baOpenFile(). It may give an error code which
          you can use to send an error alert to the user.
          • 2. How to check Windows for Acrobat Reader?
            Chunick Level 3
            It's not clear if you uninstalled Reader and then rebooted... this might give a false positive... also, the notes for the docs strongly suggest that baFindApp() looks for the registration of the file extension which would be located in the registry...

            ... an interesting note: if Adobe Acrobat and Reader are both installed, for instance, then the baFindApp() call will return Acrobat.exe as the application (on my system, anyways) - technically, Acrobat, Reader and GoLive have all registered .pdf on my machine, but the registry lists entries alphabetically so Acrobat gets the recognition, so-to-speak.

            It would appear that baFindApp() has a flaw if two or more applications have registered the same extension.