run exe on target computer, but path unknown

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Loes
    Indigo Rose Customer
    • Dec 2007
    • 81

    run exe on target computer, but path unknown

    Hi everyone,


    I would like to use AMS to create a tutorial for our drawing program, where the AutoPlay Media Studio menu points to various movies showing the drawing software in action, plus a printable step-by-step guide etc.

    I would like to add a button where the user can launch the drawing software already installed on her computer, to do the exercise shown in my tutorial movie.
    So I guess could create a button with a Quick Action "Run Program", but....

    ... what if the user didn't install the program in the default location (C:\Program Files\Pre-Design 3\Pre-Design_3.exe) but somewhere else on the computer?

    What do I have to add (and where) to let my tutorial menu find the program on the target computer?

    I have been thinking of a workaround: to let the menu open a document in *.pre-format: that way the associated program (Pre-Design) will be launched. But if there is a way to let the button launch the program directly, I'd prefer that.

    Thanks in advance for any help !


    Loes, newbie without any scripting skills, which meeans that I really, really need help
  • Mina
    Forum Member
    • Oct 2005
    • 630

    #2
    Can't you save the path somewhere in the Registry while installing (Pre-Design) so you could use Registry.GetValue to determine the program's *.exe

    If not, a search for the *.exe file seems to be the best way to do it.

    Comment

    • Loes
      Indigo Rose Customer
      • Dec 2007
      • 81

      #3
      Most users of my new tutorial will already have Pre-Design installed on their system (some installed even months and years ago), so the registry won't help.

      Search would then be the only option: where do I put that script?
      Say I have a button to launch the Pre-Design drawing program (normally on C:\Program Files, but could be a different drive), I add a Quick Action to that button: Run Program. SO far so good, but then....

      ... In the properties window for the Quick Action I see two places where a path to the program can be entered: what do I put in those fields? Leave the Working folder empty I guess?
      Or do I attach another action to the same button? If so which?

      This is all pretty scary to me. On the AMQ website I read that we can use AutoPlay Media Study without any scripting knowledge, but when I look here in the forum it's all about scirpting and you guys just making up cool stuff by typing lines of code.... hmmm, there's a long way to go for me.

      If anyone could help me in getting that "search" idea into the right fields, I'd be grateful forever

      Loes

      Comment

      • Mina
        Forum Member
        • Oct 2005
        • 630

        #4
        Forget 'QuickAction' for now.
        Try this, in 'Scripts'

        Code:
        drvz = Drive.Enumerate();
        for i, drv in drvz do
        fD = File.Find(drv.."\\Program Files\\Pre-Design 3\\", "Pre-Design_3.exe", false, true, nil, nil);
        if fD ~= nil then
        found = true
        path = fD[1]
        end
        end
        
        if found then
        File.Open(found, "", SW_SHOWNORMAL);
        else
        Dialog.Message("Notice", "Not Found", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
        end

        Comment

        • Loes
          Indigo Rose Customer
          • Dec 2007
          • 81

          #5
          Wow, Thanks a bunch for the quick reply!!

          Happy 2008

          Loes

          Comment

          • mjmfgm
            Forum Member
            • Dec 2007
            • 7

            #6
            Having the same problem as this user

            I have the same problem with demo files, I tried the script and it does not work for me ?
            Here is the code I changed:
            drvz = Drive.Enumerate();
            for i, drv in drvz do
            fD = File.Find(drv.."\\Program Files\\Colorado Outdoors\\3Dem\\", "3dem.exe", false, true, nil, nil);
            if fD ~= nil then
            found = true
            path = fD[1]
            end
            end

            if found then
            File.Open(found,"", SW_SHOWNORMAL);
            else
            Dialog.Message("Notice", "Not Found", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
            end
            .................................................. ....................
            The error message is:
            Line 11, Argument 1 must be of type string
            .................................................. ....................
            Thanks for your help in advance

            Comment

            • Mina
              Forum Member
              • Oct 2005
              • 630

              #7
              Oh Im sorry, Line11 should be

              Code:
              File.Open([B][COLOR="SeaGreen"]path[/COLOR][/B],"", SW_SHOWNORMAL);
              Lil' Typo

              Comment

              • mjmfgm
                Forum Member
                • Dec 2007
                • 7

                #8
                Thanks

                Thanks I will give this a try, happy hollidays.

                Comment

                • mjmfgm
                  Forum Member
                  • Dec 2007
                  • 7

                  #9
                  It works Thanks a Lot

                  It works Thanks a Lot for all your help and fast reply:yes

                  Comment

                  • Mina
                    Forum Member
                    • Oct 2005
                    • 630

                    #10
                    You're welcome, both

                    Comment

                    Working...
                    X