help..how can design a script check acrobat reader has install from windows series

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dindinisgoodman
    Indigo Rose Customer
    • Jul 2008
    • 11

    help..how can design a script check acrobat reader has install from windows series

    Dear All

    How can design a script check acrobat reader has install from windows series
    (2000 XP VISTA)

    EX:
    when i click button >
    first, autoplay media studio can check has any acrobat reader/write version has install to windows OS

    if yes , open pdf file
    if not , show a IE error message.


    Please help me, I don't know how can do

    thanks
  • Ulrich
    Indigo Rose Staff Member
    • Apr 2005
    • 5130

    #2
    Why don't you use Project > Dependencies > Adobe Acrobat Reader?

    Ulrich

    Comment

    • dindinisgoodman
      Indigo Rose Customer
      • Jul 2008
      • 11

      #3
      Originally posted by upeters View Post
      Why don't you use Project > Dependencies > Adobe Acrobat Reader?

      Ulrich
      HI Ulrich

      because I use 3 different language page , if i use [Project > Dependencies > Adobe Acrobat Reader] , it's only show english message box.

      and my customers hope me can show 3 differnet languages error message from htm page.
      so, when customers click [user manual] button , the software can check
      has acrobat install in the windows , if YES continue and open PDF manual
      if NOT show error htm page

      so , I'm dejected and time 's urgent.
      How can i do or how can write a script ?



      Please help me .
      Thank you again!

      Comment

      • Ulrich
        Indigo Rose Staff Member
        • Apr 2005
        • 5130

        #4
        This is actually very easy. Take a look at the code below, and try to understand what I am doing. Transform this code into a function, if you will, returning appropriate result codes to display corresponding localized messages for each situation. And once you understood, remove the dialogs which show on every step what is being done.

        Code:
        -- Check for registered .pdf handler
        res = Registry.DoesKeyExist(HKEY_CLASSES_ROOT, ".pdf");
        if res then
            -- there is an application registered to handle pdf documents
            Dialog.Message("Registry", "Class .pdf known", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON2);
            default = Registry.GetValue(HKEY_CLASSES_ROOT, ".pdf", "", true);
            Dialog.Message("Default PDF handler", default, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON2);
            -- see if registered default document handler wasn't uninstalled already
            command = Registry.GetValue(HKEY_CLASSES_ROOT, default.."\\shell\\open\\command", "", true);
            Dialog.Message("PDF Command", command, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON2);
            -- try to find the document handler (strip the argument "%1" from command)
            file = String.Mid(command, 1, String.ReverseFind(command, " ", false));
            Dialog.Message("PDF Application", file, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON2);
            -- remove quotes
            file = String.Replace(file, "\"", "", false);
            -- try to open document handler
            attributes = File.GetAttributes(file);
            if (attributes ~= nil) then
                Dialog.Message("PDF Application", "Registered PDF handler installed", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON2);
            else
                Dialog.Message("PDF Application", "Registered PDF handler could not be found", MB_OK, MB_ICONSTOP, MB_DEFBUTTON2);
            end
        else
            -- no application registered to handle pdf documents
            Dialog.Message("Registry", "Class .pdf unknown", MB_OK, MB_ICONSTOP, MB_DEFBUTTON2);
        end
        The code was tested against FoxReader 2, Adobe Acrobat 4 and 5 and should work with more recent versions as well.

        Ulrich

        Comment

        • dindinisgoodman
          Indigo Rose Customer
          • Jul 2008
          • 11

          #5
          HI Ulrich

          I'm thank you again, you save my life
          I try the function is fine,

          thank you and have a good day !



          Originally posted by upeters View Post
          This is actually very easy. Take a look at the code below, and try to understand what I am doing. Transform this code into a function, if you will, returning appropriate result codes to display corresponding localized messages for each situation. And once you understood, remove the dialogs which show on every step what is being done.


          The code was tested against FoxReader 2, Adobe Acrobat 4 and 5 and should work with more recent versions as well.

          Ulrich

          Comment

          • arb
            Indigo Rose Customer
            • Jul 2007
            • 163

            #6
            Originally posted by dindinisgoodman View Post
            because I use 3 different language page , if i use [Project > Dependencies > Adobe Acrobat Reader] , it's only show english message box.
            I think you can type your warrning message in 3 different languages just in Dependencies/Dialog and after that you can use '_AcrobatReaderVer' variable to work with. I did this to some of my projects already.

            Comment

            • dindinisgoodman
              Indigo Rose Customer
              • Jul 2008
              • 11

              #7
              Originally posted by arb View Post
              I think you can type your warrning message in 3 different languages just in Dependencies/Dialog and after that you can use '_AcrobatReaderVer' variable to work with. I did this to some of my projects already.
              I do not understand how do use '_AcrobatReaderVer' for check acrobat!
              could you let me know how use '_AcrobatReaderVer'?

              Comment

              • RizlaUK
                Indigo Rose Customer
                • May 2006
                • 5552

                #8
                you can use the same adobe script that AMS uses, simply go to the dependencies folder of your AMS install and find the adobe .det file, unpack it with winrar and view the code in the lua file and use it in your project without needing the dependencie check
                Embrace change in your life, you never know, it could all work out for the best

                Comment

                Working...
                X