Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-2344

GMAT does not work with file association system

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: P1
    • Resolution: Unresolved
    • Affects Version/s: R2016a
    • Fix Version/s: None
    • Component/s: Miscellaneous
    • Labels:
      None
    • Environment:

      Operating System: Windows 7
      Platform: PC

      Description

      If I create a file with a custom extension (say, .gmat) and associate it with GMAT.exe in Windows, I should be able to double-click the file and have it open in GMAT.

      Right now this doesn't work because when GMAT opens, it can't find the startup file. I haven't confirmed, but I'm guessing it's because Windows opens GMAT in the working directory of my file, and GMAT looks in the working directory for gmat_startup_file.txt.

      This would be extremely useful behavior, and I believe the fix is to make GMAT looks in the same folder as GMAT.exe for the startup file, not in the current working directory.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              jjkparker Joel Parker added a comment -

              I confirmed the issue: GMAT is starting with a working directory of the script file, and it's looking in that directory for the startup file. When I put the startup file alongside the script, it gets far enough to complain about data files.

              As per the 07/14 meeting, it sounds like the fix should be to first check the current working directory for the startup file, then check the GMAT bin directory.

              Show
              jjkparker Joel Parker added a comment - I confirmed the issue: GMAT is starting with a working directory of the script file, and it's looking in that directory for the startup file. When I put the startup file alongside the script, it gets far enough to complain about data files. As per the 07/14 meeting, it sounds like the fix should be to first check the current working directory for the startup file, then check the GMAT bin directory.
              Hide
              djcinsb Darrel Conway added a comment -

              I did a little checking for a platform independent way to locate the startup folder for a program, with no luck finding one. On Linux (and probably Mac) I think there is an association related way to do this using argv[0] for main, so we might be able to get to it on those platforms if needed, but suggest waiting until it is needed there.

              On Windows, there is a function, getmodulefilename(), that could be useful for this. See:

              http://msdn.microsoft.com/en-us/library/ms683197%28v=vs.85%29.aspx

              for a description of the function, and this:

              http://stackoverflow.com/questions/143174/c-c-how-to-obtain-the-full-path-of-current-directory

              for an example (in a comment that starts with "Here's code to get the full path to the executing app:", about 1/3 of the way down).

              Show
              djcinsb Darrel Conway added a comment - I did a little checking for a platform independent way to locate the startup folder for a program, with no luck finding one. On Linux (and probably Mac) I think there is an association related way to do this using argv [0] for main, so we might be able to get to it on those platforms if needed, but suggest waiting until it is needed there. On Windows, there is a function, getmodulefilename(), that could be useful for this. See: http://msdn.microsoft.com/en-us/library/ms683197%28v=vs.85%29.aspx for a description of the function, and this: http://stackoverflow.com/questions/143174/c-c-how-to-obtain-the-full-path-of-current-directory for an example (in a comment that starts with "Here's code to get the full path to the executing app:", about 1/3 of the way down).
              Hide
              gmatloj Linda Jun added a comment -

              Darrel,
              The information you gave was very useful. Thanks. - Linda

              Show
              gmatloj Linda Jun added a comment - Darrel, The information you gave was very useful. Thanks. - Linda
              Hide
              gmatloj Linda Jun added a comment -

              This should work in 2011-12-15 build or later.

              Show
              gmatloj Linda Jun added a comment - This should work in 2011-12-15 build or later.
              Hide
              jjkparker Joel Parker added a comment -

              Linda, does this need assignment to Wendy or Darrel for Linux/Mac?

              Show
              jjkparker Joel Parker added a comment - Linda, does this need assignment to Wendy or Darrel for Linux/Mac?
              Hide
              gmatloj Linda Jun added a comment -

              Since I only tested on Windows, I'm assigning this to Wendy for Mac.

              Wendy,
              In GmatFileUtil::GetApplicationPath(), there is a section for _MAC_ that needs to be implemented.

              Darrel,
              I put the code for _LINUX_ based on the link provided below, so it needs testing.

              Show
              gmatloj Linda Jun added a comment - Since I only tested on Windows, I'm assigning this to Wendy for Mac. Wendy, In GmatFileUtil::GetApplicationPath(), there is a section for _ MAC _ that needs to be implemented. Darrel, I put the code for _ LINUX _ based on the link provided below, so it needs testing.
              Hide
              gmat_wcs Wendy Shoan added a comment -

              Removing "Windows" from title, as it needs to be implemented for Mac and Linux as well.

              Show
              gmat_wcs Wendy Shoan added a comment - Removing "Windows" from title, as it needs to be implemented for Mac and Linux as well.

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: